]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
ec_sign: map tc26-2012 256-bit parameters to cp-2001 parameters
authorVitaly Chikunov <vt@altlinux.org>
Mon, 21 Jan 2019 05:36:04 +0000 (08:36 +0300)
committerVitaly Chikunov <vt@altlinux.org>
Mon, 21 Jan 2019 09:00:02 +0000 (12:00 +0300)
This will make at least signature verification work.

gost_ec_sign.c

index be6f9b17e8d703a82bb4419ed5c44951e9814504..ba12783959e36ec31b1ea1c98da1678c78ed30df 100644 (file)
@@ -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) {