]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix Coverity #305799
authorDmitry Belyavskiy <beldmit@gmail.com>
Sun, 27 Sep 2020 08:11:51 +0000 (11:11 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Sun, 27 Sep 2020 08:11:51 +0000 (11:11 +0300)
gost_ameth.c

index 4a95de4b5a203b13c32406abb6df7814f2756493..2582d633c83a1114027622c0cd96c46e883238d5 100644 (file)
@@ -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);