GH715: ENGINE_finish can take NULL
Simplifies calling code. Also fixed up any !ptr tests that were nearby, turning them into NULL tests. Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
		@@ -317,8 +317,7 @@ int init_gen_str(EVP_PKEY_CTX **pctx,
 | 
			
		||||
 | 
			
		||||
    EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
    if (tmpeng)
 | 
			
		||||
        ENGINE_finish(tmpeng);
 | 
			
		||||
    ENGINE_finish(tmpeng);
 | 
			
		||||
#endif
 | 
			
		||||
    ctx = EVP_PKEY_CTX_new_id(pkey_id, e);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1376,8 +1376,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
 | 
			
		||||
 | 
			
		||||
        EVP_PKEY_asn1_get0_info(NULL, pkey_type, NULL, NULL, NULL, ameth);
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        if (tmpeng)
 | 
			
		||||
            ENGINE_finish(tmpeng);
 | 
			
		||||
        ENGINE_finish(tmpeng);
 | 
			
		||||
#endif
 | 
			
		||||
        if (*pkey_type == EVP_PKEY_RSA) {
 | 
			
		||||
            if (p) {
 | 
			
		||||
@@ -1434,8 +1433,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
 | 
			
		||||
        EVP_PKEY_asn1_get0_info(NULL, NULL, NULL, NULL, &anam, ameth);
 | 
			
		||||
        *palgnam = OPENSSL_strdup(anam);
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        if (tmpeng)
 | 
			
		||||
            ENGINE_finish(tmpeng);
 | 
			
		||||
        ENGINE_finish(tmpeng);
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user