From: Dmitry Belyavskiy Date: Wed, 30 Mar 2016 18:02:54 +0000 (+0300) Subject: Try to fix segfault X-Git-Tag: v1.1.0.2~25 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=bf17fc11b0f28fd4927827a9edf083dc175d0b3d;p=openssl-gost%2Fengine.git Try to fix segfault --- diff --git a/gost_crypt.c b/gost_crypt.c index b9385a1..59d75d7 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -696,15 +696,10 @@ int gost89_get_asn1_parameters(EVP_CIPHER_CTX *ctx, ASN1_TYPE *params) } { - ASN1_TYPE *tmp = ASN1_TYPE_new(); - if (tmp == NULL) { - GOST_CIPHER_PARAMS_free(gcp); - GOSTerr(GOST_F_GOST89_GET_ASN1_PARAMETERS, ERR_R_MALLOC_FAILURE); - return -1; - } - ASN1_TYPE_set(tmp, V_ASN1_OCTET_STRING, gcp->iv); - EVP_CIPHER_get_asn1_iv(ctx, tmp); - ASN1_TYPE_free(tmp); + ASN1_TYPE tmp; + tmp.value.octet_string = gcp->iv; + tmp.type = V_ASN1_OCTET_STRING; + EVP_CIPHER_get_asn1_iv(ctx, &tmp); } GOST_CIPHER_PARAMS_free(gcp);