From: Vitaly Chikunov Date: Mon, 21 Jan 2019 05:36:04 +0000 (+0300) Subject: ec_sign: map tc26-2012 256-bit parameters to cp-2001 parameters X-Git-Tag: v3.0.0~314^2~1 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=de2c22b5d162cbacccac7178dac649d24f8c5d98;p=openssl-gost%2Fengine.git ec_sign: map tc26-2012 256-bit parameters to cp-2001 parameters This will make at least signature verification work. --- diff --git a/gost_ec_sign.c b/gost_ec_sign.c index be6f9b1..ba12783 100644 --- a/gost_ec_sign.c +++ b/gost_ec_sign.c @@ -42,6 +42,18 @@ static R3410_ec_params *gost_nid2params(int nid) { R3410_ec_params *params; + /* Map tc26-2012 256-bit parameters to cp-2001 parameters */ + switch (nid) { + case NID_id_tc26_gost_3410_2012_256_paramSetB: + nid = NID_id_GostR3410_2001_CryptoPro_A_ParamSet; + break; + case NID_id_tc26_gost_3410_2012_256_paramSetC: + nid = NID_id_GostR3410_2001_CryptoPro_B_ParamSet; + break; + case NID_id_tc26_gost_3410_2012_256_paramSetD: + nid = NID_id_GostR3410_2001_CryptoPro_C_ParamSet; + } + /* Search nid in 2012 paramset */ params = R3410_2012_512_paramset; while (params->nid != NID_undef) {