-/* $OpenBSD: gostr341001_ameth.c,v 1.21 2023/12/28 21:49:07 tb Exp $ */
+/* $OpenBSD: gostr341001_ameth.c,v 1.22 2023/12/28 21:53:09 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
if (X509_PUBKEY_get0_param(&palgobj, &pubkey_buf, &pub_len, &palg, pub)
== 0)
return 0;
- (void)EVP_PKEY_assign_GOST(pk, NULL);
+ /* Called for the side effect of freeing pk->pkey. */
+ if (!EVP_PKEY_set_type(pk, EVP_PKEY_GOSTR01))
+ return 0;
X509_ALGOR_get0(NULL, &ptype, (const void **)&pval, palg);
if (ptype != V_ASN1_SEQUENCE) {
GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT);
GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT);
return 0;
}
- (void)EVP_PKEY_assign_GOST(pk, NULL);
+ /* Called for the side effect of freeing pk->pkey. */
+ if (!EVP_PKEY_set_type(pk, EVP_PKEY_GOSTR01))
+ return 0;
X509_ALGOR_get0(NULL, &ptype, (const void **)&pval, palg);
if (ptype != V_ASN1_SEQUENCE) {
GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT);