From: niklas Date: Fri, 7 Apr 2000 22:06:20 +0000 (+0000) Subject: libcrypto.c: Merge with EOM 1.13 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c52fb3f3a01f1d650b655b4223006f170038f71a;p=openbsd libcrypto.c: Merge with EOM 1.13 libcrypto.h: Merge with EOM 1.14 author: ho Name change for 0.9.5; {SSLeay,OpenSSL}_add_all_algorithms. author: ho Missing #ifdef USE_X509 added --- diff --git a/sbin/isakmpd/libcrypto.c b/sbin/isakmpd/libcrypto.c index 1d89d893388..f543f2d83c7 100644 --- a/sbin/isakmpd/libcrypto.c +++ b/sbin/isakmpd/libcrypto.c @@ -1,5 +1,5 @@ -/* $OpenBSD: libcrypto.c,v 1.5 2000/02/07 01:32:54 niklas Exp $ */ -/* $EOM: libcrypto.c,v 1.11 2000/02/07 01:30:36 angelos Exp $ */ +/* $OpenBSD: libcrypto.c,v 1.6 2000/04/07 22:06:20 niklas Exp $ */ +/* $EOM: libcrypto.c,v 1.13 2000/03/31 15:29:03 ho Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -42,6 +42,8 @@ void *libcrypto = 0; +#ifdef USE_X509 + #ifdef HAVE_DLOPEN /* @@ -68,7 +70,11 @@ int (*lc_RSA_private_encrypt) (int, unsigned char *, unsigned char *, RSA *, int (*lc_RSA_public_decrypt) (int, unsigned char *, unsigned char *, RSA *, int); int (*lc_RSA_size) (RSA *); +#if OPENSSL_VERSION_NUMBER >= 0x00905100L +void (*lc_OpenSSL_add_all_algorithms) (void); +#else void (*lc_SSLeay_add_all_algorithms) (void); +#endif int (*lc_X509_NAME_cmp) (X509_NAME *, X509_NAME *); void (*lc_X509_STORE_CTX_cleanup) (X509_STORE_CTX *); void (*lc_X509_OBJECT_free_contents) (X509_OBJECT *); @@ -138,7 +144,11 @@ static struct dynload_script libcrypto_script[] = { SYMENTRY (RSA_private_encrypt), SYMENTRY (RSA_public_decrypt), SYMENTRY (RSA_size), +#if OPENSSL_VERSION_NUMBER >= 0x00905100L + SYMENTRY (OpenSSL_add_all_algorithms), +#else SYMENTRY (SSLeay_add_all_algorithms), +#endif SYMENTRY (X509_NAME_cmp), SYMENTRY (X509_STORE_CTX_cleanup), SYMENTRY (X509_STORE_CTX_init), @@ -176,9 +186,12 @@ static struct dynload_script libcrypto_script[] = { }; #endif +#endif /* USE_X509 */ + void libcrypto_init (void) { +#ifdef USE_X509 #ifdef HAVE_DLOPEN dyn_load (libcrypto_script); #elif !defined (USE_LIBCRYPTO) @@ -193,6 +206,12 @@ libcrypto_init (void) #if defined (USE_LIBCRYPTO) /* Add all algorithms known by SSL */ +#if OPENSSL_VERSION_NUMBER >= 0x00905100L + LC (OpenSSL_add_all_algorithms, ()); +#else LC (SSLeay_add_all_algorithms, ()); #endif +#endif +#endif /* USE_X509 */ } + diff --git a/sbin/isakmpd/libcrypto.h b/sbin/isakmpd/libcrypto.h index df693f4e32f..2e1ca1e7866 100644 --- a/sbin/isakmpd/libcrypto.h +++ b/sbin/isakmpd/libcrypto.h @@ -1,5 +1,5 @@ -/* $OpenBSD: libcrypto.h,v 1.6 2000/03/08 08:42:48 niklas Exp $ */ -/* $EOM: libcrypto.h,v 1.12 2000/03/07 23:37:54 ho Exp $ */ +/* $OpenBSD: libcrypto.h,v 1.7 2000/04/07 22:06:20 niklas Exp $ */ +/* $EOM: libcrypto.h,v 1.14 2000/03/31 15:29:03 ho Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -38,6 +38,8 @@ #ifndef _LIBCRYPTO_H_ #define _LIBCRYPTO_H_ +#ifdef USE_X509 + #include #ifdef KAME @@ -95,7 +97,11 @@ extern int (*lc_RSA_private_encrypt) (int, unsigned char *, unsigned char *, extern int (*lc_RSA_public_decrypt) (int, unsigned char *, unsigned char *, RSA *, int); extern int (*lc_RSA_size) (RSA *); +#if OPENSSL_VERSION_NUMBER >= 0x00905100L +extern void (*lc_OpenSSL_add_all_algorithms) (void); +#else extern void (*lc_SSLeay_add_all_algorithms) (void); +#endif extern int (*lc_X509_NAME_cmp) (X509_NAME *, X509_NAME *); extern void (*lc_X509_OBJECT_free_contents) (X509_OBJECT *); extern void (*lc_X509_STORE_CTX_cleanup) (X509_STORE_CTX *); @@ -177,6 +183,8 @@ extern STACK *(*lc_sk_new) (int (*) ()); #endif +#endif + extern void libcrypto_init (void); #endif /* _LIBCRYPTO_H_ */