diff options
Diffstat (limited to 'src/lib/libcrypto/evp/p_dec.c')
-rw-r--r-- | src/lib/libcrypto/evp/p_dec.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/libcrypto/evp/p_dec.c b/src/lib/libcrypto/evp/p_dec.c index e845ce70c7..57b5daa453 100644 --- a/src/lib/libcrypto/evp/p_dec.c +++ b/src/lib/libcrypto/evp/p_dec.c | |||
@@ -58,27 +58,30 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "rand.h" | 61 | #include <openssl/rand.h> |
62 | #include "rsa.h" | 62 | #ifndef NO_RSA |
63 | #include "evp.h" | 63 | #include <openssl/rsa.h> |
64 | #include "objects.h" | 64 | #endif |
65 | #include "x509.h" | 65 | #include <openssl/evp.h> |
66 | #include <openssl/objects.h> | ||
67 | #include <openssl/x509.h> | ||
66 | 68 | ||
67 | int EVP_PKEY_decrypt(key,ek,ekl,priv) | 69 | int EVP_PKEY_decrypt(unsigned char *key, unsigned char *ek, int ekl, |
68 | unsigned char *key; | 70 | EVP_PKEY *priv) |
69 | unsigned char *ek; | ||
70 | int ekl; | ||
71 | EVP_PKEY *priv; | ||
72 | { | 71 | { |
73 | int ret= -1; | 72 | int ret= -1; |
74 | 73 | ||
74 | #ifndef NO_RSA | ||
75 | if (priv->type != EVP_PKEY_RSA) | 75 | if (priv->type != EVP_PKEY_RSA) |
76 | { | 76 | { |
77 | #endif | ||
77 | EVPerr(EVP_F_EVP_PKEY_DECRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); | 78 | EVPerr(EVP_F_EVP_PKEY_DECRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); |
79 | #ifndef NO_RSA | ||
78 | goto err; | 80 | goto err; |
79 | } | 81 | } |
80 | 82 | ||
81 | ret=RSA_private_decrypt(ekl,ek,key,priv->pkey.rsa,RSA_PKCS1_PADDING); | 83 | ret=RSA_private_decrypt(ekl,ek,key,priv->pkey.rsa,RSA_PKCS1_PADDING); |
82 | err: | 84 | err: |
85 | #endif | ||
83 | return(ret); | 86 | return(ret); |
84 | } | 87 | } |