From 1565c127b1bdcc74ee76a732acd8d8ea330dbce5 Mon Sep 17 00:00:00 2001 From: Mathieu Sauve-Frankel Date: Fri, 25 Jun 2004 05:06:50 +0000 Subject: Make crufty configure stuff go away. Remove all unused code paths. No change in binaries. ok millert@ deraadt@ hshoexer@ --- lib/libkeynote/Makefile | 4 +- lib/libkeynote/auxil.c | 23 +-- lib/libkeynote/base64.c | 368 ++------------------------------------- lib/libkeynote/environment.c | 39 +---- lib/libkeynote/header.h | 53 +----- lib/libkeynote/keynote-keygen.c | 39 +---- lib/libkeynote/keynote-main.c | 23 +-- lib/libkeynote/keynote-sign.c | 22 +-- lib/libkeynote/keynote-sigver.c | 24 +-- lib/libkeynote/keynote-ver.l | 26 +-- lib/libkeynote/keynote-ver.y | 11 +- lib/libkeynote/keynote-verify.c | 35 +--- lib/libkeynote/keynote.l | 26 +-- lib/libkeynote/keynote.y | 31 +--- lib/libkeynote/parse_assertion.c | 19 +- lib/libkeynote/sample-app.c | 9 +- lib/libkeynote/signature.c | 94 +--------- 17 files changed, 86 insertions(+), 760 deletions(-) (limited to 'lib') diff --git a/lib/libkeynote/Makefile b/lib/libkeynote/Makefile index 5157832c0c4..e4aff3328ee 100644 --- a/lib/libkeynote/Makefile +++ b/lib/libkeynote/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2000/05/18 08:35:36 angelos Exp $ +# $OpenBSD: Makefile,v 1.15 2004/06/25 05:06:49 msf Exp $ LIB= keynote MAN= keynote.3 keynote.4 keynote.5 @@ -16,7 +16,7 @@ MLINKS= keynote.3 kn_init.3 keynote.3 kn_add_assertion.3 \ kn_sign_assertion.3 keynote.3 kn_verify_assertion.3 \ keynote.3 kn_free_key.3 keynote.3 kn_get_string.3 NOPIC= -CFLAGS+= -Wall -DCRYPTO -DHAVE_CONFIG_H -I. -I${.CURDIR} +CFLAGS+= -Wall -I. -I${.CURDIR} LEXFLAGS = -Cr -Pkn -s -i YACCFLAGS = -d -p kn -b k diff --git a/lib/libkeynote/auxil.c b/lib/libkeynote/auxil.c index 7f58ce18256..14a42ebc957 100644 --- a/lib/libkeynote/auxil.c +++ b/lib/libkeynote/auxil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auxil.c,v 1.7 2001/09/03 20:14:51 deraadt Exp $ */ +/* $OpenBSD: auxil.c,v 1.8 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,22 +19,13 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include -#include -#include -#include - -#if STDC_HEADERS -#include -#endif /* STDC_HEADERS */ -#if HAVE_LIMITS_H +#include #include -#endif /* HAVE_LIMITS_H */ +#include +#include +#include #include "header.h" #include "keynote.h" @@ -49,17 +40,14 @@ keynote_keyhash(void *key, int alg) { struct keynote_binary *bn; unsigned int res = 0, i; -#ifdef CRYPTO DSA *dsa; RSA *rsa; -#endif /* CRYPTO */ if (key == (void *) NULL) return 0; switch (alg) { -#ifdef CRYPTO case KEYNOTE_ALGORITHM_DSA: dsa = (DSA *) key; res += BN_mod_word(dsa->p, HASHTABLESIZE); @@ -79,7 +67,6 @@ keynote_keyhash(void *key, int alg) res += BN_mod_word(rsa->n, HASHTABLESIZE); res += BN_mod_word(rsa->e, HASHTABLESIZE); return res % HASHTABLESIZE; -#endif /* CRYPTO */ case KEYNOTE_ALGORITHM_BINARY: bn = (struct keynote_binary *) key; diff --git a/lib/libkeynote/base64.c b/lib/libkeynote/base64.c index 37b32d26f83..414352809fe 100644 --- a/lib/libkeynote/base64.c +++ b/lib/libkeynote/base64.c @@ -1,66 +1,35 @@ -/* $OpenBSD: base64.c,v 1.9 2002/02/16 21:27:26 millert Exp $ */ +/* $OpenBSD: base64.c,v 1.10 2004/06/25 05:06:49 msf Exp $ */ +/* $OpenBSD: base64.c,v 1.10 2004/06/25 05:06:49 msf Exp $ */ /* - * Copyright (c) 1996 by Internet Software Consortium. + * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. + * This code was written by Angelos D. Keromytis in Philadelphia, PA, USA, + * in April-May 1998 * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -/* - * Portions Copyright (c) 1995 by International Business Machines, Inc. - * - * International Business Machines, Inc. (hereinafter called IBM) grants - * permission under its copyrights to use, copy, modify, and distribute this - * Software with or without fee, provided that the above copyright notice and - * all paragraphs of this notice appear in all copies, and that the name of IBM - * not be used in connection with the marketing of any product incorporating - * the Software or modifications thereof, without specific, written prior - * permission. + * Copyright (C) 1998, 1999 by Angelos D. Keromytis. + * + * Permission to use, copy, and modify this software with or 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. * - * To the extent it has a right to do so, IBM grants an immunity from suit - * under its patents, if any, for the use, sale or manufacture of products to - * the extent that such products are used for performing Domain Name System - * dynamic updates in TCP/IP networks by means of the Software. No immunity is - * granted for any product per se or for any other function of any product. - * - * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, - * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN - * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. + * 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. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include -#include -#include -#include -#if STDC_HEADERS +#include +#include +#include #include -#if !defined(HAVE_STRCHR) -#define strchr index -#endif /* !HAVE_STRCHR */ -#endif /* STDC_HEADERS */ #include "header.h" #include "keynote.h" -#if defined(HAVE___B64_NTOP) int __b64_ntop(unsigned char const *, size_t, char *, size_t); int __b64_pton(char const *, unsigned char *, size_t); @@ -92,302 +61,3 @@ unsigned int targsize; keynote_errno = ERROR_SYNTAX; return i; } -#else /* HAVE___B64_NTOP */ -#define Assert(Cond) if (!(Cond)) { keynote_errno = ERROR_SYNTAX; return -1; } - -static const char Base64[] = -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -static const char Pad64 = '='; - -/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) - The following encoding technique is taken from RFC 1521 by Borenstein - and Freed. It is reproduced here in a slightly edited form for - convenience. - - A 65-character subset of US-ASCII is used, enabling 6 bits to be - represented per printable character. (The extra 65th character, "=", - is used to signify a special processing function.) - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8-bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - - Each 6-bit group is used as an index into an array of 64 printable - characters. The character referenced by the index is placed in the - output string. - - Table 1: The Base64 Alphabet - - Value Encoding Value Encoding Value Encoding Value Encoding - 0 A 17 R 34 i 51 z - 1 B 18 S 35 j 52 0 - 2 C 19 T 36 k 53 1 - 3 D 20 U 37 l 54 2 - 4 E 21 V 38 m 55 3 - 5 F 22 W 39 n 56 4 - 6 G 23 X 40 o 57 5 - 7 H 24 Y 41 p 58 6 - 8 I 25 Z 42 q 59 7 - 9 J 26 a 43 r 60 8 - 10 K 27 b 44 s 61 9 - 11 L 28 c 45 t 62 + - 12 M 29 d 46 u 63 / - 13 N 30 e 47 v - 14 O 31 f 48 w (pad) = - 15 P 32 g 49 x - 16 Q 33 h 50 y - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a quantity. When fewer than 24 input - bits are available in an input group, zero bits are added (on the - right) to form an integral number of 6-bit groups. Padding at the - end of the data is performed using the '=' character. - - Since all base64 input is an integral number of octets, only the - ------------------------------------------------- - following cases can arise: - - (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded - output will be an integral multiple of 4 characters - with no "=" padding, - (2) the final quantum of encoding input is exactly 8 bits; - here, the final unit of encoded output will be two - characters followed by two "=" padding characters, or - (3) the final quantum of encoding input is exactly 16 bits; - here, the final unit of encoded output will be three - characters followed by one "=" padding character. - */ - -int -kn_encode_base64(src, srclength, target, targsize) -unsigned char const *src; -unsigned int srclength; -char *target; -unsigned int targsize; -{ - unsigned int datalength = 0; - unsigned char input[3]; - unsigned char output[4]; - int i; - - keynote_errno = 0; - while (2 < srclength) { - input[0] = *src++; - input[1] = *src++; - input[2] = *src++; - srclength -= 3; - - output[0] = input[0] >> 2; - output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); - output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); - output[3] = input[2] & 0x3f; - Assert(output[0] < 64); - Assert(output[1] < 64); - Assert(output[2] < 64); - Assert(output[3] < 64); - - if (datalength + 4 > targsize) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - target[datalength++] = Base64[output[0]]; - target[datalength++] = Base64[output[1]]; - target[datalength++] = Base64[output[2]]; - target[datalength++] = Base64[output[3]]; - } - - /* Now we worry about padding. */ - if (0 != srclength) { - /* Get what's left. */ - input[0] = input[1] = input[2] = '\0'; - for (i = 0; i < srclength; i++) - input[i] = *src++; - - output[0] = input[0] >> 2; - output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); - output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); - Assert(output[0] < 64); - Assert(output[1] < 64); - Assert(output[2] < 64); - - if (datalength + 4 > targsize) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - target[datalength++] = Base64[output[0]]; - target[datalength++] = Base64[output[1]]; - if (srclength == 1) - target[datalength++] = Pad64; - else - target[datalength++] = Base64[output[2]]; - target[datalength++] = Pad64; - } - if (datalength >= targsize) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - target[datalength] = '\0'; /* Returned value doesn't count \0. */ - return (datalength); -} - -/* skips all whitespace anywhere. - converts characters, four at a time, starting at (or after) - src from base - 64 numbers into three 8 bit bytes in the target area. - it returns the number of data bytes stored at the target, or -1 on error. - */ - -int -kn_decode_base64(src, target, targsize) -char const *src; -unsigned char *target; -unsigned int targsize; -{ - int tarindex, state, ch; - char *pos; - - keynote_errno = 0; - state = 0; - tarindex = 0; - - while ((ch = *src++) != '\0') { - if (isspace((int) ch)) /* Skip whitespace anywhere. */ - continue; - - if (ch == Pad64) - break; - - pos = strchr(Base64, ch); - if (pos == 0) /* A non-base64 character. */ - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - switch (state) { - case 0: - if (target) { - if (tarindex >= targsize) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - target[tarindex] = (pos - Base64) << 2; - } - state = 1; - break; - case 1: - if (target) { - if (tarindex + 1 >= targsize) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - target[tarindex] |= (pos - Base64) >> 4; - target[tarindex+1] = ((pos - Base64) & 0x0f) - << 4 ; - } - tarindex++; - state = 2; - break; - case 2: - if (target) { - if (tarindex + 1 >= targsize) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - target[tarindex] |= (pos - Base64) >> 2; - target[tarindex+1] = ((pos - Base64) & 0x03) - << 6; - } - tarindex++; - state = 3; - break; - case 3: - if (target) { - if (tarindex >= targsize) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - target[tarindex] |= (pos - Base64); - } - tarindex++; - state = 0; - break; - } - } - - /* - * We are done decoding Base-64 chars. Let's see if we ended - * on a byte boundary, and/or with erroneous trailing characters. - */ - - if (ch == Pad64) { /* We got a pad char. */ - ch = *src++; /* Skip it, get next. */ - switch (state) { - case 0: /* Invalid = in first position */ - case 1: /* Invalid = in second position */ - keynote_errno = ERROR_SYNTAX; - return (-1); - - case 2: /* Valid, means one byte of info */ - /* Skip any number of spaces. */ - for (; ch != '\0'; ch = *src++) - if (!isspace((int) ch)) - break; - /* Make sure there is another trailing = sign. */ - if (ch != Pad64) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - ch = *src++; /* Skip the = */ - /* Fall through to "single trailing =" case. */ - /* FALLTHROUGH */ - - case 3: /* Valid, means two bytes of info */ - /* - * We know this char is an =. Is there anything but - * whitespace after it? - */ - for (; ch != '\0'; ch = *src++) - if (!isspace(ch)) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - - /* - * Now make sure for cases 2 and 3 that the "extra" - * bits that slopped past the last full byte were - * zeros. If we don't check them, they become a - * subliminal channel. - */ - if (target && target[tarindex] != 0) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - } - } else { - /* - * We ended by seeing the end of the string. Make sure we - * have no partial bytes lying around. - */ - if (state != 0) - { - keynote_errno = ERROR_SYNTAX; - return (-1); - } - } - - return (tarindex); -} -#endif /* HAVE___B64_NTOP */ diff --git a/lib/libkeynote/environment.c b/lib/libkeynote/environment.c index 8cd0edb4aeb..ba4e0f39daf 100644 --- a/lib/libkeynote/environment.c +++ b/lib/libkeynote/environment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: environment.c,v 1.17 2003/04/02 23:01:10 millert Exp $ */ +/* $OpenBSD: environment.c,v 1.18 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,35 +19,16 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ #include + +#include +#include +#include #include #include -#include - -#if STDC_HEADERS #include -#if !defined(HAVE_MEMCPY) -#define memcpy(d, s, n) bcopy ((s), (d), (n)) -#endif /* !HAVE_MEMCPY */ -#endif /* STDC_HEADERS */ - -#if HAVE_MEMORY_H -#include -#endif /* HAVE_MEMORY_H */ - -#if HAVE_FCNTL_H -#include -#endif /* HAVE_FCNTL_H */ - -#if HAVE_IO_H -#include -#elif HAVE_UNISTD_H #include -#endif /* HAVE_IO_H */ #include "header.h" #include "keynote.h" @@ -122,13 +103,8 @@ keynote_get_action_authorizers(char *name) kl = kl->key_next) if (kl->key_stringkey != (char *) NULL) { -#if !defined(HAVE_SNPRINTF) - sprintf(keynote_current_session->ks_authorizers_cache + len, - "%s,", kl->key_stringkey); -#else /* !HAVE_SNPRINTF */ snprintf(keynote_current_session->ks_authorizers_cache + len, cachesize - len, "%s,", kl->key_stringkey); -#endif /* !HAVE_SNPRINTF */ len += strlen(kl->key_stringkey) + 1; } @@ -176,13 +152,8 @@ keynote_get_values(char *name) for (len = 0, i = 0; i < keynote_current_session->ks_values_num; i++) { -#if !defined(HAVE_SNPRINTF) - sprintf(keynote_current_session->ks_values_cache + len, - "%s,", keynote_current_session->ks_values[i]); -#else /* !HAVE_SNPRINTF */ snprintf(keynote_current_session->ks_values_cache + len, cachesize - len, "%s,", keynote_current_session->ks_values[i]); -#endif /* !HAVE_SNPRINTF */ len += strlen(keynote_current_session->ks_values[i]) + 1; } diff --git a/lib/libkeynote/header.h b/lib/libkeynote/header.h index 0d5fe183c56..dd7ca1ded8c 100644 --- a/lib/libkeynote/header.h +++ b/lib/libkeynote/header.h @@ -1,4 +1,4 @@ -/* $OpenBSD: header.h,v 1.8 2003/06/26 23:19:53 deraadt Exp $ */ +/* $OpenBSD: header.h,v 1.9 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -45,34 +45,10 @@ int sessid; #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 */ - /* Includes */ -#if HAVE_REGEX_H #include -#include -#endif /* HAVE_REGEX_H */ -#if defined(CRYPTO) -#if defined(HAVE_OPENSSL_CRYPTO_H) +#include #include #include #include @@ -82,29 +58,4 @@ int sessid; #include #include #include -#elif defined(HAVE_SSL_CRYPTO_H) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#elif defined(HAVE_CRYPTO_H) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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 156bee94ed6..b759d91a1bd 100644 --- a/lib/libkeynote/keynote-keygen.c +++ b/lib/libkeynote/keynote-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-keygen.c,v 1.19 2003/07/05 17:01:49 deraadt Exp $ */ +/* $OpenBSD: keynote-keygen.c,v 1.20 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,29 +19,15 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include #include -#include -#include -#include - -#if STDC_HEADERS -#include -#endif /* STDC_HEADERS */ -#if HAVE_FCNTL_H +#include #include -#endif /* HAVE_FCNTL_H */ - -#if HAVE_IO_H -#include -#elif HAVE_UNISTD_H +#include +#include +#include #include -#endif /* HAVE_IO_H */ #include "header.h" #include "keynote.h" @@ -106,7 +92,6 @@ void keynote_keygen(int argc, char *argv[]) { int begin = KEY_PRINT_OFFSET, prlen = KEY_PRINT_LENGTH; -#if defined(CRYPTO) || defined(PGPLIB) char *foo, *privalgname, seed[SEED_LEN]; int alg, enc, ienc, len = 0, counter; struct keynote_deckey dc; @@ -114,7 +99,6 @@ keynote_keygen(int argc, char *argv[]) DSA *dsa; RSA *rsa; FILE *fp; -#endif /* CRYPTO || PGPLIB */ char *algname; if ((argc != 5) && (argc != 6) && (argc != 7)) @@ -171,7 +155,6 @@ keynote_keygen(int argc, char *argv[]) exit(1); } -#if defined(CRYPTO) || defined(PGPLIB) alg = keynote_get_key_algorithm(algname, &enc, &ienc); len = atoi(argv[2]); @@ -188,10 +171,7 @@ keynote_keygen(int argc, char *argv[]) RAND_bytes(seed, SEED_LEN); dsa = DSA_generate_parameters(len, seed, SEED_LEN, &counter, &h, NULL -#if SSLEAY_VERSION_NUMBER >= 0x0900 - , NULL -#endif /* SSLEAY_VERSION_NUMBER */ - ); + , NULL); if (dsa == (DSA *) NULL) { @@ -278,11 +258,7 @@ keynote_keygen(int argc, char *argv[]) (ienc == INTERNAL_ENC_PKCS1) && ((enc == ENCODING_HEX) || (enc == ENCODING_BASE64))) { - rsa = RSA_generate_key(len, DEFAULT_PUBLIC, NULL -#if SSLEAY_VERSION_NUMBER >= 0x0900 - , NULL -#endif /* SSLEAY_VERSION_NUMBER */ - ); + rsa = RSA_generate_key(len, DEFAULT_PUBLIC, NULL, NULL); if (rsa == (RSA *) NULL) { @@ -360,7 +336,6 @@ keynote_keygen(int argc, char *argv[]) } /* More algorithms here */ -#endif /* CRYPTO */ fprintf(stderr, "Unknown/unsupported algorithm [%s]\n", algname); exit(1); diff --git a/lib/libkeynote/keynote-main.c b/lib/libkeynote/keynote-main.c index f3721e1c1ab..5480a3226f0 100644 --- a/lib/libkeynote/keynote-main.c +++ b/lib/libkeynote/keynote-main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-main.c,v 1.9 2003/07/05 17:01:49 deraadt Exp $ */ +/* $OpenBSD: keynote-main.c,v 1.10 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,28 +19,15 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include #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 -#else #include -#endif /* WIN32 */ #include "header.h" @@ -50,10 +37,10 @@ void mainusage(void) { fprintf(stderr, "Usage:\n"); + fprintf(stderr, "\tkeygen ...\n"); fprintf(stderr, "\tsign ...\n"); fprintf(stderr, "\tsigver ...\n"); fprintf(stderr, "\tverify ...\n"); - fprintf(stderr, "\tkeygen ...\n"); fprintf(stderr, "Issue one of the commands by itself to get more help, " "e.g., keynote sign\n"); } diff --git a/lib/libkeynote/keynote-sign.c b/lib/libkeynote/keynote-sign.c index e8d7fcaae21..8173cc2d44c 100644 --- a/lib/libkeynote/keynote-sign.c +++ b/lib/libkeynote/keynote-sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-sign.c,v 1.14 2003/07/05 17:01:49 deraadt Exp $ */ +/* $OpenBSD: keynote-sign.c,v 1.15 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,29 +19,15 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include #include -#include -#include -#include -#if STDC_HEADERS +#include +#include +#include #include -#endif /* STDC_HEADERS */ - -#if HAVE_FCNTL_H #include -#endif /* HAVE_FCNTL_H */ - -#if HAVE_IO_H -#include -#elif HAVE_UNISTD_H #include -#endif /* HAVE_IO_H */ #include "header.h" #include "keynote.h" diff --git a/lib/libkeynote/keynote-sigver.c b/lib/libkeynote/keynote-sigver.c index 451f134ea2a..31a735bd282 100644 --- a/lib/libkeynote/keynote-sigver.c +++ b/lib/libkeynote/keynote-sigver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-sigver.c,v 1.13 2003/07/05 17:01:49 deraadt Exp $ */ +/* $OpenBSD: keynote-sigver.c,v 1.14 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,29 +19,15 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include #include -#include -#include -#include - -#if STDC_HEADERS -#include -#endif /* STDC_HEADERS */ -#if HAVE_FCNTL_H +#include #include -#endif /* HAVE_FCNTL_H */ - -#if HAVE_IO_H -#include -#elif HAVE_UNISTD_H +#include +#include +#include #include -#endif /* HAVE_IO_H */ #include "header.h" #include "keynote.h" diff --git a/lib/libkeynote/keynote-ver.l b/lib/libkeynote/keynote-ver.l index 5b1e749e5a3..75d67c3a363 100644 --- a/lib/libkeynote/keynote-ver.l +++ b/lib/libkeynote/keynote-ver.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: keynote-ver.l,v 1.12 2002/05/27 06:29:14 deraadt Exp $ */ +/* $OpenBSD: keynote-ver.l,v 1.13 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -20,31 +20,13 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - +#include #include -#include -#if STDC_HEADERS +#include #include -#endif /* STDC_HEADERS */ - -#if HAVE_UNISTD_H -#include -#endif /* HAVE_UNISTD_H */ - -#if TIME_WITH_SYS_TIME -#include #include -#else -#if HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif +#include #include "z.tab.h" #include "header.h" diff --git a/lib/libkeynote/keynote-ver.y b/lib/libkeynote/keynote-ver.y index 4f409078e5a..0c88679a3f4 100644 --- a/lib/libkeynote/keynote-ver.y +++ b/lib/libkeynote/keynote-ver.y @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-ver.y,v 1.8 2001/09/03 20:14:51 deraadt Exp $ */ +/* $OpenBSD: keynote-ver.y,v 1.9 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -28,17 +28,12 @@ %nonassoc EQ %start program %{ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ #include -#include -#include -#if STDC_HEADERS +#include +#include #include -#endif /* STDC_HEADERS */ #include "header.h" #include "keynote.h" diff --git a/lib/libkeynote/keynote-verify.c b/lib/libkeynote/keynote-verify.c index d7836201428..0d35f22f679 100644 --- a/lib/libkeynote/keynote-verify.c +++ b/lib/libkeynote/keynote-verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-verify.c,v 1.12 2003/07/05 17:01:49 deraadt Exp $ */ +/* $OpenBSD: keynote-verify.c,v 1.13 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,40 +19,17 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include #include -#include -#include -#include - -#if STDC_HEADERS -#include -#if !defined(HAVE_MEMCPY) -#define memcpy(d, s, n) bcopy ((s), (d), (n)) -#endif /* !HAVE_MEMCPY */ -#endif /* STDC_HEADERS */ - -#if HAVE_MEMORY_H -#include -#endif /* HAVE_MEMORY_H */ -#if HAVE_FCNTL_H +#include #include -#endif /* HAVE_FCNTL_H */ - -#if !defined(HAVE_GETOPT) #include -#endif /* HAVE_GETOPT */ - -#if HAVE_IO_H -#include -#elif HAVE_UNISTD_H +#include +#include +#include +#include #include -#endif /* HAVE_IO_H */ #include "header.h" #include "keynote.h" diff --git a/lib/libkeynote/keynote.l b/lib/libkeynote/keynote.l index ac52d1d72af..c2cefdba3b0 100644 --- a/lib/libkeynote/keynote.l +++ b/lib/libkeynote/keynote.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: keynote.l,v 1.15 2003/11/08 19:17:27 jmc Exp $ */ +/* $OpenBSD: keynote.l,v 1.16 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -20,31 +20,13 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - +#include #include -#include -#if STDC_HEADERS +#include #include -#endif /* STDC_HEADERS */ - -#if HAVE_UNISTD_H -#include -#endif /* HAVE_UNISTD_H */ - -#if TIME_WITH_SYS_TIME -#include #include -#else -#if HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif +#include #include "k.tab.h" #include "header.h" diff --git a/lib/libkeynote/keynote.y b/lib/libkeynote/keynote.y index 7a2820deef7..47a1372710c 100644 --- a/lib/libkeynote/keynote.y +++ b/lib/libkeynote/keynote.y @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote.y,v 1.13 2003/04/02 23:01:10 millert Exp $ */ +/* $OpenBSD: keynote.y,v 1.14 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -43,19 +43,13 @@ %nonassoc UNARYMINUS DEREF OPENNUM OPENFLT %start grammarswitch %{ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include -#include -#include + #include #include - -#if STDC_HEADERS +#include +#include #include -#endif /* STDC_HEADERS */ #include "header.h" #include "keynote.h" @@ -509,12 +503,8 @@ stringexp: str EQ str { memset(pmatch, 0, sizeof(pmatch)); memset(grp, 0, sizeof(grp)); -#if HAVE_REGCOMP if (regcomp(&preg, $3, REG_EXTENDED)) { -#else /* HAVE_REGCOMP */ -#error "This system does not have regcomp()." -#endif /* HAVE_REGCOMP */ free($1); free($3); keynote_exceptionflag = 1; @@ -529,12 +519,8 @@ stringexp: str EQ str { $$ = (i == 0 ? 1 : 0); if (i == 0) { -#if !defined(HAVE_SNPRINTF) - sprintf(grp, "%lu", (unsigned long)preg.re_nsub); -#else /* !HAVE_SNPRINTF */ snprintf(grp, sizeof grp, "%lu", (unsigned long)preg.re_nsub); -#endif /* !HAVE_SNPRINTF */ if (keynote_env_add("_0", grp, &keynote_temp_list, 1, 0) != RESULT_TRUE) { @@ -558,11 +544,7 @@ stringexp: str EQ str { strncpy(gr, $1 + pmatch[i].rm_so, pmatch[i].rm_eo - pmatch[i].rm_so); gr[pmatch[i].rm_eo - pmatch[i].rm_so] = '\0'; -#if !defined(HAVE_SNPRINTF) - sprintf(grp, "_%d", i); -#else /* !HAVE_SNPRINTF */ snprintf(grp, sizeof grp, "_%d", i); -#endif /* !HAVE_SNPRINTF */ if (keynote_env_add(grp, gr, &keynote_temp_list, 1, 0) == -1) { @@ -597,12 +579,7 @@ str: str DOTT str { if (keynote_exceptionflag || keynote_donteval) keynote_errno = ERROR_MEMORY; return -1; } - -#if !defined(HAVE_SNPRINTF) - sprintf($$, "%s%s", $1, $3); -#else /* !HAVE_SNPRINTF */ snprintf($$, len, "%s%s", $1, $3); -#endif /* !HAVE_SNPRINTF */ free($1); free($3); if (keynote_lex_add($$, LEXTYPE_CHAR) == -1) diff --git a/lib/libkeynote/parse_assertion.c b/lib/libkeynote/parse_assertion.c index 9576943b7cc..857ba74645c 100644 --- a/lib/libkeynote/parse_assertion.c +++ b/lib/libkeynote/parse_assertion.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse_assertion.c,v 1.11 2001/09/03 20:14:51 deraadt Exp $ */ +/* $OpenBSD: parse_assertion.c,v 1.12 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -19,22 +19,13 @@ * PURPOSE. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include -#include -#include -#include - -#if STDC_HEADERS -#include -#endif /* STDC_HEADERS */ -#if HAVE_LIMITS_H +#include #include -#endif /* HAVE_LIMITS_H */ +#include +#include +#include #include "header.h" #include "keynote.h" diff --git a/lib/libkeynote/sample-app.c b/lib/libkeynote/sample-app.c index e7f1a9c3182..3fcbcfb2c24 100644 --- a/lib/libkeynote/sample-app.c +++ b/lib/libkeynote/sample-app.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sample-app.c,v 1.5 2001/09/03 20:14:51 deraadt Exp $ */ +/* $OpenBSD: sample-app.c,v 1.6 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -18,16 +18,13 @@ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR * PURPOSE. */ + #include + #include #include #include "keynote.h" -/* These is only needed to pull in the SSL include files */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include "header.h" char policy_assertions[] = diff --git a/lib/libkeynote/signature.c b/lib/libkeynote/signature.c index 1ea58b5fe44..525874d20ed 100644 --- a/lib/libkeynote/signature.c +++ b/lib/libkeynote/signature.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signature.c,v 1.15 2003/03/14 15:49:36 ho Exp $ */ +/* $OpenBSD: signature.c,v 1.16 2004/06/25 05:06:49 msf Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -24,21 +24,12 @@ * 3 May 1999 */ -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - #include + +#include #include #include - -#if STDC_HEADERS #include -#endif /* STDC_HEADERS */ - -#if HAVE_LIMITS_H -#include -#endif /* HAVE_LIMITS_H */ #include "header.h" #include "keynote.h" @@ -139,7 +130,6 @@ keynote_free_key(void *key, int type) if (key == (void *) NULL) return; -#ifdef CRYPTO /* DSA keys */ if (type == KEYNOTE_ALGORITHM_DSA) { @@ -160,16 +150,6 @@ keynote_free_key(void *key, int type) RSA_free(key); /* RSA-specific */ return; } -#endif /* CRYPTO */ - -#ifdef PGPLIB - /* PGP keys */ - if (type == KEYNOTE_ALGORITHM_PGP) - { - /* Unsupported yet */ - return; - } -#endif /* PGPLIB */ /* BINARY keys */ if (type == KEYNOTE_ALGORITHM_BINARY) @@ -281,16 +261,6 @@ keynote_get_sig_algorithm(char *sig, int *hash, int *enc, int *internal) } #endif /* 0 */ -#ifdef PGPLIB - if (!strncasecmp(SIG_PGP_NATIVE, sig, SIG_PGP_NATIVE_LEN)) - { - *hash = KEYNOTE_HASH_NONE; - *enc = ENCODING_NATIVE; - *internal = INTERNAL_ENC_NATIVE; - return KEYNOTE_ALGORITHM_PGP; - } -#endif /* PGPLIB */ - *hash = KEYNOTE_HASH_NONE; *enc = ENCODING_NONE; *internal = INTERNAL_ENC_NONE; @@ -306,7 +276,6 @@ keynote_get_sig_algorithm(char *sig, int *hash, int *enc, int *internal) int keynote_get_key_algorithm(char *key, int *encoding, int *internalencoding) { -#ifdef CRYPTO if (!strncasecmp(DSA_HEX, key, DSA_HEX_LEN)) { *internalencoding = INTERNAL_ENC_ASN1; @@ -364,16 +333,6 @@ keynote_get_key_algorithm(char *key, int *encoding, int *internalencoding) return KEYNOTE_ALGORITHM_ELGAMAL; } #endif /* 0 */ -#endif /* CRYPTO */ - -#ifdef PGPLIB - if (!strncasecmp(PGP_NATIVE, key, PGP_NATIVE_LEN)) - { - *internalencoding = INTERNAL_ENC_NATIVE; - *encoding = ENCODING_NATIVE; - return KEYNOTE_ALGORITHM_PGP; - } -#endif /* PGPLIB */ if (!strncasecmp(BINARY_HEX, key, BINARY_HEX_LEN)) { @@ -420,11 +379,9 @@ keynote_get_private_key_algorithm(char *key, int *encoding, int kn_decode_key(struct keynote_deckey *dc, char *key, int keytype) { -#ifdef CRYPTO void *kk = (void *) NULL; X509 *px509Cert; EVP_PKEY *pPublicKey; -#endif /* CRYPTO */ unsigned char *ptr = (char *) NULL, *decoded = (char *) NULL; int encoding, internalencoding, len = 0; @@ -501,7 +458,6 @@ kn_decode_key(struct keynote_deckey *dc, char *key, int keytype) return -1; } -#ifdef CRYPTO /* DSA-HEX */ if ((dc->dec_algorithm == KEYNOTE_ALGORITHM_DSA) && (internalencoding == INTERNAL_ENC_ASN1)) @@ -630,7 +586,6 @@ kn_decode_key(struct keynote_deckey *dc, char *key, int keytype) free(ptr); return 0; } -#endif /* CRYPTO */ /* BINARY keys */ if ((dc->dec_algorithm == KEYNOTE_ALGORITHM_BINARY) && @@ -665,10 +620,8 @@ kn_decode_key(struct keynote_deckey *dc, char *key, int keytype) int kn_keycompare(void *key1, void *key2, int algorithm) { -#ifdef CRYPTO DSA *p1, *p2; RSA *p3, *p4; -#endif /* CRYPTO */ struct keynote_binary *bn1, *bn2; if ((key1 == (void *) NULL) || @@ -684,7 +637,6 @@ kn_keycompare(void *key1, void *key2, int algorithm) return RESULT_FALSE; case KEYNOTE_ALGORITHM_DSA: -#ifdef CRYPTO p1 = (DSA *) key1; p2 = (DSA *) key2; if (!BN_cmp(p1->p, p2->p) && @@ -694,12 +646,8 @@ kn_keycompare(void *key1, void *key2, int algorithm) return RESULT_TRUE; else return RESULT_FALSE; -#else /* CRYPTO */ - return RESULT_FALSE; -#endif /* CRYPTO */ case KEYNOTE_ALGORITHM_X509: -#ifdef CRYPTO p3 = (RSA *) key1; p4 = (RSA *) key2; if (!BN_cmp(p3->n, p4->n) && @@ -707,12 +655,8 @@ kn_keycompare(void *key1, void *key2, int algorithm) return RESULT_TRUE; else return RESULT_FALSE; -#else /* CRYPTO */ - return RESULT_FALSE; -#endif /* CRYPTO */ case KEYNOTE_ALGORITHM_RSA: -#ifdef CRYPTO p3 = (RSA *) key1; p4 = (RSA *) key2; if (!BN_cmp(p3->n, p4->n) && @@ -720,9 +664,6 @@ kn_keycompare(void *key1, void *key2, int algorithm) return RESULT_TRUE; else return RESULT_FALSE; -#else /* CRYPTO */ - return RESULT_FALSE; -#endif /* CRYPTO */ case KEYNOTE_ALGORITHM_ELGAMAL: /* Not supported yet */ @@ -753,17 +694,14 @@ kn_keycompare(void *key1, void *key2, int algorithm) int keynote_sigverify_assertion(struct assertion *as) { -#if defined(CRYPTO) || defined(PGPLIB) int hashtype, enc, intenc, alg = KEYNOTE_ALGORITHM_NONE, hashlen = 0; unsigned char *sig, *decoded = (char *) NULL, *ptr; -#ifdef CRYPTO unsigned char res2[20]; SHA_CTX shscontext; MD5_CTX md5context; int len = 0; DSA *dsa; RSA *rsa; -#endif /* CRYPTO */ if ((as->as_signature == (char *) NULL) || (as->as_startofsignature == (char *) NULL) || (as->as_allbutsignature == (char *) NULL) || @@ -792,7 +730,6 @@ keynote_sigverify_assertion(struct assertion *as) switch (hashtype) { case KEYNOTE_HASH_SHA1: -#ifdef CRYPTO hashlen = 20; memset(res2, 0, hashlen); SHA1_Init(&shscontext); @@ -801,11 +738,9 @@ keynote_sigverify_assertion(struct assertion *as) SHA1_Update(&shscontext, as->as_signature, (char *) sig - as->as_signature); SHA1_Final(res2, &shscontext); -#endif /* CRYPTO */ break; case KEYNOTE_HASH_MD5: -#ifdef CRYPTO hashlen = 16; memset(res2, 0, hashlen); MD5_Init(&md5context); @@ -814,7 +749,6 @@ keynote_sigverify_assertion(struct assertion *as) MD5_Update(&md5context, as->as_signature, (char *) sig - as->as_signature); MD5_Final(res2, &md5context); -#endif /* CRYPTO */ break; case KEYNOTE_HASH_NONE: @@ -914,7 +848,6 @@ keynote_sigverify_assertion(struct assertion *as) if (ptr != (unsigned char *) NULL) free(ptr); -#endif /* CRYPTO || PGPLIB */ return SIGRESULT_FALSE; } @@ -926,8 +859,6 @@ static char * keynote_sign_assertion(struct assertion *as, char *sigalg, void *key, int keyalg, int verifyflag) { -#if defined(CRYPTO) || defined(PGPLIB) -#ifdef CRYPTO int slen, i, hashlen = 0, hashtype, alg, encoding, internalenc; unsigned char *sig = (char *) NULL, *finalbuf = (char *) NULL; unsigned char res2[LARGEST_HASH_SIZE], *sbuf = (char *) NULL; @@ -936,7 +867,6 @@ keynote_sign_assertion(struct assertion *as, char *sigalg, void *key, RSA *rsa = (RSA *) NULL; SHA_CTX shscontext; MD5_CTX md5context; -#endif /* CRYPTO */ int len; if ((as->as_signature_string_s == (char *) NULL) || @@ -980,7 +910,6 @@ keynote_sign_assertion(struct assertion *as, char *sigalg, void *key, switch (hashtype) { case KEYNOTE_HASH_SHA1: -#ifdef CRYPTO hashlen = 20; memset(res2, 0, hashlen); SHA1_Init(&shscontext); @@ -988,11 +917,9 @@ keynote_sign_assertion(struct assertion *as, char *sigalg, void *key, as->as_allbutsignature - as->as_startofsignature); SHA1_Update(&shscontext, sigalg, (char *) sig - sigalg); SHA1_Final(res2, &shscontext); -#endif /* CRYPTO */ break; case KEYNOTE_HASH_MD5: -#ifdef CRYPTO hashlen = 16; memset(res2, 0, hashlen); MD5_Init(&md5context); @@ -1000,14 +927,12 @@ keynote_sign_assertion(struct assertion *as, char *sigalg, void *key, as->as_allbutsignature - as->as_startofsignature); MD5_Update(&md5context, sigalg, (char *) sig - sigalg); MD5_Final(res2, &md5context); -#endif /* CRYPTO */ break; case KEYNOTE_HASH_NONE: break; } -#ifdef CRYPTO if ((alg == KEYNOTE_ALGORITHM_DSA) && (hashtype == KEYNOTE_HASH_SHA1) && (internalenc == INTERNAL_ENC_ASN1) && @@ -1071,11 +996,7 @@ keynote_sign_assertion(struct assertion *as, char *sigalg, void *key, } /* RSA-specific */ -#if SSLEAY_VERSION_NUMBER >= 0x00904100L rsa = (RSA *) PEM_read_bio_RSAPrivateKey(biokey, NULL, NULL, NULL); -#else /* SSLEAY_VERSION_NUMBER */ - rsa = (RSA *) PEM_read_bio_RSAPrivateKey(biokey, NULL, NULL); -#endif /* SSLEAY_VERSION_NUMBER */ if (rsa == (RSA *) NULL) { BIO_free(biokey); @@ -1180,11 +1101,6 @@ keynote_sign_assertion(struct assertion *as, char *sigalg, void *key, /* Everything ok */ return (char *) finalbuf; -#endif /* CRYPTO */ -#else /* CRYPTO || PGPLIB */ - keynote_errno = ERROR_SYNTAX; - return (char *) NULL; -#endif /* CRYPTO || PGPLIB */ } /* @@ -1285,12 +1201,10 @@ char * kn_encode_key(struct keynote_deckey *dc, int iencoding, int encoding, int keytype) { -#ifdef CRYPTO char *foo, *ptr; DSA *dsa; RSA *rsa; int i; -#endif /* CRYPTO */ struct keynote_binary *bn; char *s; @@ -1302,7 +1216,6 @@ kn_encode_key(struct keynote_deckey *dc, int iencoding, return (char *) NULL; } -#ifdef CRYPTO /* DSA keys */ if ((dc->dec_algorithm == KEYNOTE_ALGORITHM_DSA) && (iencoding == INTERNAL_ENC_ASN1) && @@ -1429,7 +1342,6 @@ kn_encode_key(struct keynote_deckey *dc, int iencoding, return s; } } -#endif /* CRYPTO */ /* BINARY keys */ if ((dc->dec_algorithm == KEYNOTE_ALGORITHM_BINARY) && -- cgit v1.2.3