From d784a738139448819b0f9634632e144f11ce8445 Mon Sep 17 00:00:00 2001 From: "Angelos D. Keromytis" Date: Fri, 1 Oct 1999 01:08:32 +0000 Subject: Update for version 2.0 --- lib/libkeynote/keynote-keygen.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'lib/libkeynote/keynote-keygen.c') diff --git a/lib/libkeynote/keynote-keygen.c b/lib/libkeynote/keynote-keygen.c index 06cca5c14ee..85c79fd0475 100644 --- a/lib/libkeynote/keynote-keygen.c +++ b/lib/libkeynote/keynote-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-keygen.c,v 1.3 1999/05/31 20:09:59 angelos Exp $ */ +/* $OpenBSD: keynote-keygen.c,v 1.4 1999/10/01 01:08:30 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,19 +19,29 @@ * PURPOSE. */ +#if HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + #include #include #include -#include #include +#include + +#if STDC_HEADERS +#include +#endif /* STDC_HEADERS */ + +#if HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ -#ifdef WIN32 -#include +#if HAVE_IO_H #include -#else /* WIN32 */ +#elif HAVE_UNISTD_H #include -#endif /* WIN32 */ +#endif /* HAVE_IO_H */ #include "keynote.h" #include "assertion.h" @@ -90,11 +100,7 @@ print_key(FILE *fp, char *algname, char *key, int start, int length) fprintf(fp, "\"\n"); } -#ifdef WIN32 void -#else /* WIN32 */ -int -#endif /* WIN32 */ keynote_keygen(int argc, char *argv[]) { int begin = KEY_PRINT_OFFSET, prlen = KEY_PRINT_LENGTH; @@ -106,9 +112,7 @@ keynote_keygen(int argc, char *argv[]) DSA *dsa; RSA *rsa; FILE *fp; -#if defined(KEYNOTERNDFILENAME) int fd, cnt = RND_BYTES; -#endif /* KEYNOTERNDFILENAME */ #endif /* CRYPTO || PGPLIB */ char *algname; @@ -172,10 +176,7 @@ keynote_keygen(int argc, char *argv[]) fprintf(stderr, "Invalid specified keysize %d\n", len); exit(-1); } -#endif /* CRYPTO || PGPLIB */ -#if defined(CRYPTO) -#if defined(KEYNOTERNDFILENAME) fd = open(KEYNOTERNDFILENAME, O_RDONLY, 0); if (fd < 0) { @@ -214,9 +215,6 @@ keynote_keygen(int argc, char *argv[]) cnt -= fd; } while (cnt > 0); -#else /* KEYNOTERNDFILENAME */ -#error "No RNG available!" -#endif /* KEYNOTERNDFILENAME */ if ((alg == KEYNOTE_ALGORITHM_DSA) && (ienc == INTERNAL_ENC_ASN1) && -- cgit v1.2.3