-/* $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.
void *libcrypto = 0;
+#ifdef USE_X509
+
#ifdef HAVE_DLOPEN
/*
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 *);
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),
};
#endif
+#endif /* USE_X509 */
+
void
libcrypto_init (void)
{
+#ifdef USE_X509
#ifdef HAVE_DLOPEN
dyn_load (libcrypto_script);
#elif !defined (USE_LIBCRYPTO)
#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 */
}
+
-/* $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.
#ifndef _LIBCRYPTO_H_
#define _LIBCRYPTO_H_
+#ifdef USE_X509
+
#include <stdio.h>
#ifdef KAME
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 *);
#endif
+#endif
+
extern void libcrypto_init (void);
#endif /* _LIBCRYPTO_H_ */