diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-06-11 12:18:15 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-06-11 12:18:15 +0000 |
commit | a91dedca48ec58e6baab75839753121fb725c9e1 (patch) | |
tree | 939e2269057c5d61dbfa1aca78369159282cb3bd /crypto/evp/p_open.c | |
parent | 482a9d41b93f504a94ee889c1ebe406e05088c93 (diff) |
Document EVP routines. Change EVP_SealInit() and EVP_OpenInit()
to support multiple calls.
New function to retrieve email address from certificates and
requests.
Diffstat (limited to 'crypto/evp/p_open.c')
-rw-r--r-- | crypto/evp/p_open.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c index 85d5097644..dbf83b250a 100644 --- a/crypto/evp/p_open.c +++ b/crypto/evp/p_open.c @@ -68,7 +68,14 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, { unsigned char *key=NULL; int i,size=0,ret=0; - + + if(type) { + EVP_CIPHER_CTX_init(ctx); + EVP_DecryptInit(ctx,type,NULL,NULL); + } + + if(!priv) return 1; + if (priv->type != EVP_PKEY_RSA) { EVPerr(EVP_F_EVP_OPENINIT,EVP_R_PUBLIC_KEY_NOT_RSA); @@ -76,11 +83,6 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, goto err; } - if(type) { - EVP_CIPHER_CTX_init(ctx); - EVP_DecryptInit(ctx,type,NULL,NULL); - } - size=RSA_size(priv->pkey.rsa); key=(unsigned char *)OPENSSL_malloc(size+2); if (key == NULL) |