diff options
author | Rich Salz <rsalz@openssl.org> | 2015-01-27 10:06:22 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-01-27 10:06:22 -0500 |
commit | a00ae6c46e0d7907a7c9f9e85334e968aa5fd338 (patch) | |
tree | 79a0e748842c1a3ed15b3b4a1ab08ce29bab5280 /crypto | |
parent | 109f1031a8d03a7c0a7c53c82314505ec5b7b207 (diff) | |
download | openssl-a00ae6c46e0d7907a7c9f9e85334e968aa5fd338.tar.gz |
OPENSSL_NO_xxx cleanup: many removals
The following compile options (#ifdef's) are removed:
OPENSSL_NO_BIO OPENSSL_NO_BUFFER OPENSSL_NO_CHAIN_VERIFY
OPENSSL_NO_EVP OPENSSL_NO_FIPS_ERR OPENSSL_NO_HASH_COMP
OPENSSL_NO_LHASH OPENSSL_NO_OBJECT OPENSSL_NO_SPEED OPENSSL_NO_STACK
OPENSSL_NO_X509 OPENSSL_NO_X509_VERIFY
This diff is big because of updating the indents on preprocessor lines.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1/asn1.h | 10 | ||||
-rw-r--r-- | crypto/bn/bn_print.c | 2 | ||||
-rw-r--r-- | crypto/dh/dh.h | 8 | ||||
-rw-r--r-- | crypto/dsa/dsa.h | 6 | ||||
-rw-r--r-- | crypto/ec/ec.h | 4 | ||||
-rw-r--r-- | crypto/err/err.c | 2 | ||||
-rw-r--r-- | crypto/err/err.h | 12 | ||||
-rw-r--r-- | crypto/err/err_all.c | 2 | ||||
-rw-r--r-- | crypto/evp/evp.h | 13 | ||||
-rw-r--r-- | crypto/lhash/lh_stats.c | 79 | ||||
-rw-r--r-- | crypto/lhash/lhash.c | 9 | ||||
-rw-r--r-- | crypto/lhash/lhash.h | 14 | ||||
-rw-r--r-- | crypto/objects/obj_dat.c | 15 | ||||
-rw-r--r-- | crypto/pem/pem.h | 24 | ||||
-rw-r--r-- | crypto/rsa/rsa.h | 6 | ||||
-rw-r--r-- | crypto/ts/ts.h | 12 | ||||
-rw-r--r-- | crypto/ts/ts_asn1.c | 8 | ||||
-rw-r--r-- | crypto/txt_db/txt_db.h | 9 | ||||
-rw-r--r-- | crypto/x509/x509.h | 26 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.c | 4 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.h | 4 |
21 files changed, 20 insertions, 249 deletions
diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h index a8f9c0c92a..e3fea150b3 100644 --- a/crypto/asn1/asn1.h +++ b/crypto/asn1/asn1.h @@ -61,9 +61,7 @@ # include <time.h> # include <openssl/e_os2.h> -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/bio.h> # include <openssl/stack.h> # include <openssl/safestack.h> @@ -827,10 +825,8 @@ int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags, int flags_len); -# ifndef OPENSSL_NO_BIO int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, BIT_STRING_BITNAME *tbl, int indent); -# endif int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, BIT_STRING_BITNAME *tbl); @@ -915,7 +911,6 @@ STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, void (*free_func) (OPENSSL_BLOCK), int ex_tag, int ex_class); -# ifndef OPENSSL_NO_BIO int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); @@ -923,7 +918,6 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a); int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); -# endif int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a); int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); @@ -1015,7 +1009,6 @@ int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); -# ifndef OPENSSL_NO_BIO void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x); # define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ @@ -1048,7 +1041,6 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump); -# endif const char *ASN1_tag2str(int tag); /* Used to load and write netscape format cert */ diff --git a/crypto/bn/bn_print.c b/crypto/bn/bn_print.c index 0f356c24be..1000e69a86 100644 --- a/crypto/bn/bn_print.c +++ b/crypto/bn/bn_print.c @@ -322,7 +322,6 @@ int BN_asc2bn(BIGNUM **bn, const char *a) return 1; } -#ifndef OPENSSL_NO_BIO # ifndef OPENSSL_NO_STDIO int BN_print_fp(FILE *fp, const BIGNUM *a) { @@ -362,7 +361,6 @@ int BN_print(BIO *bp, const BIGNUM *a) end: return (ret); } -#endif char *BN_options(void) { diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h index ececd4d176..2d7c739eca 100644 --- a/crypto/dh/dh.h +++ b/crypto/dh/dh.h @@ -65,9 +65,7 @@ # error DH is disabled. # endif -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/bio.h> # include <openssl/ossl_typ.h> # ifdef OPENSSL_USE_DEPRECATED # include <openssl/bn.h> @@ -233,11 +231,7 @@ int i2d_DHxparams(const DH *a, unsigned char **pp); # ifndef OPENSSL_NO_STDIO int DHparams_print_fp(FILE *fp, const DH *x); # endif -# ifndef OPENSSL_NO_BIO int DHparams_print(BIO *bp, const DH *x); -# else -int DHparams_print(char *bp, const DH *x); -# endif /* RFC 5114 parameters */ DH *DH_get_1024_160(void); diff --git a/crypto/dsa/dsa.h b/crypto/dsa/dsa.h index 2bb6b1100d..949360faab 100644 --- a/crypto/dsa/dsa.h +++ b/crypto/dsa/dsa.h @@ -71,9 +71,7 @@ # error DSA is disabled. # endif -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/bio.h> # include <openssl/crypto.h> # include <openssl/ossl_typ.h> @@ -248,10 +246,8 @@ int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); int i2d_DSAparams(const DSA *a, unsigned char **pp); -# ifndef OPENSSL_NO_BIO int DSAparams_print(BIO *bp, const DSA *x); int DSA_print(BIO *bp, const DSA *x, int off); -# endif # ifndef OPENSSL_NO_STDIO int DSAparams_print_fp(FILE *fp, const DSA *x); int DSA_print_fp(FILE *bp, const DSA *x, int off); diff --git a/crypto/ec/ec.h b/crypto/ec/ec.h index a3d50e73d7..b89add60e0 100644 --- a/crypto/ec/ec.h +++ b/crypto/ec/ec.h @@ -729,9 +729,7 @@ int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); # define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \ (unsigned char *)(x)) -# ifndef OPENSSL_NO_BIO int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off); -# endif # ifndef OPENSSL_NO_STDIO int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off); # endif @@ -951,7 +949,6 @@ EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len); */ int i2o_ECPublicKey(EC_KEY *key, unsigned char **out); -# ifndef OPENSSL_NO_BIO /** Prints out the ec parameters on human readable form. * \param bp BIO object to which the information is printed * \param key EC_KEY object @@ -967,7 +964,6 @@ int ECParameters_print(BIO *bp, const EC_KEY *key); */ int EC_KEY_print(BIO *bp, const EC_KEY *key, int off); -# endif # ifndef OPENSSL_NO_STDIO /** Prints out the ec parameters on human readable form. * \param fp file descriptor to which the information is printed diff --git a/crypto/err/err.c b/crypto/err/err.c index ed50511fcf..50865b8b26 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -109,8 +109,6 @@ * */ -#define OPENSSL_NO_FIPS_ERR - #include <stdio.h> #include <stdarg.h> #include <string.h> diff --git a/crypto/err/err.h b/crypto/err/err.h index d24ec9a7a6..577a121475 100644 --- a/crypto/err/err.h +++ b/crypto/err/err.h @@ -120,12 +120,8 @@ # endif # include <openssl/ossl_typ.h> -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif -# ifndef OPENSSL_NO_LHASH -# include <openssl/lhash.h> -# endif +# include <openssl/bio.h> +# include <openssl/lhash.h> #ifdef __cplusplus extern "C" { @@ -341,9 +337,7 @@ void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u), # ifndef OPENSSL_NO_STDIO void ERR_print_errors_fp(FILE *fp); # endif -# ifndef OPENSSL_NO_BIO void ERR_print_errors(BIO *bp); -# endif void ERR_add_error_data(int num, ...); void ERR_add_error_vdata(int num, va_list args); void ERR_load_strings(int lib, ERR_STRING_DATA str[]); @@ -359,11 +353,9 @@ DECLARE_DEPRECATED(void ERR_remove_state(unsigned long pid)); /* if zero we # endif ERR_STATE *ERR_get_state(void); -# ifndef OPENSSL_NO_LHASH LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void); LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void); void ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash); -# endif int ERR_get_next_error_library(void); diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c index 54693ed3f4..1363fb026a 100644 --- a/crypto/err/err_all.c +++ b/crypto/err/err_all.c @@ -56,8 +56,6 @@ * [including the GNU Public Licence.] */ -#define OPENSSL_NO_FIPS_ERR - #include <stdio.h> #include <openssl/asn1.h> #include <openssl/bn.h> diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 0882324135..7a95de0b1d 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -71,17 +71,8 @@ # include <openssl/symhacks.h> -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/bio.h> -/*- -#define EVP_RC2_KEY_SIZE 16 -#define EVP_RC4_KEY_SIZE 16 -#define EVP_BLOWFISH_KEY_SIZE 16 -#define EVP_CAST5_KEY_SIZE 16 -#define EVP_RC5_32_12_16_KEY_SIZE 16 -*/ # define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */ # define EVP_MAX_KEY_LENGTH 64 # define EVP_MAX_IV_LENGTH 16 @@ -751,14 +742,12 @@ int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); -# ifndef OPENSSL_NO_BIO BIO_METHOD *BIO_f_md(void); BIO_METHOD *BIO_f_base64(void); BIO_METHOD *BIO_f_cipher(void); BIO_METHOD *BIO_f_reliable(void); __owur int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, const unsigned char *i, int enc); -# endif const EVP_MD *EVP_md_null(void); # ifndef OPENSSL_NO_MD2 diff --git a/crypto/lhash/lh_stats.c b/crypto/lhash/lh_stats.c index 8b09966097..0a213991d8 100644 --- a/crypto/lhash/lh_stats.c +++ b/crypto/lhash/lh_stats.c @@ -65,78 +65,9 @@ */ #include "cryptlib.h" -#ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -#endif +#include <openssl/bio.h> #include <openssl/lhash.h> -#ifdef OPENSSL_NO_BIO - -void lh_stats(LHASH *lh, FILE *out) -{ - fprintf(out, "num_items = %lu\n", lh->num_items); - fprintf(out, "num_nodes = %u\n", lh->num_nodes); - fprintf(out, "num_alloc_nodes = %u\n", lh->num_alloc_nodes); - fprintf(out, "num_expands = %lu\n", lh->num_expands); - fprintf(out, "num_expand_reallocs = %lu\n", lh->num_expand_reallocs); - fprintf(out, "num_contracts = %lu\n", lh->num_contracts); - fprintf(out, "num_contract_reallocs = %lu\n", lh->num_contract_reallocs); - fprintf(out, "num_hash_calls = %lu\n", lh->num_hash_calls); - fprintf(out, "num_comp_calls = %lu\n", lh->num_comp_calls); - fprintf(out, "num_insert = %lu\n", lh->num_insert); - fprintf(out, "num_replace = %lu\n", lh->num_replace); - fprintf(out, "num_delete = %lu\n", lh->num_delete); - fprintf(out, "num_no_delete = %lu\n", lh->num_no_delete); - fprintf(out, "num_retrieve = %lu\n", lh->num_retrieve); - fprintf(out, "num_retrieve_miss = %lu\n", lh->num_retrieve_miss); - fprintf(out, "num_hash_comps = %lu\n", lh->num_hash_comps); -# if 0 - fprintf(out, "p = %u\n", lh->p); - fprintf(out, "pmax = %u\n", lh->pmax); - fprintf(out, "up_load = %lu\n", lh->up_load); - fprintf(out, "down_load = %lu\n", lh->down_load); -# endif -} - -void lh_node_stats(LHASH *lh, FILE *out) -{ - LHASH_NODE *n; - unsigned int i, num; - - for (i = 0; i < lh->num_nodes; i++) { - for (n = lh->b[i], num = 0; n != NULL; n = n->next) - num++; - fprintf(out, "node %6u -> %3u\n", i, num); - } -} - -void lh_node_usage_stats(LHASH *lh, FILE *out) -{ - LHASH_NODE *n; - unsigned long num; - unsigned int i; - unsigned long total = 0, n_used = 0; - - for (i = 0; i < lh->num_nodes; i++) { - for (n = lh->b[i], num = 0; n != NULL; n = n->next) - num++; - if (num != 0) { - n_used++; - total += num; - } - } - fprintf(out, "%lu nodes used out of %u\n", n_used, lh->num_nodes); - fprintf(out, "%lu items\n", total); - if (n_used == 0) - return; - fprintf(out, "load %d.%02d actual load %d.%02d\n", - (int)(total / lh->num_nodes), - (int)((total % lh->num_nodes) * 100 / lh->num_nodes), - (int)(total / n_used), (int)((total % n_used) * 100 / n_used)); -} - -#else - # ifndef OPENSSL_NO_STDIO void lh_stats(const _LHASH *lh, FILE *fp) { @@ -198,12 +129,6 @@ void lh_stats_bio(const _LHASH *lh, BIO *out) BIO_printf(out, "num_retrieve = %lu\n", lh->num_retrieve); BIO_printf(out, "num_retrieve_miss = %lu\n", lh->num_retrieve_miss); BIO_printf(out, "num_hash_comps = %lu\n", lh->num_hash_comps); -# if 0 - BIO_printf(out, "p = %u\n", lh->p); - BIO_printf(out, "pmax = %u\n", lh->pmax); - BIO_printf(out, "up_load = %lu\n", lh->up_load); - BIO_printf(out, "down_load = %lu\n", lh->down_load); -# endif } void lh_node_stats_bio(const _LHASH *lh, BIO *out) @@ -242,5 +167,3 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out) (int)((total % lh->num_nodes) * 100 / lh->num_nodes), (int)(total / n_used), (int)((total % n_used) * 100 / n_used)); } - -#endif diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c index 53c5c138bb..5e9bfb8b1c 100644 --- a/crypto/lhash/lhash.c +++ b/crypto/lhash/lhash.c @@ -194,9 +194,7 @@ void *lh_insert(_LHASH *lh, void *data) } nn->data = data; nn->next = NULL; -#ifndef OPENSSL_NO_HASH_COMP nn->hash = hash; -#endif *rn = nn; ret = NULL; lh->num_insert++; @@ -315,12 +313,7 @@ static void expand(_LHASH *lh) nni = lh->num_alloc_nodes; for (np = *n1; np != NULL;) { -#ifndef OPENSSL_NO_HASH_COMP hash = np->hash; -#else - hash = lh->hash(np->data); - lh->num_hash_calls++; -#endif if ((hash % nni) != p) { /* move it */ *n1 = (*n1)->next; np->next = *n2; @@ -404,13 +397,11 @@ static LHASH_NODE **getrn(_LHASH *lh, const void *data, unsigned long *rhash) cf = lh->comp; ret = &(lh->b[(int)nn]); for (n1 = *ret; n1 != NULL; n1 = n1->next) { -#ifndef OPENSSL_NO_HASH_COMP lh->num_hash_comps++; if (n1->hash != hash) { ret = &(n1->next); continue; } -#endif lh->num_comp_calls++; if (cf(n1->data, data) == 0) break; diff --git a/crypto/lhash/lhash.h b/crypto/lhash/lhash.h index 8ddac6ba28..92ec80af4b 100644 --- a/crypto/lhash/lhash.h +++ b/crypto/lhash/lhash.h @@ -68,9 +68,7 @@ # include <stdio.h> # endif -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/bio.h> #ifdef __cplusplus extern "C" { @@ -79,9 +77,7 @@ extern "C" { typedef struct lhash_node_st { void *data; struct lhash_node_st *next; -# ifndef OPENSSL_NO_HASH_COMP unsigned long hash; -# endif } LHASH_NODE; typedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *); @@ -182,17 +178,9 @@ void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); unsigned long lh_strhash(const char *c); unsigned long lh_num_items(const _LHASH *lh); -# ifndef OPENSSL_NO_STDIO -void lh_stats(const _LHASH *lh, FILE *out); -void lh_node_stats(const _LHASH *lh, FILE *out); -void lh_node_usage_stats(const _LHASH *lh, FILE *out); -# endif - -# ifndef OPENSSL_NO_BIO void lh_stats_bio(const _LHASH *lh, BIO *out); void lh_node_stats_bio(const _LHASH *lh, BIO *out); void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); -# endif /* Type checking... */ diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 0b06ea4a01..e7366af8dc 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -66,20 +66,7 @@ #include <openssl/bn.h> /* obj_dat.h is generated from objects.h by obj_dat.pl */ -#ifndef OPENSSL_NO_OBJECT -# include "obj_dat.h" -#else -/* You will have to load all the objects needed manually in the application */ -# define NUM_NID 0 -# define NUM_SN 0 -# define NUM_LN 0 -# define NUM_OBJ 0 -static const unsigned char lvalues[1]; -static const ASN1_OBJECT nid_objs[1]; -static const unsigned int sn_objs[1]; -static const unsigned int ln_objs[1]; -static const unsigned int obj_objs[1]; -#endif +#include "obj_dat.h" DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, sn); DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, ln); diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h index 848649d3da..d8057cbaa0 100644 --- a/crypto/pem/pem.h +++ b/crypto/pem/pem.h @@ -60,12 +60,8 @@ # define HEADER_PEM_H # include <openssl/e_os2.h> -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif -# ifndef OPENSSL_NO_STACK -# include <openssl/stack.h> -# endif +# include <openssl/bio.h> +# include <openssl/stack.h> # include <openssl/evp.h> # include <openssl/x509.h> # include <openssl/pem2.h> @@ -343,7 +339,6 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ # endif -# ifndef OPENSSL_NO_BIO # define DECLARE_PEM_read_bio(name, type) \ type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); @@ -357,13 +352,6 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ unsigned char *kstr, int klen, pem_password_cb *cb, void *u); -# else - -# define DECLARE_PEM_read_bio(name, type) /**/ -# define DECLARE_PEM_write_bio(name, type) /**/ -# define DECLARE_PEM_write_bio_const(name, type) /**/ -# define DECLARE_PEM_write_cb_bio(name, type) /**/ -# endif # define DECLARE_PEM_write(name, type) \ DECLARE_PEM_write_bio(name, type) \ DECLARE_PEM_write_fp(name, type) @@ -385,19 +373,12 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ # define DECLARE_PEM_rw_cb(name, type) \ DECLARE_PEM_read(name, type) \ DECLARE_PEM_write_cb(name, type) -# if 1 -/* "userdata": new with OpenSSL 0.9.4 */ typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata); -# else -/* OpenSSL 0.9.3, 0.9.3a */ -typedef int pem_password_cb (char *buf, int size, int rwflag); -# endif 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); -# ifndef OPENSSL_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, const char *hdr, @@ -416,7 +397,6 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cd, void *u); -# endif int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, long *len); diff --git a/crypto/rsa/rsa.h b/crypto/rsa/rsa.h index b3d2839669..9ba64970b6 100644 --- a/crypto/rsa/rsa.h +++ b/crypto/rsa/rsa.h @@ -61,9 +61,7 @@ # include <openssl/asn1.h> -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/bio.h> # include <openssl/crypto.h> # include <openssl/ossl_typ.h> # ifdef OPENSSL_USE_DEPRECATED @@ -395,9 +393,7 @@ DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS) int RSA_print_fp(FILE *fp, const RSA *r, int offset); # endif -# ifndef OPENSSL_NO_BIO int RSA_print(BIO *bp, const RSA *r, int offset); -# endif # ifndef OPENSSL_NO_RC4 int i2d_RSA_NET(const RSA *a, unsigned char **pp, diff --git a/crypto/ts/ts.h b/crypto/ts/ts.h index 16eccbb38d..8b6b5f29a3 100644 --- a/crypto/ts/ts.h +++ b/crypto/ts/ts.h @@ -62,15 +62,9 @@ # include <openssl/opensslconf.h> # include <openssl/symhacks.h> -# ifndef OPENSSL_NO_BUFFER -# include <openssl/buffer.h> -# endif -# ifndef OPENSSL_NO_EVP -# include <openssl/evp.h> -# endif -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/buffer.h> +# include <openssl/evp.h> +# include <openssl/bio.h> # include <openssl/stack.h> # include <openssl/asn1.h> # include <openssl/safestack.h> diff --git a/crypto/ts/ts_asn1.c b/crypto/ts/ts_asn1.c index 06bf5f37d3..7c741d9691 100644 --- a/crypto/ts/ts_asn1.c +++ b/crypto/ts/ts_asn1.c @@ -67,7 +67,6 @@ ASN1_SEQUENCE(TS_MSG_IMPRINT) = { IMPLEMENT_ASN1_FUNCTIONS_const(TS_MSG_IMPRINT) IMPLEMENT_ASN1_DUP_FUNCTION(TS_MSG_IMPRINT) -#ifndef OPENSSL_NO_BIO TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *bp, TS_MSG_IMPRINT **a) { return ASN1_d2i_bio_of(TS_MSG_IMPRINT, TS_MSG_IMPRINT_new, @@ -78,7 +77,6 @@ int i2d_TS_MSG_IMPRINT_bio(BIO *bp, TS_MSG_IMPRINT *a) { return ASN1_i2d_bio_of_const(TS_MSG_IMPRINT, i2d_TS_MSG_IMPRINT, bp, a); } -#endif #ifndef OPENSSL_NO_STDIO TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a) { @@ -103,7 +101,6 @@ ASN1_SEQUENCE(TS_REQ) = { IMPLEMENT_ASN1_FUNCTIONS_const(TS_REQ) IMPLEMENT_ASN1_DUP_FUNCTION(TS_REQ) -#ifndef OPENSSL_NO_BIO TS_REQ *d2i_TS_REQ_bio(BIO *bp, TS_REQ **a) { return ASN1_d2i_bio_of(TS_REQ, TS_REQ_new, d2i_TS_REQ, bp, a); @@ -113,7 +110,6 @@ int i2d_TS_REQ_bio(BIO *bp, TS_REQ *a) { return ASN1_i2d_bio_of_const(TS_REQ, i2d_TS_REQ, bp, a); } -#endif #ifndef OPENSSL_NO_STDIO TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a) { @@ -150,7 +146,6 @@ ASN1_SEQUENCE(TS_TST_INFO) = { IMPLEMENT_ASN1_FUNCTIONS_const(TS_TST_INFO) IMPLEMENT_ASN1_DUP_FUNCTION(TS_TST_INFO) -#ifndef OPENSSL_NO_BIO TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *bp, TS_TST_INFO **a) { return ASN1_d2i_bio_of(TS_TST_INFO, TS_TST_INFO_new, d2i_TS_TST_INFO, bp, @@ -161,7 +156,6 @@ int i2d_TS_TST_INFO_bio(BIO *bp, TS_TST_INFO *a) { return ASN1_i2d_bio_of_const(TS_TST_INFO, i2d_TS_TST_INFO, bp, a); } -#endif #ifndef OPENSSL_NO_STDIO TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a) { @@ -236,7 +230,6 @@ IMPLEMENT_ASN1_FUNCTIONS_const(TS_RESP) IMPLEMENT_ASN1_DUP_FUNCTION(TS_RESP) -#ifndef OPENSSL_NO_BIO TS_RESP *d2i_TS_RESP_bio(BIO *bp, TS_RESP **a) { return ASN1_d2i_bio_of(TS_RESP, TS_RESP_new, d2i_TS_RESP, bp, a); @@ -246,7 +239,6 @@ int i2d_TS_RESP_bio(BIO *bp, TS_RESP *a) { return ASN1_i2d_bio_of_const(TS_RESP, i2d_TS_RESP, bp, a); } -#endif #ifndef OPENSSL_NO_STDIO TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a) { diff --git a/crypto/txt_db/txt_db.h b/crypto/txt_db/txt_db.h index 98e23a2003..54b71fc03e 100644 --- a/crypto/txt_db/txt_db.h +++ b/crypto/txt_db/txt_db.h @@ -60,9 +60,7 @@ # define HEADER_TXT_DB_H # include <openssl/opensslconf.h> -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/bio.h> # include <openssl/stack.h> # include <openssl/lhash.h> @@ -91,13 +89,8 @@ typedef struct txt_db_st { OPENSSL_STRING *arg_row; } TXT_DB; -# ifndef OPENSSL_NO_BIO TXT_DB *TXT_DB_read(BIO *in, int num); long TXT_DB_write(BIO *out, TXT_DB *db); -# else -TXT_DB *TXT_DB_read(char *in, int num); -long TXT_DB_write(char *out, TXT_DB *db); -# endif int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); void TXT_DB_free(TXT_DB *db); diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 8e672621ce..5b25de036b 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -66,15 +66,9 @@ # include <openssl/e_os2.h> # include <openssl/symhacks.h> -# ifndef OPENSSL_NO_BUFFER -# include <openssl/buffer.h> -# endif -# ifndef OPENSSL_NO_EVP -# include <openssl/evp.h> -# endif -# ifndef OPENSSL_NO_BIO -# include <openssl/bio.h> -# endif +# include <openssl/buffer.h> +# include <openssl/evp.h> +# include <openssl/bio.h> # include <openssl/stack.h> # include <openssl/asn1.h> # include <openssl/safestack.h> @@ -179,11 +173,7 @@ DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) struct X509_name_st { STACK_OF(X509_NAME_ENTRY) *entries; int modified; /* true if 'bytes' needs to be built */ -# ifndef OPENSSL_NO_BUFFER BUF_MEM *bytes; -# else - char *bytes; -# endif /* unsigned long hash; Keep the hash around for lookups */ unsigned char *canon_enc; int canon_enclen; @@ -492,7 +482,6 @@ typedef struct private_key_st { int references; } X509_PKEY; -# ifndef OPENSSL_NO_EVP typedef struct X509_info_st { X509 *x509; X509_CRL *crl; @@ -504,7 +493,6 @@ typedef struct X509_info_st { } X509_INFO; DECLARE_STACK_OF(X509_INFO) -# endif /* * The next 2 structures and their 8 routines were sent to me by Pat Richard @@ -627,7 +615,6 @@ void *X509_CRL_get_meth_data(X509_CRL *crl); const char *X509_verify_cert_error_string(long n); -# ifndef OPENSSL_NO_EVP int X509_verify(X509 *a, EVP_PKEY *r); int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); @@ -664,7 +651,6 @@ int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, unsigned char *md, unsigned int *len); int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, unsigned char *md, unsigned int *len); -# endif # ifndef OPENSSL_NO_STDIO X509 *d2i_X509_fp(FILE *fp, X509 **x509); @@ -705,7 +691,6 @@ int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); # endif -# ifndef OPENSSL_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); @@ -742,7 +727,6 @@ int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); -# endif X509 *X509_dup(X509 *x509); X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); @@ -869,7 +853,6 @@ DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) -# ifndef OPENSSL_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); @@ -896,7 +879,6 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx); -# endif int X509_set_version(X509 *x, long version); int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); @@ -992,7 +974,6 @@ int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); # endif -# ifndef OPENSSL_NO_BIO int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); @@ -1005,7 +986,6 @@ int X509_CRL_print(BIO *bp, X509_CRL *x); int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag); int X509_REQ_print(BIO *bp, X509_REQ *req); -# endif int X509_NAME_entry_count(X509_NAME *name); int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len); diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index f5da926a12..8e639c829d 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -538,9 +538,6 @@ static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) static int check_chain_extensions(X509_STORE_CTX *ctx) { -#ifdef OPENSSL_NO_CHAIN_VERIFY - return 1; -#else int i, ok = 0, must_be_ca, plen = 0; X509 *x; int (*cb) (int xok, X509_STORE_CTX *xctx); @@ -680,7 +677,6 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) ok = 1; end: return ok; -#endif } static int check_name_constraints(X509_STORE_CTX *ctx) diff --git a/crypto/x509/x509_vfy.h b/crypto/x509/x509_vfy.h index 105862bc71..959af30fa8 100644 --- a/crypto/x509/x509_vfy.h +++ b/crypto/x509/x509_vfy.h @@ -68,9 +68,7 @@ # define HEADER_X509_VFY_H # include <openssl/opensslconf.h> -# ifndef OPENSSL_NO_LHASH -# include <openssl/lhash.h> -# endif +# include <openssl/lhash.h> # include <openssl/bio.h> # include <openssl/crypto.h> # include <openssl/symhacks.h> |