1 /* $OpenBSD: header.h,v 1.6 2000/09/26 23:28:46 angelos Exp $ */ 2 /* 3 * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) 4 * 5 * This code was written by Angelos D. Keromytis in Philadelphia, PA, USA, 6 * in April-May 1998 7 * 8 * Copyright (C) 1998, 1999 by Angelos D. Keromytis. 9 * 10 * Permission to use, copy, and modify this software without fee 11 * is hereby granted, provided that this entire notice is included in 12 * all copies of any software which is or includes a copy or 13 * modification of this software. 14 * 15 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTY. IN PARTICULAR, THE AUTHORS MAKES NO 17 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 18 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 19 * PURPOSE. 20 */ 21 22 #ifndef _HEADER_H_ 23 #define _HEADER_H_ 24 25 /* Functions */ 26 extern void keynote_sign(int, char **), keynote_sigver(int, char **); 27 extern void keynote_verify(int, char **), keynote_keygen(int, char **); 28 extern void print_key(FILE *, char *, char *, int, int); 29 extern void print_space(FILE *, int); 30 extern int read_environment(char *); 31 extern void parse_key(char *); 32 extern int kvparse(), kvlex(); 33 extern void kverror(char *); 34 35 /* Variables */ 36 int sessid; 37 38 /* Defines */ 39 #define SEED_LEN 40 40 #define DEFAULT_PUBLIC 0x10001 41 42 #define KEY_PRINT_OFFSET 12 43 #define KEY_PRINT_LENGTH 50 44 45 #define SIG_PRINT_OFFSET 12 46 #define SIG_PRINT_LENGTH 50 47 48 #if !defined(HAVE_STRCASECMP) && defined(HAVE_STRICMP) 49 #define strcasecmp stricmp 50 #endif /* !HAVE_STRCASECMP && HAVE_STRICMP */ 51 52 #if !defined(HAVE_STRNCASECMP) && defined(HAVE_STRNICMP) 53 #define strncasecmp strnicmp 54 #endif /* !HAVE_STRNCASECMP && HAVE_STRNICMP */ 55 56 #if !defined(HAVE_OPEN) && defined(HAVE__OPEN) 57 #define open _open 58 #endif /* !HAVE_OPEN && HAVE__OPEN */ 59 60 #if !defined(HAVE_READ) && defined(HAVE__READ) 61 #define read _read 62 #endif /* !HAVE_READ && HAVE__OPEN */ 63 64 #if !defined(HAVE_CLOSE) && defined(HAVE__CLOSE) 65 #define close _close 66 #endif /* !HAVE_CLOSE && HAVE__CLOSE */ 67 68 /* Includes */ 69 #if HAVE_REGEX_H 70 #include <sys/types.h> 71 #include <regex.h> 72 #endif /* HAVE_REGEX_H */ 73 74 #if defined(CRYPTO) 75 #if defined(HAVE_OPENSSL_CRYPTO_H) 76 #include <openssl/crypto.h> 77 #include <openssl/dsa.h> 78 #include <openssl/rsa.h> 79 #include <openssl/sha.h> 80 #include <openssl/md5.h> 81 #include <openssl/err.h> 82 #include <openssl/rand.h> 83 #include <openssl/x509.h> 84 #include <openssl/pem.h> 85 #elif defined(HAVE_SSL_CRYPTO_H) 86 #include <ssl/crypto.h> 87 #include <ssl/dsa.h> 88 #include <ssl/rsa.h> 89 #include <ssl/sha.h> 90 #include <ssl/md5.h> 91 #include <ssl/err.h> 92 #include <ssl/rand.h> 93 #include <ssl/x509.h> 94 #include <ssl/pem.h> 95 #elif defined(HAVE_CRYPTO_H) 96 #include <crypto.h> 97 #include <dsa.h> 98 #include <rsa.h> 99 #include <sha.h> 100 #include <md5.h> 101 #include <err.h> 102 #include <rand.h> 103 #include <x509.h> 104 #include <pem.h> 105 #else /* HAVE_OPENSSL_CRYPTO_H */ 106 #error "SSLeay or OpenSSL not detected!" 107 #endif /* HAVE_OPENSSL_CRYPTO_H */ 108 #endif /* CRYPTO */ 109 110 #endif /* _HEADER_H_ */ 111