| OLD | NEW |
| 1 /* crypto/evp/p_dec.c */ | 1 /* crypto/evp/p_dec.c */ |
| 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
| 6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
| 7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
| 8 * | 8 * |
| 9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
| 10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include <stdio.h> | 59 #include <stdio.h> |
| 60 #include "cryptlib.h" | 60 #include "cryptlib.h" |
| 61 #include <openssl/rand.h> | 61 #include <openssl/rand.h> |
| 62 #ifndef OPENSSL_NO_RSA | 62 #ifndef OPENSSL_NO_RSA |
| 63 #include <openssl/rsa.h> | 63 #include <openssl/rsa.h> |
| 64 #endif | 64 #endif |
| 65 #include <openssl/evp.h> | 65 #include <openssl/evp.h> |
| 66 #include <openssl/objects.h> | 66 #include <openssl/objects.h> |
| 67 #include <openssl/x509.h> | 67 #include <openssl/x509.h> |
| 68 | 68 |
| 69 int EVP_PKEY_decrypt(unsigned char *key, const unsigned char *ek, int ekl, | 69 int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl, |
| 70 EVP_PKEY *priv) | 70 EVP_PKEY *priv) |
| 71 { | 71 { |
| 72 int ret= -1; | 72 int ret= -1; |
| 73 | 73 |
| 74 #ifndef OPENSSL_NO_RSA | 74 #ifndef OPENSSL_NO_RSA |
| 75 if (priv->type != EVP_PKEY_RSA) | 75 if (priv->type != EVP_PKEY_RSA) |
| 76 { | 76 { |
| 77 #endif | 77 #endif |
| 78 » » EVPerr(EVP_F_EVP_PKEY_DECRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); | 78 » » EVPerr(EVP_F_EVP_PKEY_DECRYPT_OLD,EVP_R_PUBLIC_KEY_NOT_RSA); |
| 79 #ifndef OPENSSL_NO_RSA | 79 #ifndef OPENSSL_NO_RSA |
| 80 goto err; | 80 goto err; |
| 81 } | 81 } |
| 82 | 82 |
| 83 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); |
| 84 err: | 84 err: |
| 85 #endif | 85 #endif |
| 86 return(ret); | 86 return(ret); |
| 87 } | 87 } |
| OLD | NEW |