X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fevp%2Fp_enc.c;h=4cf6acaf5db90b39a45fc8dcc12ce0b340f52346;hb=153a59f46d24803f90d355be6689697e08266fd3;hp=a26bfad02aa2a74f959f694d1815d204f39792fd;hpb=58964a492275ca9a59a0cd9c8155cb2491b4b909;p=oweals%2Fopenssl.git diff --git a/crypto/evp/p_enc.c b/crypto/evp/p_enc.c index a26bfad02a..4cf6acaf5d 100644 --- a/crypto/evp/p_enc.c +++ b/crypto/evp/p_enc.c @@ -58,26 +58,29 @@ #include #include "cryptlib.h" -#include "rand.h" -#include "rsa.h" -#include "evp.h" -#include "objects.h" -#include "x509.h" +#include +#ifndef NO_RSA +#include +#endif +#include +#include +#include -int EVP_PKEY_encrypt(ek,key,key_len,pubk) -unsigned char *ek; -unsigned char *key; -int key_len; -EVP_PKEY *pubk; +int EVP_PKEY_encrypt(unsigned char *ek, unsigned char *key, int key_len, + EVP_PKEY *pubk) { int ret=0; +#ifndef NO_RSA if (pubk->type != EVP_PKEY_RSA) { +#endif EVPerr(EVP_F_EVP_PKEY_ENCRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); +#ifndef NO_RSA goto err; } ret=RSA_public_encrypt(key_len,key,ek,pubk->pkey.rsa,RSA_PKCS1_PADDING); err: +#endif return(ret); }