summaryrefslogtreecommitdiff
path: root/lib/libkeynote
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-05-24 02:11:42 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-05-24 02:11:42 +0000
commit0044de2ef658703e40c2d4ed7374243940eea6e7 (patch)
treecdfd5eebc8dec16a2030d80c26fddc078e4c4c71 /lib/libkeynote
parent543d22541329c09638033dc250e49bff4834bbaa (diff)
Update Makefile, fix README, add a proper usage in keynote-main.c
Diffstat (limited to 'lib/libkeynote')
-rw-r--r--lib/libkeynote/Makefile.distribution165
-rw-r--r--lib/libkeynote/README20
-rw-r--r--lib/libkeynote/keynote-main.c20
3 files changed, 190 insertions, 15 deletions
diff --git a/lib/libkeynote/Makefile.distribution b/lib/libkeynote/Makefile.distribution
new file mode 100644
index 00000000000..201ed14e47f
--- /dev/null
+++ b/lib/libkeynote/Makefile.distribution
@@ -0,0 +1,165 @@
+# $OpenBSD: Makefile.distribution,v 1.1 1999/05/24 02:11:40 angelos Exp $
+#
+# The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
+#
+# This code was written by Angelos D. Keromytis in Philadelphia, PA, USA,
+# in April-May 1998
+#
+# Copyright (C) 1998, 1999 by Angelos D. Keromytis.
+#
+# Permission to use, copy, and modify this software without fee
+# is hereby granted, provided that this entire notice is included in
+# all copies of any software which is or includes a copy or
+# modification of this software.
+#
+# THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTY. IN PARTICULAR, THE AUTHORS MAKES NO
+# REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
+# MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
+# PURPOSE.
+
+VERSION = 2-beta2
+DISTFILE = keynote-${VERSION}.tar.gz
+KNSUBDIR = KeyNote-${VERSION}
+
+RANLIB = ranlib
+MKDIR = mkdir
+YACC = yacc
+#YACC = bison
+TRUE = true
+LEX = flex
+TAR = tar
+CC = gcc
+RM = rm
+AR = ar
+NROFF = nroff
+
+TARFLAGS = -cvzf ${DISTFILE}
+YACCFLAGS2 = -d -p kv -b z
+YACCFLAGS = -d -p kn -b k
+LEXFLAGS2 = -Pkv -s -i
+LEXFLAGS = -Cr -Pkn -s -i
+CFLAGS = -O2 #-Wall -g
+RMFLAGS2 = -rf
+RMFLAGS = -f
+NROFFFLAGS = -mandoc
+
+# SSLeay/OpenSSL pointers
+SSLINC = -I/usr/local/include -I/usr/local/ssl/include \
+ -I/usr/local/openssl/include
+SSLLIB = -L/usr/lib -L/usr/local/lib -L/usr/local/ssl/lib \
+ -L/usr/local/openssl/lib -L/usr/local/openssl/ -lcrypto
+
+# No-crypto compile/link flags and definitions
+NOCRYPTODEFS = #-DPGPLIB -DNO_SNPRINTF -DNEED_GETOPT -DPILOT
+NOCRYPTOINC = -I.
+NOCRYPTOLIBS = -L. -lkeynote -lm
+
+# Final compile/link flags and definitions
+DEFS = -DCRYPTO ${NOCRYPTODEFS}
+INC = $(SSLINC) ${NOCRYPTOINC}
+LIBS = ${NOCRYPTOLIBS} ${SSLLIB}
+
+TARGET = libkeynote.a
+TARGET2 = keynote
+
+#GETOPT = getopt.o
+OBJS = k.tab.o lex.kn.o environment.o parse_assertion.o \
+ signature.o aux.o base64.o $(GETOPT)
+OBJS2 = z.tab.o lex.kv.o keynote-verify.o keynote-sign.o keynote-sigver.o \
+ keynote-keygen.o keynote-main.o
+
+crypto: all
+
+nocrypto:
+ ${MAKE} LIBS="${NOCRYPTOLIBS}" INC="${NOCRYPTOINC}" \
+ DEFS="${NOCRYPTODEFS}"
+
+all: $(TARGET) $(TARGET2)
+
+library: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(AR) -cvr $(TARGET) $(OBJS)
+ $(RANLIB) $(TARGET)
+
+$(TARGET2): $(TARGET) $(OBJS2)
+ $(CC) $(CFLAGS) -o $(TARGET2) $(OBJS2) $(LIBS)
+
+k.tab.c: keynote.y environment.h signature.h
+ $(YACC) $(YACCFLAGS) keynote.y
+
+z.tab.c: keynote-ver.y keynote.h
+ $(YACC) $(YACCFLAGS2) keynote-ver.y
+
+lex.kn.c: keynote.l k.tab.h environment.h assertion.h signature.h
+ $(LEX) $(LEXFLAGS) keynote.l
+
+lex.kv.c: keynote-ver.l z.tab.h keynote.h
+ $(LEX) $(LEXFLAGS2) keynote-ver.l
+
+.c.o:
+ $(CC) $(CFLAGS) $(DEFS) $(INC) -c $<
+
+aux.c: environment.h signature.h
+parse_assertion.c: assertion.h environment.h signature.h
+environment.c: environment.h
+keynote-verify.c: keynote.h
+environment.h: keynote.h
+assertion.h: keynote.h
+signature.h: assertion.h
+signature.c: signature.h
+keynote-keygen.c: signature.h
+keynote-sign.c: signature.h
+keynote-sigver.c: signature.h
+base64.c: keynote.h
+
+clean:
+ $(RM) $(RMFLAGS) $(OBJS) $(OBJS2) a.out *.core *~ */*~
+
+cleandir: cleanall
+
+cleanall: clean
+ $(RM) $(RMFLAGS) *.o k.tab.c lex.kn.c k.tab.h z.tab.c z.tab.h
+ $(RM) $(RMFLAGS) lex.kv.c y.output z.output ${DISTFILE}
+ $(RM) $(RMFLAGS) $(TARGET) $(TARGET2) man/*.0
+
+test: all
+ ./$(TARGET2) verify -e testsuite/test-env \
+ -r false,maybe,probably,true \
+ -k testsuite/auth1 -k testsuite/auth2 -k testsuite/auth3 \
+ -k testsuite/auth4 \
+ -l testsuite/test-assertion1 -l testsuite/test-assertion2 \
+ -l testsuite/test-assertion3 -l testsuite/test-assertion4 \
+ -l testsuite/test-assertion5 -l testsuite/test-assertion6 \
+ -l testsuite/test-assertion7 || ${TRUE}
+
+manpages: mankeynote mansystem mansign manver mansigver mankeygen
+
+mankeynote:
+ ${NROFF} ${NROFFFLAGS} man/keynote.3 > man/keynote.0
+
+mansystem:
+ ${NROFF} ${NROFFFLAGS} man/keynote.4 > man/keynote-system.0
+
+mansign:
+ ${NROFF} ${NROFFFLAGS} man/keynote-sign.1 > man/keynote-sign.0
+
+mansigver:
+ ${NROFF} ${NROFFFLAGS} man/keynote-sigver.1 > man/keynote-sigver.0
+
+manver:
+ ${NROFF} ${NROFFFLAGS} man/keynote-verify.1 > man/keynote-verify.0
+
+mankeygen:
+ ${NROFF} ${NROFFFLAGS} man/keynote-keygen.1 > man/keynote-keygen.0
+
+distribution: test cleanall manpages
+ ${MKDIR} ${KNSUBDIR}
+ $(TAR) cf - . | (cd ${KNSUBDIR}; ${TAR} xf -)
+ ${RM} ${RMFLAGS2} ${KNSUBDIR}/CVS ${KNSUBDIR}/testsuite/CVS \
+ ${KNSUBDIR}/Misc/CVS ${KNSUBDIR}/${KNSUBDIR} \
+ ${KNSUBDIR}/.cvsignore ${KNSUBDIR}/man/CVS \
+ ${KNSUBDIR}/man/.cvsignore ${KNSUBDIR}/doc/CVS
+ $(TAR) $(TARFLAGS) ${KNSUBDIR}
+ ${RM} ${RMFLAGS2} ${KNSUBDIR}
diff --git a/lib/libkeynote/README b/lib/libkeynote/README
index 4eba6dcbe47..d12580f17bb 100644
--- a/lib/libkeynote/README
+++ b/lib/libkeynote/README
@@ -1,4 +1,4 @@
-# $OpenBSD: README,v 1.1 1999/05/23 22:11:03 angelos Exp $
+# $OpenBSD: README,v 1.2 1999/05/24 02:11:41 angelos Exp $
This is release 2-beta2 of the KeyNote trust management library reference
implementation.
@@ -50,14 +50,16 @@ Compile tips:
can get a copy of a regular expression library from the KeyNote web
page (see below).
-The Makefile creates the libkeynote.a library and the keynote-verify,
-keynote-keygen, keynote-sigver, and keynote-sign programs. There's a
-man page for the library calls (keynote.3) and one for each of the
-utilities in the man/ directory. There is also a man page about KeyNote
-itself (keynote.4), which contains some text from the spec.
+The Makefile creates the libkeynote.a library and the keynote program.
+*** Notice that the 4 programs of previous releases have been folded into one
+
+There is a man page for the library calls (keynote.3) and one for each of the
+keynote utility functions, in the man/ directory. There is also a man page
+about KeyNote itself (keynote.4), which contains some text from the spec.
To view them, use:
+ nroff -mandoc keynote.1 | more
nroff -mandoc keynote.3 | more
nroff -mandoc keynote.4 | more
nroff -mandoc keynote-verify.1 | more
@@ -70,10 +72,10 @@ nroff does not support the -mandoc flag, use -man instead. For those
systems that do not have nroff, the text version of the man pages are
provided as well (the files with .0 suffixes in the same directory).
-The keynote-verify program can be used to verify a request, given a
+The "keynote verify" function can be used to verify a request, given a
set of assertions and an environment file. The directory testsuite/
-has some examples assertions. The keynote-keygen program can
-be used to generate keys. The keynote-sign and keynote-sigver can be
+has some examples assertions. The "keynote keygen" function can
+be used to generate keys. The "keynote sign" and "keynote sigver" can be
used to sign assertions, and verify signed assertions respectively.
The file base64.c was taken from the OpenBSD libc and was slightly
diff --git a/lib/libkeynote/keynote-main.c b/lib/libkeynote/keynote-main.c
index 44115fd798e..f1c703eea3f 100644
--- a/lib/libkeynote/keynote-main.c
+++ b/lib/libkeynote/keynote-main.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: keynote-main.c,v 1.3 1999/05/24 02:11:41 angelos Exp $ */
+
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
*
@@ -36,6 +38,16 @@
extern int keynote_sign(int, char **), keynote_sigver(int, char **);
extern int keynote_verify(int, char **), keynote_keygen(int, char **);
+void
+mainusage()
+{
+ fprintf(stderr, "Usage:\n");
+ fprintf(stderr, "\tsign ...\n");
+ fprintf(stderr, "\tsigver ...\n");
+ fprintf(stderr, "\tverify ...\n");
+ fprintf(stderr, "\tkeygen ...\n");
+}
+
#ifdef WIN32
void
#else
@@ -45,7 +57,7 @@ main(int argc, char *argv[])
{
if (argc < 2)
{
- fprintf(stderr, "Insufficient number of arguments.\n");
+ mainusage();
exit(-1);
}
@@ -61,10 +73,6 @@ main(int argc, char *argv[])
if (!strcmp(argv[1], "keygen"))
keynote_keygen(argc - 1, argv + 1);
- fprintf(stderr, "Usage:\n");
- fprintf(stderr, "\tsign ...\n");
- fprintf(stderr, "\tsigver ...\n");
- fprintf(stderr, "\tverify ...\n");
- fprintf(stderr, "\tkeygen ...\n");
+ mainusage();
exit(-1);
}