GOST: rearrange code so it's more like C rather than C++
authorRichard Levitte <levitte@openssl.org>
Mon, 22 Aug 2016 11:35:27 +0000 (13:35 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 22 Aug 2016 13:48:35 +0000 (15:48 +0200)
Some builds fail otherwise.

Reviewed-by: Matt Caswell <matt@openssl.org>
engines/ccgost/gost2001.c

index 57f6ee28a8b75cfb5dc4f8aed650cbe9f459a7bc..881d0d3c909750cc833ed67a3228db9aba0a740b 100644 (file)
@@ -434,14 +434,16 @@ int gost2001_compute_public(EC_KEY *ec)
 int gost2001_keygen(EC_KEY *ec)
 {
     BIGNUM *order = BN_new(), *d = BN_new();
+    const EC_GROUP *group = NULL;
+
     if (order == NULL || d == NULL) {
         GOSTerr(GOST_F_GOST2001_KEYGEN, ERR_R_MALLOC_FAILURE);
         BN_free(d);
         BN_free(order);
         return 0;
     }
-    const EC_GROUP *group = EC_KEY_get0_group(ec);
 
+    group = EC_KEY_get0_group(ec);
     if(!group || !EC_GROUP_get_order(group, order, NULL)) {
         GOSTerr(GOST_F_GOST2001_KEYGEN, ERR_R_INTERNAL_ERROR);
         BN_free(d);