diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkeynote/Makefile.in | 19 | ||||
-rw-r--r-- | lib/libkeynote/aux.c | 3 | ||||
-rw-r--r-- | lib/libkeynote/base64.c | 3 | ||||
-rw-r--r-- | lib/libkeynote/environment.c | 14 | ||||
-rw-r--r-- | lib/libkeynote/header.h | 66 | ||||
-rw-r--r-- | lib/libkeynote/keynote-keygen.c | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote-sign.c | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote-sigver.c | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote-ver.l | 6 | ||||
-rw-r--r-- | lib/libkeynote/keynote-ver.y | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote-verify.c | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote.3 | 12 | ||||
-rw-r--r-- | lib/libkeynote/keynote.h | 17 | ||||
-rw-r--r-- | lib/libkeynote/keynote.l | 3 | ||||
-rw-r--r-- | lib/libkeynote/keynote.y | 3 | ||||
-rw-r--r-- | lib/libkeynote/parse_assertion.c | 3 | ||||
-rw-r--r-- | lib/libkeynote/signature.c | 3 |
17 files changed, 54 insertions, 118 deletions
diff --git a/lib/libkeynote/Makefile.in b/lib/libkeynote/Makefile.in index 273718b9171..2cffc0d22f9 100644 --- a/lib/libkeynote/Makefile.in +++ b/lib/libkeynote/Makefile.in @@ -1,4 +1,3 @@ -# $OpenBSD: Makefile.in,v 1.4 1999/10/09 06:59:37 angelos Exp $ # # The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) # @@ -18,7 +17,7 @@ # MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR # PURPOSE. -VERSION = 2.1 +VERSION = 2.0 DISTFILE = keynote-${VERSION}.tar.gz KNSUBDIR = KeyNote-${VERSION} @@ -84,13 +83,13 @@ $(TARGET): $(OBJS) $(TARGET2): $(TARGET) $(OBJS2) $(CC) $(CFLAGS) -o $(TARGET2) $(OBJS2) $(LIBS) -k.tab.c: keynote.y header.h keynote.h assertion.h config.h +k.tab.c: keynote.y keynote.h assertion.h config.h $(YACC) $(YACCFLAGS) keynote.y z.tab.c: keynote-ver.y keynote.h header.h config.h $(YACC) $(YACCFLAGS2) keynote-ver.y -lex.kn.c: keynote.l k.tab.h header.h keynote.h assertion.h config.h +lex.kn.c: keynote.l k.tab.h keynote.h assertion.h config.h $(LEX) $(LEXFLAGS) keynote.l lex.kv.c: keynote-ver.l z.tab.h keynote.h header.h config.h @@ -99,16 +98,16 @@ lex.kv.c: keynote-ver.l z.tab.h keynote.h header.h config.h .c.o: $(CC) $(CFLAGS) $(DEFS) $(INC) -c $< -aux.c: header.h keynote.h assertion.h signature.h config.h -parse_assertion.c: header.h keynote.h assertion.h signature.h config.h -environment.c: header.h keynote.h assertion.h config.h -keynote-verify.c: header.h keynote.h header.h config.h -signature.c: header.h keynote.h assertion.h signature.h config.h +aux.c: keynote.h assertion.h signature.h config.h +parse_assertion.c: keynote.h assertion.h signature.h config.h +environment.c: keynote.h assertion.h config.h +keynote-verify.c: keynote.h header.h config.h +signature.c: keynote.h assertion.h signature.h config.h keynote-keygen.c: keynote.h assertion.h signature.h header.h config.h keynote-sign.c: keynote.h header.h config.h keynote-sigver.c: keynote.h header.h config.h keynote-main.c: header.h config.h -base64.c: header.h keynote.h config.h +base64.c: keynote.h config.h clean: $(RM) $(RMFLAGS) $(OBJS) $(OBJS2) a.out *.core *~ */*~ diff --git a/lib/libkeynote/aux.c b/lib/libkeynote/aux.c index 6f58cf9e576..46e88773ca0 100644 --- a/lib/libkeynote/aux.c +++ b/lib/libkeynote/aux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aux.c,v 1.5 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: aux.c,v 1.6 1999/10/09 19:47:31 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -36,7 +36,6 @@ #include <limits.h> #endif /* HAVE_LIMITS_H */ -#include "header.h" #include "keynote.h" #include "assertion.h" #include "signature.h" diff --git a/lib/libkeynote/base64.c b/lib/libkeynote/base64.c index 59586c5f762..c5130f379da 100644 --- a/lib/libkeynote/base64.c +++ b/lib/libkeynote/base64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: base64.c,v 1.4 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: base64.c,v 1.5 1999/10/09 19:47:31 angelos Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. * @@ -57,7 +57,6 @@ #endif /* !HAVE_STRCHR */ #endif /* STDC_HEADERS */ -#include "header.h" #include "keynote.h" #if defined(HAVE___B64_NTOP) diff --git a/lib/libkeynote/environment.c b/lib/libkeynote/environment.c index daca4913f07..fa39a0a2f23 100644 --- a/lib/libkeynote/environment.c +++ b/lib/libkeynote/environment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: environment.c,v 1.7 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: environment.c,v 1.8 1999/10/09 19:47:31 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -49,7 +49,6 @@ #include <unistd.h> #endif /* HAVE_IO_H */ -#include "header.h" #include "keynote.h" #include "assertion.h" @@ -794,8 +793,8 @@ kn_query(struct environment *env, char **retvalues, int numval, /* Action set */ for (en = env; en != (struct environment *) NULL; en = en->env_next) - if (kn_add_action(sessid, en->env_name, en->env_value, - en->env_flags) == -1) + if (kn_add_action(sessid, en->env_name, en->env_value, en->env_flags) == + -1) { serrno = keynote_errno; kn_close(sessid); @@ -805,8 +804,8 @@ kn_query(struct environment *env, char **retvalues, int numval, /* Locally trusted assertions */ for (i = 0; i < numtrusted; i++) - if ((kn_add_assertion(sessid, trusted[i], trustedlen[i], - ASSERT_FLAG_LOCAL) == -1) && (keynote_errno == ERROR_MEMORY)) + if (kn_add_assertion(sessid, trusted[i], trustedlen[i], + ASSERT_FLAG_LOCAL) == -1) { serrno = keynote_errno; kn_close(sessid); @@ -816,8 +815,7 @@ kn_query(struct environment *env, char **retvalues, int numval, /* Untrusted assertions */ for (i = 0; i < numuntrusted; i++) - if ((kn_add_assertion(sessid, untrusted[i], untrustedlen[i], 0) == -1) - && (keynote_errno == ERROR_MEMORY)) + if (kn_add_assertion(sessid, untrusted[i], untrustedlen[i], 0) == -1) { serrno = keynote_errno; kn_close(sessid); diff --git a/lib/libkeynote/header.h b/lib/libkeynote/header.h index 7c14b508a55..64d2bd4afe9 100644 --- a/lib/libkeynote/header.h +++ b/lib/libkeynote/header.h @@ -1,4 +1,4 @@ -/* $OpenBSD: header.h,v 1.3 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: header.h,v 1.4 1999/10/09 19:47:31 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -26,6 +26,7 @@ extern void keynote_sign(int, char **), keynote_sigver(int, char **); extern void keynote_verify(int, char **), keynote_keygen(int, char **); extern void print_key(FILE *, char *, char *, int, int); +extern void mystrncpy(char *, char *, int); extern void print_space(FILE *, int); extern int read_environment(char *); extern void parse_key(char *); @@ -38,72 +39,11 @@ int sessid; /* Defines */ #define SEED_LEN 40 #define RND_BYTES 1024 -#define DEFAULT_PUBLIC 0x10001 +#define DEFAULT_PUBLIC 0x10001 #define KEY_PRINT_OFFSET 12 #define KEY_PRINT_LENGTH 50 #define SIG_PRINT_OFFSET 12 #define SIG_PRINT_LENGTH 50 - -#if !defined(HAVE_STRCASECMP) && defined(HAVE_STRICMP) -#define strcasecmp stricmp -#endif /* !HAVE_STRCASECMP && HAVE_STRICMP */ - -#if !defined(HAVE_STRNCASECMP) && defined(HAVE_STRNICMP) -#define strncasecmp strnicmp -#endif /* !HAVE_STRNCASECMP && HAVE_STRNICMP */ - -#if !defined(HAVE_OPEN) && defined(HAVE__OPEN) -#define open _open -#endif /* !HAVE_OPEN && HAVE__OPEN */ - -#if !defined(HAVE_READ) && defined(HAVE__READ) -#define read _read -#endif /* !HAVE_READ && HAVE__OPEN */ - -#if !defined(HAVE_CLOSE) && defined(HAVE__CLOSE) -#define close _close -#endif /* !HAVE_CLOSE && HAVE__CLOSE */ - -#if defined(CRYPTO) -#if HAVE__DEV_URANDOM -#define KEYNOTERNDFILENAME "/dev/urandom" -#else /* HAVE__DEV_URANDOM */ -#error "You need a random device!" -#endif /* HAVE__DEV_URANDOM */ -#endif /* CRYPTO */ - -/* Includes */ -#if HAVE_REGEX_H -#include <sys/types.h> -#include <regex.h> -#endif /* HAVE_REGEX_H */ - -#if defined(CRYPTO) -#if HAVE_OPENSSL_CRYPTO_H -#include <openssl/crypto.h> -#include <openssl/dsa.h> -#include <openssl/rsa.h> -#include <openssl/sha.h> -#include <openssl/md5.h> -#include <openssl/err.h> -#include <openssl/rand.h> -#include <openssl/x509.h> -#include <openssl/pem.h> -#elif HAVE_SSL_CRYPTO_H -#include <ssl/crypto.h> -#include <ssl/dsa.h> -#include <ssl/rsa.h> -#include <ssl/sha.h> -#include <ssl/md5.h> -#include <ssl/err.h> -#include <ssl/rand.h> -#include <ssl/x509.h> -#include <ssl/pem.h> -#else /* HAVE_OPENSSL_CRYPTO_H */ -#error "SSLeay or OpenSSL not detected!" -#endif /* HAVE_OPENSSL_CRYPTO_H */ -#endif /* CRYPTO */ - #endif /* _HEADER_H_ */ diff --git a/lib/libkeynote/keynote-keygen.c b/lib/libkeynote/keynote-keygen.c index 40b236b42b9..1736f64c82c 100644 --- a/lib/libkeynote/keynote-keygen.c +++ b/lib/libkeynote/keynote-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-keygen.c,v 1.6 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote-keygen.c,v 1.7 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -43,10 +43,10 @@ #include <unistd.h> #endif /* HAVE_IO_H */ -#include "header.h" #include "keynote.h" #include "assertion.h" #include "signature.h" +#include "header.h" void keygenusage(void) diff --git a/lib/libkeynote/keynote-sign.c b/lib/libkeynote/keynote-sign.c index f6d5076ef1b..515009c268d 100644 --- a/lib/libkeynote/keynote-sign.c +++ b/lib/libkeynote/keynote-sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-sign.c,v 1.7 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote-sign.c,v 1.8 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -43,8 +43,8 @@ #include <unistd.h> #endif /* HAVE_IO_H */ -#include "header.h" #include "keynote.h" +#include "header.h" void signusage(void) diff --git a/lib/libkeynote/keynote-sigver.c b/lib/libkeynote/keynote-sigver.c index c32ca177eba..8bf8f333ad3 100644 --- a/lib/libkeynote/keynote-sigver.c +++ b/lib/libkeynote/keynote-sigver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-sigver.c,v 1.6 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote-sigver.c,v 1.7 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -43,8 +43,8 @@ #include <unistd.h> #endif /* HAVE_IO_H */ -#include "header.h" #include "keynote.h" +#include "header.h" void sigverusage(void) diff --git a/lib/libkeynote/keynote-ver.l b/lib/libkeynote/keynote-ver.l index 08e7cab74a6..f0f5917bf5e 100644 --- a/lib/libkeynote/keynote-ver.l +++ b/lib/libkeynote/keynote-ver.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: keynote-ver.l,v 1.5 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote-ver.l,v 1.6 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -47,10 +47,8 @@ #endif #include "z.tab.h" -#include "header.h" #include "keynote.h" - -static void mystrncpy(char *, char *, int); +#include "header.h" %} vstring [a-zA-Z0-9][a-zA-Z0-9_]* litstring \"(([^\"\n])|(\\[\"\n\f\r\t.]))*\" diff --git a/lib/libkeynote/keynote-ver.y b/lib/libkeynote/keynote-ver.y index 7da60717606..5e64661e091 100644 --- a/lib/libkeynote/keynote-ver.y +++ b/lib/libkeynote/keynote-ver.y @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-ver.y,v 1.5 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote-ver.y,v 1.6 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -40,8 +40,8 @@ #include <string.h> #endif /* STDC_HEADERS */ -#include "header.h" #include "keynote.h" +#include "header.h" %} %% diff --git a/lib/libkeynote/keynote-verify.c b/lib/libkeynote/keynote-verify.c index 16dba2baf50..f8f7f8a5e99 100644 --- a/lib/libkeynote/keynote-verify.c +++ b/lib/libkeynote/keynote-verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-verify.c,v 1.6 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote-verify.c,v 1.7 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -54,8 +54,8 @@ #include <unistd.h> #endif /* HAVE_IO_H */ -#include "header.h" #include "keynote.h" +#include "header.h" void verifyusage(void) diff --git a/lib/libkeynote/keynote.3 b/lib/libkeynote/keynote.3 index f1adb669eb1..b4f7d208543 100644 --- a/lib/libkeynote/keynote.3 +++ b/lib/libkeynote/keynote.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: keynote.3,v 1.13 1999/10/09 06:59:37 angelos Exp $ +.\" $OpenBSD: keynote.3,v 1.14 1999/10/09 19:47:32 angelos Exp $ .\" .\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) .\" @@ -28,8 +28,6 @@ .Nm KeyNote .Nd a trust-management system library .Sh SYNOPSIS -.Fd #include <sys/types.h> -.Fd #include <regex.h> .Fd #include <keynote.h> .Bd -literal @@ -549,13 +547,7 @@ indicating the returned value to the query. On failure, it returns \-1 and sets .Va keynote_errno to the same values as -.Xr kn_do_query 3 , -or to -.Er ERROR_MEMORY -if a trusted or untrusted assertion could not be added to the session due -to lack of memory resources. Syntax errors in assertions will not be reported -by -.Fn kn_query . +.Xr kn_do_query 3 . .Pp .Fn kn_encode_base64 converts the data of length diff --git a/lib/libkeynote/keynote.h b/lib/libkeynote/keynote.h index a08a3e0ac4f..4dc8edde33f 100644 --- a/lib/libkeynote/keynote.h +++ b/lib/libkeynote/keynote.h @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote.h,v 1.9 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote.h,v 1.10 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -22,6 +22,21 @@ #ifndef __KEYNOTE_H__ #define __KEYNOTE_H__ +#include <sys/types.h> +#include <regex.h> + +#include <ssl/crypto.h> +#include <ssl/dsa.h> +#include <ssl/rsa.h> +#include <ssl/sha.h> +#include <ssl/md5.h> +#include <ssl/err.h> +#include <ssl/rand.h> +#include <ssl/x509.h> +#include <ssl/pem.h> + +#define KEYNOTERNDFILENAME "/dev/urandom" + struct environment { char *env_name; diff --git a/lib/libkeynote/keynote.l b/lib/libkeynote/keynote.l index 6acbb727a47..ef299602916 100644 --- a/lib/libkeynote/keynote.l +++ b/lib/libkeynote/keynote.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: keynote.l,v 1.4 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote.l,v 1.5 1999/10/09 19:47:32 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -47,7 +47,6 @@ #endif #include "k.tab.h" -#include "header.h" #include "keynote.h" #include "assertion.h" diff --git a/lib/libkeynote/keynote.y b/lib/libkeynote/keynote.y index 5f1786f6124..fe81a0af93f 100644 --- a/lib/libkeynote/keynote.y +++ b/lib/libkeynote/keynote.y @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote.y,v 1.4 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: keynote.y,v 1.5 1999/10/09 19:47:33 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -57,7 +57,6 @@ #include <string.h> #endif /* STDC_HEADERS */ -#include "header.h" #include "keynote.h" #include "assertion.h" diff --git a/lib/libkeynote/parse_assertion.c b/lib/libkeynote/parse_assertion.c index 2e520b1c2ce..cb2489e41aa 100644 --- a/lib/libkeynote/parse_assertion.c +++ b/lib/libkeynote/parse_assertion.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse_assertion.c,v 1.4 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: parse_assertion.c,v 1.5 1999/10/09 19:47:33 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -36,7 +36,6 @@ #include <limits.h> #endif /* HAVE_LIMITS_H */ -#include "header.h" #include "keynote.h" #include "assertion.h" #include "signature.h" diff --git a/lib/libkeynote/signature.c b/lib/libkeynote/signature.c index 2e42362c4f1..480c89c4b2a 100644 --- a/lib/libkeynote/signature.c +++ b/lib/libkeynote/signature.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signature.c,v 1.8 1999/10/09 06:59:37 angelos Exp $ */ +/* $OpenBSD: signature.c,v 1.9 1999/10/09 19:47:33 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -40,7 +40,6 @@ #include <limits.h> #endif /* HAVE_LIMITS_H */ -#include "header.h" #include "keynote.h" #include "assertion.h" #include "signature.h" |