Add EVP functionality to create domain params and keys by user data
[openssl.git] / crypto / evp / p_open.c
index c9cd9b16c8e5591b6857e256f633018582c13920..8cc72ebbf2ffde57cc84ca10da579bfaf3e467cd 100644 (file)
@@ -31,7 +31,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
             return 0;
     }
 
-    if (!priv)
+    if (priv == NULL)
         return 1;
 
     if (EVP_PKEY_id(priv) != EVP_PKEY_RSA) {
@@ -40,7 +40,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
     }
 
     size = EVP_PKEY_size(priv);
-    key = OPENSSL_malloc(size + 2);
+    key = OPENSSL_malloc(size);
     if (key == NULL) {
         /* ERROR */
         EVPerr(EVP_F_EVP_OPENINIT, ERR_R_MALLOC_FAILURE);