diff options
author | Ulf Möller <ulf@openssl.org> | 1999-04-27 01:14:46 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-04-27 01:14:46 +0000 |
commit | f5d7a031a3c3e7b1700a67d6dc19daf3718ce6ee (patch) | |
tree | f5db72824de4586c35cef513ed48aff0d4b69a6b /crypto/evp | |
parent | b64f825671861144e1c24f2a5498a95a083021cd (diff) |
New Configure option no-<cipher> (rsa, idea, rc5, ...).
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/Makefile.ssl | 2 | ||||
-rw-r--r-- | crypto/evp/evp.h | 24 | ||||
-rw-r--r-- | crypto/evp/evp_pkey.c | 23 | ||||
-rw-r--r-- | crypto/evp/p_open.c | 2 | ||||
-rw-r--r-- | crypto/evp/p_seal.c | 2 |
5 files changed, 34 insertions, 19 deletions
diff --git a/crypto/evp/Makefile.ssl b/crypto/evp/Makefile.ssl index 3491f2ceb3..08f0a79a83 100644 --- a/crypto/evp/Makefile.ssl +++ b/crypto/evp/Makefile.ssl @@ -92,7 +92,7 @@ lint: lint -DLINT $(INCLUDES) $(SRC)>fluff depend: - $(MAKEDEPEND) $(INCLUDES) $(LIBSRC) + $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC) dclean: $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 4b5af77b2a..ccb7d51474 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -69,10 +69,10 @@ extern "C" { #ifndef NO_MD5 #include <openssl/md5.h> #endif -#if !defined(NO_SHA) || !defined(NO_SHA1) +#ifndef NO_SHA #include <openssl/sha.h> #endif -#ifndef NO_RMD160 +#ifndef NO_RIPEMD #include <openssl/ripemd.h> #endif #ifndef NO_DES @@ -87,7 +87,7 @@ extern "C" { #ifndef NO_RC5 #include <openssl/rc5.h> #endif -#ifndef NO_BLOWFISH +#ifndef NO_BF #include <openssl/blowfish.h> #endif #ifndef NO_CAST @@ -111,20 +111,14 @@ extern "C" { #ifndef NO_RSA #include <openssl/rsa.h> -#else -#define RSA long #endif #ifndef NO_DSA #include <openssl/dsa.h> -#else -#define DSA long #endif #ifndef NO_DH #include <openssl/dh.h> -#else -#define DH long #endif #include <openssl/objects.h> @@ -159,9 +153,15 @@ typedef struct evp_pkey_st int references; union { char *ptr; +#ifndef NO_RSA struct rsa_st *rsa; /* RSA */ +#endif +#ifndef NO_DSA struct dsa_st *dsa; /* DSA */ +#endif +#ifndef NO_DH struct dh_st *dh; /* DH */ +#endif } pkey; int save_parameters; STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */ @@ -294,10 +294,10 @@ typedef struct env_md_ctx_st #ifndef NO_MD5 MD5_CTX md5; #endif -#ifndef NO_RMD160 +#ifndef NO_RIPEMD RIPEMD160_CTX ripemd160; #endif -#if !defined(NO_SHA) || !defined(NO_SHA1) +#ifndef NO_SHA SHA_CTX sha; #endif #ifndef NO_MDC2 @@ -372,7 +372,7 @@ typedef struct evp_cipher_ctx_st #ifndef NO_RC5 RC5_32_KEY rc5_ks;/* key schedule */ #endif -#ifndef NO_BLOWFISH +#ifndef NO_BF BF_KEY bf_ks;/* key schedule */ #endif #ifndef NO_CAST diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index 8bea61ebbd..421e452db1 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -67,14 +67,19 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) { EVP_PKEY *pkey; +#ifndef NO_RSA RSA *rsa; +#endif +#ifndef NO_DSA DSA *dsa; ASN1_INTEGER *dsapriv; - X509_ALGOR *a; STACK *ndsa; BN_CTX *ctx; + int plen; +#endif + X509_ALGOR *a; unsigned char *p; - int plen, pkeylen; + int pkeylen; char obj_tmp[80]; switch (p8->broken) { @@ -100,6 +105,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) a = p8->pkeyalg; switch (OBJ_obj2nid(a->algorithm)) { +#ifndef NO_RSA case NID_rsaEncryption: if (!(rsa = d2i_RSAPrivateKey (NULL, &p, pkeylen))) { EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); @@ -107,7 +113,8 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) } EVP_PKEY_assign_RSA (pkey, rsa); break; - +#endif +#ifndef NO_DSA case NID_dsa: /* PKCS#8 DSA is weird: you just get a private key integer * and parameters in the AlgorithmIdentifier the pubkey must @@ -174,7 +181,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) EVP_PKEY_assign_DSA (pkey, dsa); BN_CTX_free (ctx); break; - +#endif default: EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM); if (!a->algorithm) strcpy (obj_tmp, "NULL"); @@ -191,9 +198,11 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) { PKCS8_PRIV_KEY_INFO *p8; +#ifndef NO_DSA ASN1_INTEGER *dpkey; unsigned char *p, *q; int len; +#endif if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) { EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); return NULL; @@ -205,6 +214,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) return NULL; } switch (EVP_PKEY_type(pkey->type)) { +#ifndef NO_RSA case EVP_PKEY_RSA: p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption); @@ -216,7 +226,8 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) return NULL; } break; - +#endif +#ifndef NO_DSA case EVP_PKEY_DSA: p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa); @@ -249,7 +260,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) } ASN1_INTEGER_free (dpkey); break; - +#endif default: EVPerr(EVP_F_EVP_PKEY2PKCS8, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM); PKCS8_PRIV_KEY_INFO_free (p8); diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c index 6b532949a7..ddb9fd6942 100644 --- a/crypto/evp/p_open.c +++ b/crypto/evp/p_open.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#ifndef NO_RSA #include <stdio.h> #include "cryptlib.h" #include <openssl/evp.h> @@ -109,3 +110,4 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) EVP_DecryptInit(ctx,NULL,NULL,NULL); return(i); } +#endif diff --git a/crypto/evp/p_seal.c b/crypto/evp/p_seal.c index cd29276773..09b46f4b0e 100644 --- a/crypto/evp/p_seal.c +++ b/crypto/evp/p_seal.c @@ -59,7 +59,9 @@ #include <stdio.h> #include "cryptlib.h" #include <openssl/rand.h> +#ifndef NO_RSA #include <openssl/rsa.h> +#endif #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> |