diff options
author | Richard Levitte <levitte@openssl.org> | 2000-06-09 10:41:35 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-06-09 10:41:35 +0000 |
commit | ef33b97050f8157234abe6d5f2da3da1cdda6d68 (patch) | |
tree | a2bb6602fdec189c9acae86bba54d7c1aaac4148 /crypto/x509 | |
parent | 814ed26cfa66945a537f2764f543340845e561a5 (diff) |
Using checks of the existence of HEADER_{foo}_H in other header files
was a really bad idea. For example, the following:
#include <x509.h>
#include <bio.h>
#include <asn1.h>
would make sure that things like ASN1_UTCTIME_print() wasn't defined
unless you moved the inclusion of bio.h to above the inclusion of
x509.h. The reason is that x509.h includes asn1.h, and the
declaration of ASN1_UTCTIME_print() depended on the definition of
HEADER_BIO_H. That's what I call an obscure bug.
Instead, this change makes sure that whatever header files are needed
for the correct process of one header file are included automagically,
and that the definitions of, for example, BIO-related things are
dependent on the absence of the NO_{foo} macros. This is also
consistent with the way parts of OpenSSL can be excluded at will.
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x509.h | 21 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.h | 7 |
2 files changed, 20 insertions, 8 deletions
diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 1dae31a233..87f192fa80 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -64,6 +64,15 @@ #define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic #endif +#ifndef NO_BUFFER +#include <openssl/buffer.h> +#endif +#ifndef NO_EVP +#include <openssl/evp.h> +#endif +#ifndef NO_BIO +#include <openssl/bio.h> +#endif #include <openssl/stack.h> #include <openssl/asn1.h> #include <openssl/safestack.h> @@ -242,7 +251,7 @@ typedef struct X509_name_st { STACK_OF(X509_NAME_ENTRY) *entries; int modified; /* true if 'bytes' needs to be built */ -#ifdef HEADER_BUFFER_H +#ifndef NO_BUFFER BUF_MEM *bytes; #else char *bytes; @@ -663,7 +672,7 @@ typedef struct private_key_st int references; } X509_PKEY; -#ifdef HEADER_ENVELOPE_H +#ifndef NO_EVP typedef struct X509_info_st { X509 *x509; @@ -950,7 +959,7 @@ extern "C" { const char *X509_verify_cert_error_string(long n); #ifndef SSLEAY_MACROS -#ifdef HEADER_ENVELOPE_H +#ifndef NO_EVP int X509_verify(X509 *a, EVP_PKEY *r); int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); @@ -1010,7 +1019,7 @@ int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); #endif -#ifdef HEADER_BIO_H +#ifndef NO_BIO X509 *d2i_X509_bio(BIO *bp,X509 **x509); int i2d_X509_bio(BIO *bp,X509 *x509); X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); @@ -1216,7 +1225,7 @@ NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void); NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, unsigned char **pp, long length); void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a); -#ifdef HEADER_ENVELOPE_H +#ifndef NO_EVP X509_INFO * X509_INFO_new(void); void X509_INFO_free(X509_INFO *a); char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); @@ -1296,7 +1305,7 @@ int X509_CRL_print_fp(FILE *bp,X509_CRL *x); int X509_REQ_print_fp(FILE *bp,X509_REQ *req); #endif -#ifdef HEADER_BIO_H +#ifndef NO_BIO int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); int X509_print(BIO *bp,X509 *x); int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); diff --git a/crypto/x509/x509_vfy.h b/crypto/x509/x509_vfy.h index 313b867802..f842e4ac72 100644 --- a/crypto/x509/x509_vfy.h +++ b/crypto/x509/x509_vfy.h @@ -65,6 +65,9 @@ #ifndef HEADER_X509_VFY_H #define HEADER_X509_VFY_H +#ifndef NO_LHASH +#include <openssl/lhash.h> +#endif #include <openssl/bio.h> #include <openssl/crypto.h> @@ -190,7 +193,7 @@ typedef struct x509_store_st { /* The following is a cache of trusted certs */ int cache; /* if true, stash any hits */ -#ifdef HEADER_LHASH_H +#ifndef NO_LHASH LHASH *certs; /* cached certs; */ #else char *certs; @@ -315,7 +318,7 @@ struct x509_store_state_st /* X509_STORE_CTX */ #define X509v3_add_standard_extensions oX509v3_add_standard_extensions #endif -#ifdef HEADER_LHASH_H +#ifndef NO_LHASH X509_OBJECT *X509_OBJECT_retrieve_by_subject(LHASH *h,int type,X509_NAME *name); #endif void X509_OBJECT_up_ref_count(X509_OBJECT *a); |