Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)
* to the |save_type| field, because |type| is supposed to be set
* to EVP_PKEY_NONE in that case.
*/
- if (keymgmt != NULL)
- pkey->save_type = ameth->pkey_id;
- else if (pkey->ameth != NULL)
- pkey->type = ameth->pkey_id;
+ if (ameth != NULL) {
+ if (keymgmt != NULL)
+ pkey->save_type = ameth->pkey_id;
+ else if (pkey->ameth != NULL)
+ pkey->type = ameth->pkey_id;
+ }
#endif
}
return 1;