diff --git a/openssl-1.0.2-Backport-GOST-2015-identificators-and-GOST-OIDs-for-.patch b/openssl-1.0.2-Backport-GOST-2015-identificators-and-GOST-OIDs-for-.patch new file mode 100644 index 0000000..3871028 --- /dev/null +++ b/openssl-1.0.2-Backport-GOST-2015-identificators-and-GOST-OIDs-for-.patch @@ -0,0 +1,379 @@ +From dcca4a0281beea3deb5523b94f011a236e5b7a0d Mon Sep 17 00:00:00 2001 +From: Mikhail Novosyolov +Date: Sat, 28 Dec 2019 19:28:09 +0300 +Subject: [PATCH] Backport GOST 2015 identificators and GOST OIDs for Edwards + parameter sets + +Backport of upstream commits to openssl-1.0.2t: +* 3b5e5172007d5eb30cec4269a0f763c9632afd06 "Add GOST OIDs for Edwards parameter sets" by Sergey Zhuravlev +* 55fc247a699be33153f27c06d304e6e60eeff980 "New GOST identificators" by Dmitry Belyavskiy + +Signed-off-by: Mikhail Novosyolov +--- + crypto/objects/obj_dat.h | 113 +++++++++++++++++++++++++++++++++++-- + crypto/objects/obj_mac.h | 93 ++++++++++++++++++++++++++++++ + crypto/objects/obj_mac.num | 23 ++++++++ + crypto/objects/objects.txt | 26 +++++++++ + 4 files changed, 250 insertions(+), 5 deletions(-) + +diff --git a/crypto/objects/obj_dat.h b/crypto/objects/obj_dat.h +index 641cd8e9d2..521a843ae6 100644 +--- a/crypto/objects/obj_dat.h ++++ b/crypto/objects/obj_dat.h +@@ -62,12 +62,12 @@ + * [including the GNU Public Licence.] + */ + +-#define NUM_NID 1000 +-#define NUM_SN 993 +-#define NUM_LN 993 +-#define NUM_OBJ 921 ++#define NUM_NID 1023 ++#define NUM_SN 1016 ++#define NUM_LN 1016 ++#define NUM_OBJ 938 + +-static const unsigned char lvalues[6485]={ ++static const unsigned char lvalues[6631]={ + 0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 0] OBJ_rsadsi */ + 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 6] OBJ_pkcs */ + 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02, /* [ 13] OBJ_md2 */ +@@ -983,6 +983,23 @@ static const unsigned char lvalues[6485]={ + 0x2A,0x85,0x03,0x03,0x81,0x03,0x01,0x01, /* [6466] OBJ_INN */ + 0x2A,0x85,0x03,0x64,0x01, /* [6474] OBJ_OGRN */ + 0x2A,0x85,0x03,0x64,0x03, /* [6479] OBJ_SNILS */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x01, /* [ 7625] OBJ_id_tc26_cipher_gostr3412_2015_magma */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x01,0x01, /* [ 7633] OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x01,0x02, /* [ 7642] OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x02, /* [ 7651] OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x02,0x01, /* [ 7659] OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x05,0x02,0x02, /* [ 7668] OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x07, /* [ 7677] OBJ_id_tc26_wrap */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x01, /* [ 7684] OBJ_id_tc26_wrap_gostr3412_2015_magma */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x01,0x01, /* [ 7692] OBJ_id_tc26_wrap_gostr3412_2015_magma_kexp15 */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x02, /* [ 7701] OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik */ ++0x2A,0x85,0x03,0x07,0x01,0x01,0x07,0x01,0x01, /* [ 7709] OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 */ ++0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x02, /* [ 7718] OBJ_id_tc26_gost_3410_2012_256_paramSetB */ ++0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x03, /* [ 7727] OBJ_id_tc26_gost_3410_2012_256_paramSetC */ ++0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x04, /* [ 7736] OBJ_id_tc26_gost_3410_2012_256_paramSetD */ ++0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01, /* [ 7341] OBJ_id_tc26_gost_3410_2012_256_constants */ ++0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x01,0x01, /* [ 7349] OBJ_id_tc26_gost_3410_2012_256_paramSetA */ ++0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x03, /* [ 7358] OBJ_id_tc26_gost_3410_2012_512_paramSetC */ + }; + + static const ASN1_OBJECT nid_objs[NUM_NID]={ +@@ -2620,6 +2637,29 @@ static const ASN1_OBJECT nid_objs[NUM_NID]={ + {"grasshopper-cbc","grasshopper-cbc",NID_grasshopper_cbc,0,NULL,0}, + {"grasshopper-cfb","grasshopper-cfb",NID_grasshopper_cfb,0,NULL,0}, + {"grasshopper-mac","grasshopper-mac",NID_grasshopper_mac,0,NULL,0}, ++{"id-tc26-cipher-gostr3412-2015-magma", "id-tc26-cipher-gostr3412-2015-magma", NID_id_tc26_cipher_gostr3412_2015_magma, 8, &so[7625]}, ++{"id-tc26-cipher-gostr3412-2015-magma-ctracpkm", "id-tc26-cipher-gostr3412-2015-magma-ctracpkm", NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm, 9, &so[7633]}, ++{"id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac", "id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac", NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac, 9, &so[7642]}, ++{"id-tc26-cipher-gostr3412-2015-kuznyechik", "id-tc26-cipher-gostr3412-2015-kuznyechik", NID_id_tc26_cipher_gostr3412_2015_kuznyechik, 8, &so[7651]}, ++{"id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm", "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm", NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm, 9, &so[7659]}, ++{"id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac", "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac", NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac, 9, &so[7668]}, ++{"id-tc26-wrap", "id-tc26-wrap", NID_id_tc26_wrap, 7, &so[7677]}, ++{"id-tc26-wrap-gostr3412-2015-magma", "id-tc26-wrap-gostr3412-2015-magma", NID_id_tc26_wrap_gostr3412_2015_magma, 8, &so[7684]}, ++{"id-tc26-wrap-gostr3412-2015-magma-kexp15", "id-tc26-wrap-gostr3412-2015-magma-kexp15", NID_id_tc26_wrap_gostr3412_2015_magma_kexp15, 9, &so[7692]}, ++{"id-tc26-wrap-gostr3412-2015-kuznyechik", "id-tc26-wrap-gostr3412-2015-kuznyechik", NID_id_tc26_wrap_gostr3412_2015_kuznyechik, 8, &so[7701]}, ++{"id-tc26-wrap-gostr3412-2015-kuznyechik-kexp15", "id-tc26-wrap-gostr3412-2015-kuznyechik-kexp15", NID_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15, 9, &so[7709]}, ++{"id-tc26-gost-3410-2012-512-paramSetC", "GOST R 34.10-2012 (512 bit) ParamSet C", NID_id_tc26_gost_3410_2012_512_paramSetC, 9, &so[7358]}, ++{"id-tc26-gost-3410-2012-256-constants", "id-tc26-gost-3410-2012-256-constants", NID_id_tc26_gost_3410_2012_256_constants, 8, &so[7341]}, ++{"id-tc26-gost-3410-2012-256-paramSetA", "GOST R 34.10-2012 (256 bit) ParamSet A", NID_id_tc26_gost_3410_2012_256_paramSetA, 9, &so[7349]}, ++{"id-tc26-gost-3410-2012-256-paramSetB", "GOST R 34.10-2012 (256 bit) ParamSet B", NID_id_tc26_gost_3410_2012_256_paramSetB, 9, &so[7718]}, ++{"id-tc26-gost-3410-2012-256-paramSetC", "GOST R 34.10-2012 (256 bit) ParamSet C", NID_id_tc26_gost_3410_2012_256_paramSetC, 9, &so[7727]}, ++{"id-tc26-gost-3410-2012-256-paramSetD", "GOST R 34.10-2012 (256 bit) ParamSet D", NID_id_tc26_gost_3410_2012_256_paramSetD, 9, &so[7736]}, ++{"magma-ecb", "magma-ecb", NID_magma_ecb}, ++{"magma-ctr", "magma-ctr", NID_magma_ctr}, ++{"magma-ofb", "magma-ofb", NID_magma_ofb}, ++{"magma-cbc", "magma-cbc", NID_magma_cbc}, ++{"magma-cfb", "magma-cfb", NID_magma_cfb}, ++{"magma-mac", "magma-mac", NID_magma_mac}, + }; + + static const unsigned int sn_objs[NUM_SN]={ +@@ -3616,6 +3656,29 @@ static const unsigned int sn_objs[NUM_SN]={ + 503, /* "x500UniqueIdentifier" */ + 158, /* "x509Certificate" */ + 160, /* "x509Crl" */ ++1147, /* "id-tc26-gost-3410-2012-256-constants" */ ++1148, /* "id-tc26-gost-3410-2012-256-paramSetA" */ ++1149, /* "id-tc26-gost-3410-2012-512-paramSetC" */ ++1176, /* "id-tc26-cipher-gostr3412-2015-kuznyechik" */ ++1177, /* "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm" */ ++1178, /* "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac" */ ++1173, /* "id-tc26-cipher-gostr3412-2015-magma" */ ++1174, /* "id-tc26-cipher-gostr3412-2015-magma-ctracpkm" */ ++1175, /* "id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac" */ ++1184, /* "id-tc26-gost-3410-2012-256-paramSetB" */ ++1185, /* "id-tc26-gost-3410-2012-256-paramSetC" */ ++1186, /* "id-tc26-gost-3410-2012-256-paramSetD" */ ++1179, /* "id-tc26-wrap" */ ++1182, /* "id-tc26-wrap-gostr3412-2015-kuznyechik" */ ++1183, /* "id-tc26-wrap-gostr3412-2015-kuznyechik-kexp15" */ ++1180, /* "id-tc26-wrap-gostr3412-2015-magma" */ ++1181, /* "id-tc26-wrap-gostr3412-2015-magma-kexp15" */ ++1190, /* "magma-cbc" */ ++1191, /* "magma-cfb" */ ++1188, /* "magma-ctr" */ ++1187, /* "magma-ecb" */ ++1192, /* "magma-mac" */ ++1189, /* "magma-ofb" */ + }; + + static const unsigned int ln_objs[NUM_LN]={ +@@ -4612,6 +4675,29 @@ static const unsigned int ln_objs[NUM_LN]={ + 158, /* "x509Certificate" */ + 160, /* "x509Crl" */ + 125, /* "zlib compression" */ ++1147, /* "id-tc26-gost-3410-2012-256-constants" */ ++1148, /* "id-tc26-gost-3410-2012-256-paramSetA" */ ++1149, /* "id-tc26-gost-3410-2012-512-paramSetC" */ ++1176, /* "id-tc26-cipher-gostr3412-2015-kuznyechik" */ ++1177, /* "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm" */ ++1178, /* "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac" */ ++1173, /* "id-tc26-cipher-gostr3412-2015-magma" */ ++1174, /* "id-tc26-cipher-gostr3412-2015-magma-ctracpkm" */ ++1175, /* "id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac" */ ++1184, /* "id-tc26-gost-3410-2012-256-paramSetB" */ ++1185, /* "id-tc26-gost-3410-2012-256-paramSetC" */ ++1186, /* "id-tc26-gost-3410-2012-256-paramSetD" */ ++1179, /* "id-tc26-wrap" */ ++1182, /* "id-tc26-wrap-gostr3412-2015-kuznyechik" */ ++1183, /* "id-tc26-wrap-gostr3412-2015-kuznyechik-kexp15" */ ++1180, /* "id-tc26-wrap-gostr3412-2015-magma" */ ++1181, /* "id-tc26-wrap-gostr3412-2015-magma-kexp15" */ ++1190, /* "magma-cbc" */ ++1191, /* "magma-cfb" */ ++1188, /* "magma-ctr" */ ++1187, /* "magma-ecb" */ ++1192, /* "magma-mac" */ ++1189, /* "magma-ofb" */ + }; + + static const unsigned int obj_objs[NUM_OBJ]={ +@@ -5536,5 +5622,22 @@ static const unsigned int obj_objs[NUM_OBJ]={ + 955, /* OBJ_jurisdictionLocalityName 1 3 6 1 4 1 311 60 2 1 1 */ + 956, /* OBJ_jurisdictionStateOrProvinceName 1 3 6 1 4 1 311 60 2 1 2 */ + 957, /* OBJ_jurisdictionCountryName 1 3 6 1 4 1 311 60 2 1 3 */ ++1179, /* OBJ_id_tc26_wrap 1 2 643 7 1 1 7 */ ++1173, /* OBJ_id_tc26_cipher_gostr3412_2015_magma 1 2 643 7 1 1 5 1 */ ++1176, /* OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik 1 2 643 7 1 1 5 2 */ ++1180, /* OBJ_id_tc26_wrap_gostr3412_2015_magma 1 2 643 7 1 1 7 1 */ ++1182, /* OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik 1 2 643 7 1 1 7 2 */ ++1174, /* OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm 1 2 643 7 1 1 5 1 1 */ ++1175, /* OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac 1 2 643 7 1 1 5 1 2 */ ++1177, /* OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm 1 2 643 7 1 1 5 2 1 */ ++1178, /* OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac 1 2 643 7 1 1 5 2 2 */ ++1181, /* OBJ_id_tc26_wrap_gostr3412_2015_magma_kexp15 1 2 643 7 1 1 7 1 1 */ ++1183, /* OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 1 2 643 7 1 1 7 1 1 */ ++1184, /* OBJ_id_tc26_gost_3410_2012_256_paramSetB 1 2 643 7 1 2 1 1 2 */ ++1185, /* OBJ_id_tc26_gost_3410_2012_256_paramSetC 1 2 643 7 1 2 1 1 3 */ ++1186, /* OBJ_id_tc26_gost_3410_2012_256_paramSetD 1 2 643 7 1 2 1 1 4 */ ++1147, /* OBJ_id_tc26_gost_3410_2012_256_constants 1 2 643 7 1 2 1 1 */ ++1148, /* OBJ_id_tc26_gost_3410_2012_256_paramSetA 1 2 643 7 1 2 1 1 1 */ ++1149, /* OBJ_id_tc26_gost_3410_2012_512_paramSetC 1 2 643 7 1 2 1 2 3 */ + }; + +diff --git a/crypto/objects/obj_mac.h b/crypto/objects/obj_mac.h +index 430e14a244..a871bb0c7e 100644 +--- a/crypto/objects/obj_mac.h ++++ b/crypto/objects/obj_mac.h +@@ -4364,3 +4364,96 @@ + #define LN_jurisdictionCountryName "jurisdictionCountryName" + #define NID_jurisdictionCountryName 957 + #define OBJ_jurisdictionCountryName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,3L ++ ++ ++#define SN_id_tc26_cipher_gostr3412_2015_magma "id-tc26-cipher-gostr3412-2015-magma" ++#define NID_id_tc26_cipher_gostr3412_2015_magma 1173 ++#define OBJ_id_tc26_cipher_gostr3412_2015_magma OBJ_id_tc26_cipher,1L ++ ++#define SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm "id-tc26-cipher-gostr3412-2015-magma-ctracpkm" ++#define NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm 1174 ++#define OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm OBJ_id_tc26_cipher_gostr3412_2015_magma,1L ++ ++#define SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac "id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac" ++#define NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac 1175 ++#define OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac OBJ_id_tc26_cipher_gostr3412_2015_magma,2L ++ ++#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik "id-tc26-cipher-gostr3412-2015-kuznyechik" ++#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik 1176 ++#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik OBJ_id_tc26_cipher,2L ++ ++#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm" ++#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm 1177 ++#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik,1L ++ ++#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac "id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac" ++#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac 1178 ++#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik,2L ++ ++#define SN_id_tc26_wrap "id-tc26-wrap" ++#define NID_id_tc26_wrap 1179 ++#define OBJ_id_tc26_wrap OBJ_id_tc26_algorithms,7L ++ ++#define SN_id_tc26_wrap_gostr3412_2015_magma "id-tc26-wrap-gostr3412-2015-magma" ++#define NID_id_tc26_wrap_gostr3412_2015_magma 1180 ++#define OBJ_id_tc26_wrap_gostr3412_2015_magma OBJ_id_tc26_wrap,1L ++ ++#define SN_id_tc26_wrap_gostr3412_2015_magma_kexp15 "id-tc26-wrap-gostr3412-2015-magma-kexp15" ++#define NID_id_tc26_wrap_gostr3412_2015_magma_kexp15 1181 ++#define OBJ_id_tc26_wrap_gostr3412_2015_magma_kexp15 OBJ_id_tc26_wrap_gostr3412_2015_magma,1L ++ ++#define SN_id_tc26_wrap_gostr3412_2015_kuznyechik "id-tc26-wrap-gostr3412-2015-kuznyechik" ++#define NID_id_tc26_wrap_gostr3412_2015_kuznyechik 1182 ++#define OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik OBJ_id_tc26_wrap,2L ++ ++#define SN_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 "id-tc26-wrap-gostr3412-2015-kuznyechik-kexp15" ++#define NID_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 1183 ++#define OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 OBJ_id_tc26_wrap_gostr3412_2015_magma,1L ++ ++#define SN_id_tc26_gost_3410_2012_256_paramSetB "id-tc26-gost-3410-2012-256-paramSetB" ++#define LN_id_tc26_gost_3410_2012_256_paramSetB "GOST R 34.10-2012 (256 bit) ParamSet B" ++#define NID_id_tc26_gost_3410_2012_256_paramSetB 1184 ++#define OBJ_id_tc26_gost_3410_2012_256_paramSetB OBJ_id_tc26_gost_3410_2012_256_constants,2L ++ ++#define SN_id_tc26_gost_3410_2012_256_paramSetC "id-tc26-gost-3410-2012-256-paramSetC" ++#define LN_id_tc26_gost_3410_2012_256_paramSetC "GOST R 34.10-2012 (256 bit) ParamSet C" ++#define NID_id_tc26_gost_3410_2012_256_paramSetC 1185 ++#define OBJ_id_tc26_gost_3410_2012_256_paramSetC OBJ_id_tc26_gost_3410_2012_256_constants,3L ++ ++#define SN_id_tc26_gost_3410_2012_256_paramSetD "id-tc26-gost-3410-2012-256-paramSetD" ++#define LN_id_tc26_gost_3410_2012_256_paramSetD "GOST R 34.10-2012 (256 bit) ParamSet D" ++#define NID_id_tc26_gost_3410_2012_256_paramSetD 1186 ++#define OBJ_id_tc26_gost_3410_2012_256_paramSetD OBJ_id_tc26_gost_3410_2012_256_constants,4L ++ ++#define SN_magma_ecb "magma-ecb" ++#define NID_magma_ecb 1187 ++ ++#define SN_magma_ctr "magma-ctr" ++#define NID_magma_ctr 1188 ++ ++#define SN_magma_ofb "magma-ofb" ++#define NID_magma_ofb 1189 ++ ++#define SN_magma_cbc "magma-cbc" ++#define NID_magma_cbc 1190 ++ ++#define SN_magma_cfb "magma-cfb" ++#define NID_magma_cfb 1191 ++ ++#define SN_magma_mac "magma-mac" ++#define NID_magma_mac 1192 ++ ++#define SN_id_tc26_gost_3410_2012_256_constants "id-tc26-gost-3410-2012-256-constants" ++#define LN_id_tc26_gost_3410_2012_256_constants "id-tc26-gost-3410-2012-256-constants" ++#define NID_id_tc26_gost_3410_2012_256_constants 1147 ++#define OBJ_id_tc26_gost_3410_2012_256_constants OBJ_id_tc26_sign_constants,1L ++ ++#define SN_id_tc26_gost_3410_2012_256_paramSetA "id-tc26-gost-3410-2012-256-paramSetA" ++#define LN_id_tc26_gost_3410_2012_256_paramSetA "GOST R 34.10-2012 (256 bit) ParamSet A" ++#define NID_id_tc26_gost_3410_2012_256_paramSetA 1148 ++#define OBJ_id_tc26_gost_3410_2012_256_paramSetA OBJ_id_tc26_gost_3410_2012_256_constants,1L ++ ++#define SN_id_tc26_gost_3410_2012_512_paramSetC "id-tc26-gost-3410-2012-512-paramSetC" ++#define LN_id_tc26_gost_3410_2012_512_paramSetC "GOST R 34.10-2012 (512 bit) ParamSet C" ++#define NID_id_tc26_gost_3410_2012_512_paramSetC 1149 ++#define OBJ_id_tc26_gost_3410_2012_512_paramSetC OBJ_id_tc26_gost_3410_2012_512_constants,3L +diff --git a/crypto/objects/obj_mac.num b/crypto/objects/obj_mac.num +index e5f2eaeb6e..3a5af05f6e 100644 +--- a/crypto/objects/obj_mac.num ++++ b/crypto/objects/obj_mac.num +@@ -977,10 +977,13 @@ id_tc26_agreement_gost_3410_2012_256 976 + id_tc26_agreement_gost_3410_2012_512 977 + id_tc26_constants 978 + id_tc26_sign_constants 979 ++id_tc26_gost_3410_2012_256_constants 1147 ++id_tc26_gost_3410_2012_256_paramSetA 1148 + id_tc26_gost_3410_2012_512_constants 980 + id_tc26_gost_3410_2012_512_paramSetTest 981 + id_tc26_gost_3410_2012_512_paramSetA 982 + id_tc26_gost_3410_2012_512_paramSetB 983 ++id_tc26_gost_3410_2012_512_paramSetC 1149 + id_tc26_digest_constants 984 + id_tc26_cipher_constants 985 + id_tc26_gost_28147_constants 986 +@@ -997,3 +1000,23 @@ grasshopper_ofb 996 + grasshopper_cbc 997 + grasshopper_cfb 998 + grasshopper_mac 999 ++id_tc26_cipher_gostr3412_2015_magma 1173 ++id_tc26_cipher_gostr3412_2015_magma_ctracpkm 1174 ++id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac 1175 ++id_tc26_cipher_gostr3412_2015_kuznyechik 1176 ++id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm 1177 ++id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac 1178 ++id_tc26_wrap 1179 ++id_tc26_wrap_gostr3412_2015_magma 1180 ++id_tc26_wrap_gostr3412_2015_magma_kexp15 1181 ++id_tc26_wrap_gostr3412_2015_kuznyechik 1182 ++id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 1183 ++id_tc26_gost_3410_2012_256_paramSetB 1184 ++id_tc26_gost_3410_2012_256_paramSetC 1185 ++id_tc26_gost_3410_2012_256_paramSetD 1186 ++magma_ecb 1187 ++magma_ctr 1188 ++magma_ofb 1189 ++magma_cbc 1190 ++magma_cfb 1191 ++magma_mac 1192 +diff --git a/crypto/objects/objects.txt b/crypto/objects/objects.txt +index 31286b176a..7b400c9842 100644 +--- a/crypto/objects/objects.txt ++++ b/crypto/objects/objects.txt +@@ -1259,18 +1259,36 @@ id-tc26-mac 1 : id-tc26-hmac-gost-3411-2012-256 : HMAC GOST 34.11-2012 256 bit + id-tc26-mac 2 : id-tc26-hmac-gost-3411-2012-512 : HMAC GOST 34.11-2012 512 bit + + id-tc26-algorithms 5 : id-tc26-cipher ++id-tc26-cipher 1 : id-tc26-cipher-gostr3412-2015-magma ++id-tc26-cipher-gostr3412-2015-magma 1 : id-tc26-cipher-gostr3412-2015-magma-ctracpkm ++id-tc26-cipher-gostr3412-2015-magma 2 : id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac ++id-tc26-cipher 2 : id-tc26-cipher-gostr3412-2015-kuznyechik ++id-tc26-cipher-gostr3412-2015-kuznyechik 1 : id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm ++id-tc26-cipher-gostr3412-2015-kuznyechik 2 : id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac + + id-tc26-algorithms 6 : id-tc26-agreement + id-tc26-agreement 1 : id-tc26-agreement-gost-3410-2012-256 + id-tc26-agreement 2 : id-tc26-agreement-gost-3410-2012-512 + ++id-tc26-algorithms 7 : id-tc26-wrap ++id-tc26-wrap 1 : id-tc26-wrap-gostr3412-2015-magma ++id-tc26-wrap-gostr3412-2015-magma 1 : id-tc26-wrap-gostr3412-2015-magma-kexp15 ++id-tc26-wrap 2 : id-tc26-wrap-gostr3412-2015-kuznyechik ++id-tc26-wrap-gostr3412-2015-magma 1 : id-tc26-wrap-gostr3412-2015-kuznyechik-kexp15 ++ + id-tc26 2 : id-tc26-constants + + id-tc26-constants 1 : id-tc26-sign-constants ++id-tc26-sign-constants 1: id-tc26-gost-3410-2012-256-constants + id-tc26-sign-constants 2: id-tc26-gost-3410-2012-512-constants ++id-tc26-gost-3410-2012-256-constants 1 : id-tc26-gost-3410-2012-256-paramSetA: GOST R 34.10-2012 (256 bit) ParamSet A ++id-tc26-gost-3410-2012-256-constants 2 : id-tc26-gost-3410-2012-256-paramSetB: GOST R 34.10-2012 (256 bit) ParamSet B ++id-tc26-gost-3410-2012-256-constants 3 : id-tc26-gost-3410-2012-256-paramSetC: GOST R 34.10-2012 (256 bit) ParamSet C ++id-tc26-gost-3410-2012-256-constants 4 : id-tc26-gost-3410-2012-256-paramSetD: GOST R 34.10-2012 (256 bit) ParamSet D + id-tc26-gost-3410-2012-512-constants 0 : id-tc26-gost-3410-2012-512-paramSetTest: GOST R 34.10-2012 (512 bit) testing parameter set + id-tc26-gost-3410-2012-512-constants 1 : id-tc26-gost-3410-2012-512-paramSetA: GOST R 34.10-2012 (512 bit) ParamSet A + id-tc26-gost-3410-2012-512-constants 2 : id-tc26-gost-3410-2012-512-paramSetB: GOST R 34.10-2012 (512 bit) ParamSet B ++id-tc26-gost-3410-2012-512-constants 3 : id-tc26-gost-3410-2012-512-paramSetC: GOST R 34.10-2012 (512 bit) ParamSet C + + id-tc26-constants 2 : id-tc26-digest-constants + id-tc26-constants 5 : id-tc26-cipher-constants +@@ -1289,6 +1307,14 @@ member-body 643 100 3 : SNILS : SNILS + : grasshopper-cfb + : grasshopper-mac + ++#GOST R34.13-2015 Magma ++ : magma-ecb ++ : magma-ctr ++ : magma-ofb ++ : magma-cbc ++ : magma-cfb ++ : magma-mac ++ + # Definitions for Camellia cipher - CBC MODE + + 1 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC : camellia-128-cbc +-- +2.20.1 + diff --git a/openssl.spec b/openssl.spec index 84abaff..185e1cc 100644 --- a/openssl.spec +++ b/openssl.spec @@ -28,7 +28,7 @@ Summary: Secure Sockets Layer communications libs & utils Name: openssl Version: %{openssl_ver}t -Release: 2 +Release: 4 License: BSD-like Group: System/Libraries Url: https://www.openssl.org @@ -42,6 +42,8 @@ Source6: openssl.macros # Based on https://github.com/gost-engine/engine # Never remove gost-engine patches Patch0: openssl-1.0.2l-gost-engine.patch +# Backport GOST 2015 identificators and GOST OIDs for Edwards parameter sets +Patch1: openssl-1.0.2-Backport-GOST-2015-identificators-and-GOST-OIDs-for-.patch # Handle RPM_OPT_FLAGS in Configure Patch2: openssl-1.0.2e-optflags.patch Patch3: openssl-1.0.1c-fix-perlpath.pl @@ -229,6 +231,7 @@ and protocols, including DES, RC4, RSA and SSL. %prep %setup -q %patch0 -p1 -b .gost +%patch1 -p1 %patch2 -p1 -b .optflags %patch3 -p1 -b .perl %patch6 -p1 -b .icpbrasil