OLD | NEW |
1 /* crypto/evp/p_enc.c */ | 1 /* crypto/evp/p_enc.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_encrypt(unsigned char *ek, const unsigned char *key, int key_len, | 69 int EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_le
n, |
70 EVP_PKEY *pubk) | 70 EVP_PKEY *pubk) |
71 { | 71 { |
72 int ret=0; | 72 int ret=0; |
73 | 73 |
74 #ifndef OPENSSL_NO_RSA | 74 #ifndef OPENSSL_NO_RSA |
75 if (pubk->type != EVP_PKEY_RSA) | 75 if (pubk->type != EVP_PKEY_RSA) |
76 { | 76 { |
77 #endif | 77 #endif |
78 » » EVPerr(EVP_F_EVP_PKEY_ENCRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); | 78 » » EVPerr(EVP_F_EVP_PKEY_ENCRYPT_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 ret=RSA_public_encrypt(key_len,key,ek,pubk->pkey.rsa,RSA_PKCS1_PADDING); | 82 ret=RSA_public_encrypt(key_len,key,ek,pubk->pkey.rsa,RSA_PKCS1_PADDING); |
83 err: | 83 err: |
84 #endif | 84 #endif |
85 return(ret); | 85 return(ret); |
86 } | 86 } |
OLD | NEW |