From 4325da8c557429f74d99967d29e4783af346e930 Mon Sep 17 00:00:00 2001 From: Victor Wagner Date: Fri, 18 Sep 2015 15:24:14 +0300 Subject: [PATCH] Fixed runtime initalization of NID in the GOST-MAC-12 pkey method. --- gost_eng.c | 1 + test/00-engine.t | 2 +- test/02-mac.t | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gost_eng.c b/gost_eng.c index aee0914..3debd18 100644 --- a/gost_eng.c +++ b/gost_eng.c @@ -122,6 +122,7 @@ static int bind_gost(ENGINE *e, const char *id) gost_digest_nids[4]=NID_gost_mac_12; gost_pkey_meth_nids[2]=NID_gost2012_256; gost_pkey_meth_nids[3]=NID_gost2012_512; + gost_pkey_meth_nids[4]=NID_gost_mac_12; /* EVP_CIPHERs */ cipher_gost_cbc.nid = NID_gost89_cbc; cipher_gost_cpcnt_12.nid = NID_gost89_cnt_12; diff --git a/test/00-engine.t b/test/00-engine.t index 9fe06a5..35b5f92 100644 --- a/test/00-engine.t +++ b/test/00-engine.t @@ -38,7 +38,7 @@ if ( -f $engine . ".info") { $engine_info= < 10; +use Test::More tests => 11; use Cwd 'abs_path'; # prepare data for @@ -37,5 +37,9 @@ is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} testbig.dat` "GOST-MAC-gost-mac(testbig.dat)= d3978b1a\n", "GOST MAC - big data"); +is(`openssl dgst -engine ${engine} -mac gost-mac-12 -macopt key:${key} testdata.dat`, +"GOST-MAC-12-gost-mac-12(testdata.dat)= be4453ec\n", +"GOST MAC - parameters 2012"); + unlink('testdata.dat'); unlink('testbig.dat'); -- 2.39.2