aesni TLS GCM support
[openssl.git] / crypto / evp / p_open.c
index 8ec6c75a1399ec1709956623c0e3dc8a8e926859..c748fbea877250031f8b40b60b36ef2d4b5f85c9 100644 (file)
@@ -64,6 +64,7 @@
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
+#include <openssl/rsa.h>
 
 int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
        const unsigned char *ek, int ekl, const unsigned char *iv,
@@ -94,7 +95,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
                goto err;
                }
 
-       i=EVP_PKEY_decrypt(key,ek,ekl,priv);
+       i=EVP_PKEY_decrypt_old(key,ek,ekl,priv);
        if ((i <= 0) || !EVP_CIPHER_CTX_set_key_length(ctx, i))
                {
                /* ERROR */
@@ -114,7 +115,8 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
        int i;
 
        i=EVP_DecryptFinal_ex(ctx,out,outl);
-       EVP_DecryptInit_ex(ctx,NULL,NULL,NULL,NULL);
+       if (i)
+               i = EVP_DecryptInit_ex(ctx,NULL,NULL,NULL,NULL);
        return(i);
        }
 #else /* !OPENSSL_NO_RSA */