X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_ameth.c;fp=gost_ameth.c;h=2582d633c83a1114027622c0cd96c46e883238d5;hb=6da0c1cd9f85cfd01983cf1bf779320474bef57d;hp=4a95de4b5a203b13c32406abb6df7814f2756493;hpb=e9a7bfc3a6ef368dcc7eba482356c166f7d888d7;p=openssl-gost%2Fengine.git diff --git a/gost_ameth.c b/gost_ameth.c index 4a95de4..2582d63 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -977,7 +977,10 @@ static int pub_encode_gost_ec(X509_PUBKEY *pub, const EVP_PKEY *pk) GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, ERR_R_MALLOC_FAILURE); goto err; } - EC_GROUP_get_order(EC_KEY_get0_group(ec), order, NULL); + if (EC_GROUP_get_order(EC_KEY_get0_group(ec), order, NULL) == 0) { + GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, ERR_R_INTERNAL_ERROR); + goto err; + } pub_key = EC_KEY_get0_public_key(ec); if (!pub_key) { GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, GOST_R_PUBLIC_KEY_UNDEFINED);