From: Dmitry Belyavskiy Date: Thu, 29 Mar 2018 14:12:24 +0000 (+0300) Subject: C90-friendly X-Git-Tag: v3.0.0~421 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=3bd506dcbb835c644bd15a58f0073ae41f76cb06;p=openssl-gost%2Fengine.git C90-friendly --- diff --git a/gost_ameth.c b/gost_ameth.c index 12ea593..05d9cd2 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -419,6 +419,8 @@ static int priv_encode_gost(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk) ASN1_STRING *params = encode_gost_algor_params(pk); unsigned char *buf = NULL; int key_len = pkey_bits_gost(pk), i = 0; + /* unmasked private key */ + const char *pk_format = get_gost_engine_param(GOST_PARAM_PK_FORMAT); if (!params) { return 0; @@ -441,8 +443,6 @@ static int priv_encode_gost(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk) buf[key_len - 1 - i] = tmp; } - /* unmasked private key */ - const char *pk_format = get_gost_engine_param(GOST_PARAM_PK_FORMAT); if(pk_format != NULL && strcmp(pk_format, PK_WRAP_PARAM) == 0) { ASN1_STRING *octet = NULL; int priv_len = 0;