Add GCM IV generator. Add some FIPS restrictions to GCM. Update fips_gcmtest.
[openssl.git] / crypto / evp / p_lib.c
index 249ac2bd2a08e1d7fcbc7681ea85b8ae579e4005..e26ccd0d086a5f390cde8b397540f7565100d5a7 100644 (file)
@@ -220,7 +220,10 @@ static int pkey_set_type(EVP_PKEY *pkey, int type, const char *str, int len)
 #ifndef OPENSSL_NO_ENGINE
                /* If we have an ENGINE release it */
                if (pkey->engine)
+                       {
                        ENGINE_finish(pkey->engine);
+                       pkey->engine = NULL;
+                       }
 #endif
                }
        if (str)
@@ -408,7 +411,10 @@ void EVP_PKEY_free(EVP_PKEY *x)
 static void EVP_PKEY_free_it(EVP_PKEY *x)
        {
        if (x->ameth && x->ameth->pkey_free)
+               {
                x->ameth->pkey_free(x);
+               x->pkey.ptr = NULL;
+               }
 #ifndef OPENSSL_NO_ENGINE
        if (x->engine)
                {