summaryrefslogtreecommitdiffstats
path: root/crypto/pem/pem.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-06-09 10:41:35 +0000
committerRichard Levitte <levitte@openssl.org>2000-06-09 10:41:35 +0000
commitef33b97050f8157234abe6d5f2da3da1cdda6d68 (patch)
treea2bb6602fdec189c9acae86bba54d7c1aaac4148 /crypto/pem/pem.h
parent814ed26cfa66945a537f2764f543340845e561a5 (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/pem/pem.h')
-rw-r--r--crypto/pem/pem.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h
index 38b98015c4..46aafa6815 100644
--- a/crypto/pem/pem.h
+++ b/crypto/pem/pem.h
@@ -59,6 +59,12 @@
#ifndef HEADER_PEM_H
#define HEADER_PEM_H
+#ifndef NO_BIO
+#include <openssl/bio.h>
+#endif
+#ifndef NO_STACK
+#include <openssl/stack.h>
+#endif
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem2.h>
@@ -165,7 +171,7 @@ typedef struct pem_ctx_st
int num_recipient;
PEM_USER **recipient;
-#ifdef HEADER_STACK_H
+#ifndef NO_STACK
STACK *x509_chain; /* certificate chain */
#else
char *x509_chain; /* certificate chain */
@@ -289,7 +295,7 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
#endif
-#ifdef HEADER_BIO_H
+#ifndef NO_BIO
#define DECLARE_PEM_read_bio(name, type) \
type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
@@ -477,7 +483,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len,
pem_password_cb *callback,void *u);
-#ifdef HEADER_BIO_H
+#ifndef NO_BIO
int PEM_read_bio(BIO *bp, char **name, char **header,
unsigned char **data,long *len);
int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data,