]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Merge branch 'master' of https://github.com/gost-engine/engine
authorDmitry Belyavskiy <beldmit@gmail.com>
Thu, 12 Jul 2018 18:51:46 +0000 (21:51 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Thu, 12 Jul 2018 18:51:46 +0000 (21:51 +0300)
13 files changed:
.travis.yml [new file with mode: 0644]
patches/1.0.2/cipher_modes.diff [deleted file]
patches/1.0.2/numeric.diff [deleted file]
patches/1.0.2/oids.diff [deleted file]
patches/1.0.2/pkcs12.diff [deleted file]
patches/1.0.2/smimecap.diff [deleted file]
test/00-engine.t [new file with mode: 0644]
test/01-digest.t [new file with mode: 0644]
test/02-mac.t [new file with mode: 0644]
test/03-encrypt.t [new file with mode: 0644]
test/04-pkey.t [new file with mode: 0644]
test/Makefile.am [new file with mode: 0644]
test/run_tests [new file with mode: 0644]

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..b3d8ad1
--- /dev/null
@@ -0,0 +1,35 @@
+sudo: required
+dist: trusty
+
+os: linux
+
+language: c
+
+env:
+  global:
+    - PREFIX=${HOME}/opt
+    - LD_LIBRARY_PATH=${PREFIX}/lib
+    - PATH=${PREFIX}/bin:${PATH}
+    - OPENSSL_ENGINES=${TRAVIS_BUILD_DIR}/bin
+
+matrix:
+  include:
+    - env: OPENSSL_BRANCH=master
+      os: linux
+      compiler: gcc
+    - env: OPENSSL_BRANCH=OpenSSL_1_1_0-stable
+      os: linux
+      compiler: gcc
+#    - env: OPENSSL_BRANCH=OpenSSL_1_0_2-stable
+#      os: linux
+#      compiler: gcc
+
+before_script:
+  - git clone -b ${OPENSSL_BRANCH} https://github.com/openssl/openssl.git
+  - cd openssl
+  - ./config shared --prefix=${PREFIX} --openssldir=${PREFIX} && make all install_sw > build.log 2>&1 || (cat build.log && exit 1)
+  - cd ..
+
+script:
+  - cmake -DOPENSSL_ROOT_DIR=${PREFIX} -DOPENSSL_LIBRARIES=${PREFIX}/lib && make
+  - prove -v test/{00-engine.t,01-digest.t,02-mac.t,03-encrypt.t}
diff --git a/patches/1.0.2/cipher_modes.diff b/patches/1.0.2/cipher_modes.diff
deleted file mode 100644 (file)
index 2a2ab13..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-diff -uNr crypto/objects_orig/obj_dat.h crypto/objects/obj_dat.h
---- crypto/objects_orig/obj_dat.h      2015-10-06 20:43:14.000000000 +0300
-+++ crypto/objects/obj_dat.h   2015-10-06 20:45:53.000000000 +0300
-@@ -62,9 +62,9 @@
-  * [including the GNU Public Licence.]
-  */
--#define NUM_NID 991
--#define NUM_SN 984
--#define NUM_LN 984
-+#define NUM_NID 1000
-+#define NUM_SN 993
-+#define NUM_LN 993
- #define NUM_OBJ 921
- static const unsigned char lvalues[6485]={
-@@ -2611,6 +2611,15 @@
- {"INN","INN",NID_INN,8,&(lvalues[6466]),0},
- {"OGRN","OGRN",NID_OGRN,5,&(lvalues[6474]),0},
- {"SNILS","SNILS",NID_SNILS,5,&(lvalues[6479]),0},
-+{"gost89-cbc","gost89-cbc",NID_gost89_cbc,0,NULL,0},
-+{"gost89-ecb","gost89-ecb",NID_gost89_ecb,0,NULL,0},
-+{"gost89-ctr","gost89-ctr",NID_gost89_ctr,0,NULL,0},
-+{"grasshopper-ecb","grasshopper-ecb",NID_grasshopper_ecb,0,NULL,0},
-+{"grasshopper-ctr","grasshopper-ctr",NID_grasshopper_ctr,0,NULL,0},
-+{"grasshopper-ofb","grasshopper-ofb",NID_grasshopper_ofb,0,NULL,0},
-+{"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},
- };
- static const unsigned int sn_objs[NUM_SN]={
-@@ -2964,10 +2973,19 @@
- 963,  /* "gost2012_256" */
- 964,  /* "gost2012_512" */
- 813,  /* "gost89" */
-+991,  /* "gost89-cbc" */
- 814,  /* "gost89-cnt" */
- 959,  /* "gost89-cnt-12" */
-+993,  /* "gost89-ctr" */
-+992,  /* "gost89-ecb" */
- 812,  /* "gost94" */
- 850,  /* "gost94cc" */
-+997,  /* "grasshopper-cbc" */
-+998,  /* "grasshopper-cfb" */
-+995,  /* "grasshopper-ctr" */
-+994,  /* "grasshopper-ecb" */
-+999,  /* "grasshopper-mac" */
-+996,  /* "grasshopper-ofb" */
- 797,  /* "hmacWithMD5" */
- 163,  /* "hmacWithSHA1" */
- 798,  /* "hmacWithSHA224" */
-@@ -3971,8 +3989,17 @@
- 601,  /* "generic cryptogram" */
- 99,   /* "givenName" */
- 960,  /* "gost-mac-12" */
-+991,  /* "gost89-cbc" */
- 814,  /* "gost89-cnt" */
- 959,  /* "gost89-cnt-12" */
-+993,  /* "gost89-ctr" */
-+992,  /* "gost89-ecb" */
-+997,  /* "grasshopper-cbc" */
-+998,  /* "grasshopper-cfb" */
-+995,  /* "grasshopper-ctr" */
-+994,  /* "grasshopper-ecb" */
-+999,  /* "grasshopper-mac" */
-+996,  /* "grasshopper-ofb" */
- 855,  /* "hmac" */
- 780,  /* "hmac-md5" */
- 781,  /* "hmac-sha1" */
-diff -uNr crypto/objects_orig/objects.txt crypto/objects/objects.txt
---- crypto/objects_orig/objects.txt    2015-10-06 20:43:14.000000000 +0300
-+++ crypto/objects/objects.txt 2015-10-06 20:45:45.000000000 +0300
-@@ -1171,6 +1171,9 @@
- cryptopro 21          : gost89                : GOST 28147-89
-                       : gost89-cnt
-                       : gost89-cnt-12
-+                      : gost89-cbc
-+                      : gost89-ecb
-+                      : gost89-ctr
- !Cname id-Gost28147-89-MAC
- cryptopro 22          : gost-mac      : GOST 28147-89 MAC
-                       : gost-mac-12
-@@ -1278,6 +1281,14 @@
- member-body 643 100 1         : OGRN  : OGRN
- member-body 643 100 3         : SNILS : SNILS
-+#GOST R34.13-2015 Grasshopper "Kuznechik"
-+                      : grasshopper-ecb
-+                      : grasshopper-ctr
-+                      : grasshopper-ofb
-+                      : grasshopper-cbc
-+                      : grasshopper-cfb
-+                      : grasshopper-mac
-+
- # Definitions for Camellia cipher - CBC MODE
- 1 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC          : camellia-128-cbc
-diff -uNr crypto/objects_orig/obj_mac.h crypto/objects/obj_mac.h
---- crypto/objects_orig/obj_mac.h      2015-10-06 20:43:14.000000000 +0300
-+++ crypto/objects/obj_mac.h   2015-10-06 20:45:52.000000000 +0300
-@@ -3723,6 +3723,15 @@
- #define SN_gost89_cnt_12                "gost89-cnt-12"
- #define NID_gost89_cnt_12               959
-+#define SN_gost89_cbc           "gost89-cbc"
-+#define NID_gost89_cbc          991
-+
-+#define SN_gost89_ecb           "gost89-ecb"
-+#define NID_gost89_ecb          992
-+
-+#define SN_gost89_ctr           "gost89-ctr"
-+#define NID_gost89_ctr          993
-+
- #define SN_id_Gost28147_89_MAC          "gost-mac"
- #define LN_id_Gost28147_89_MAC          "GOST 28147-89 MAC"
- #define NID_id_Gost28147_89_MAC         815
-@@ -4031,6 +4040,24 @@
- #define NID_SNILS               990
- #define OBJ_SNILS               OBJ_member_body,643L,100L,3L
-+#define SN_grasshopper_ecb              "grasshopper-ecb"
-+#define NID_grasshopper_ecb             994
-+
-+#define SN_grasshopper_ctr              "grasshopper-ctr"
-+#define NID_grasshopper_ctr             995
-+
-+#define SN_grasshopper_ofb              "grasshopper-ofb"
-+#define NID_grasshopper_ofb             996
-+
-+#define SN_grasshopper_cbc              "grasshopper-cbc"
-+#define NID_grasshopper_cbc             997
-+
-+#define SN_grasshopper_cfb              "grasshopper-cfb"
-+#define NID_grasshopper_cfb             998
-+
-+#define SN_grasshopper_mac              "grasshopper-mac"
-+#define NID_grasshopper_mac             999
-+
- #define SN_camellia_128_cbc             "CAMELLIA-128-CBC"
- #define LN_camellia_128_cbc             "camellia-128-cbc"
- #define NID_camellia_128_cbc            751
-diff -uNr crypto/objects_orig/obj_mac.num crypto/objects/obj_mac.num
---- crypto/objects_orig/obj_mac.num    2015-10-06 20:43:14.000000000 +0300
-+++ crypto/objects/obj_mac.num 2015-10-06 20:45:51.000000000 +0300
-@@ -988,3 +988,12 @@
- INN           988
- OGRN          989
- SNILS         990
-+gost89_cbc            991
-+gost89_ecb            992
-+gost89_ctr            993
-+grasshopper_ecb               994
-+grasshopper_ctr               995
-+grasshopper_ofb               996
-+grasshopper_cbc               997
-+grasshopper_cfb               998
-+grasshopper_mac               999
diff --git a/patches/1.0.2/numeric.diff b/patches/1.0.2/numeric.diff
deleted file mode 100644 (file)
index 8c47d9d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -Nuar openssl-1.0.2d/crypto/asn1/a_mbstr.c openssl-work/crypto/asn1/a_mbstr.c
---- openssl-1.0.2d/crypto/asn1/a_mbstr.c       2015-07-09 15:53:21.000000000 +0400
-+++ openssl-work/crypto/asn1/a_mbstr.c 2015-03-26 13:00:21.000000000 +0400
-@@ -173,6 +173,8 @@
-         str_type = V_ASN1_PRINTABLESTRING;
-     else if (mask & B_ASN1_IA5STRING)
-         str_type = V_ASN1_IA5STRING;
-+    else if (mask & B_ASN1_NUMERICSTRING)
-+        str_type = V_ASN1_NUMERICSTRING;
-     else if (mask & B_ASN1_T61STRING)
-         str_type = V_ASN1_T61STRING;
-     else if (mask & B_ASN1_BMPSTRING) {
-diff -Nuar openssl-1.0.2d/crypto/asn1/a_strnid.c openssl-work/crypto/asn1/a_strnid.c
---- openssl-1.0.2d/crypto/asn1/a_strnid.c      2015-07-09 15:53:21.000000000 +0400
-+++ openssl-work/crypto/asn1/a_strnid.c        2015-03-26 13:00:21.000000000 +0400
-@@ -192,7 +192,10 @@
-     {NID_name, 1, ub_name, DIRSTRING_TYPE, 0},
-     {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
-     {NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK},
--    {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}
-+    {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
-+    {NID_INN, 1, 12, B_ASN1_NUMERICSTRING, STABLE_NO_MASK},
-+    {NID_OGRN, 1, 13, B_ASN1_NUMERICSTRING, STABLE_NO_MASK},
-+    {NID_SNILS, 1, 11, B_ASN1_NUMERICSTRING, STABLE_NO_MASK}
- };
- static int sk_table_cmp(const ASN1_STRING_TABLE *const *a,
-
diff --git a/patches/1.0.2/oids.diff b/patches/1.0.2/oids.diff
deleted file mode 100644 (file)
index faa66fb..0000000
+++ /dev/null
@@ -1,688 +0,0 @@
-diff -Nuar openssl-1.0.2d/crypto/objects/obj_dat.h openssl-work/crypto/objects/obj_dat.h
---- openssl-1.0.2d/crypto/objects/obj_dat.h    2015-07-09 15:58:05.000000000 +0400
-+++ openssl-work/crypto/objects/obj_dat.h      2015-02-25 12:49:45.000000000 +0400
-@@ -62,12 +62,12 @@
-  * [including the GNU Public Licence.]
-  */
--#define NUM_NID 958
--#define NUM_SN 951
--#define NUM_LN 951
--#define NUM_OBJ 890
-+#define NUM_NID 991
-+#define NUM_SN 984
-+#define NUM_LN 984
-+#define NUM_OBJ 921
--static const unsigned char lvalues[6255]={
-+static const unsigned char lvalues[6485]={
- 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 */
-@@ -952,6 +952,37 @@
- 0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x01,/* [6221] OBJ_jurisdictionLocalityName */
- 0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x02,/* [6232] OBJ_jurisdictionStateOrProvinceName */
- 0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x03,/* [6243] OBJ_jurisdictionCountryName */
-+0x2A,0x85,0x03,0x07,0x01,                    /* [6254] OBJ_id_tc26 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,               /* [6259] OBJ_id_tc26_algorithms */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x01,          /* [6265] OBJ_id_tc26_sign */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x01,0x01,     /* [6272] OBJ_id_GostR3410_2012_256 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x01,0x02,     /* [6280] OBJ_id_GostR3410_2012_512 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x02,          /* [6288] OBJ_id_tc26_digest */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x02,0x02,     /* [6295] OBJ_id_GostR3411_2012_256 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x02,0x03,     /* [6303] OBJ_id_GostR3411_2012_512 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x03,          /* [6311] OBJ_id_tc26_signwithdigest */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x03,0x02,     /* [6318] OBJ_id_tc26_signwithdigest_gost3410_2012_256 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x03,0x03,     /* [6326] OBJ_id_tc26_signwithdigest_gost3410_2012_512 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x04,          /* [6334] OBJ_id_tc26_mac */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x04,0x01,     /* [6341] OBJ_id_tc26_hmac_gost_3411_2012_256 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x04,0x02,     /* [6349] OBJ_id_tc26_hmac_gost_3411_2012_512 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x05,          /* [6357] OBJ_id_tc26_cipher */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x06,          /* [6364] OBJ_id_tc26_agreement */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x06,0x01,     /* [6371] OBJ_id_tc26_agreement_gost_3410_2012_256 */
-+0x2A,0x85,0x03,0x07,0x01,0x01,0x06,0x02,     /* [6379] OBJ_id_tc26_agreement_gost_3410_2012_512 */
-+0x2A,0x85,0x03,0x07,0x01,0x02,               /* [6387] OBJ_id_tc26_constants */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x01,          /* [6393] OBJ_id_tc26_sign_constants */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,     /* [6400] OBJ_id_tc26_gost_3410_2012_512_constants */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x00,/* [6408] OBJ_id_tc26_gost_3410_2012_512_paramSetTest */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x01,/* [6417] OBJ_id_tc26_gost_3410_2012_512_paramSetA */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x01,0x02,0x02,/* [6426] OBJ_id_tc26_gost_3410_2012_512_paramSetB */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x02,          /* [6435] OBJ_id_tc26_digest_constants */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x05,          /* [6442] OBJ_id_tc26_cipher_constants */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x05,0x01,     /* [6449] OBJ_id_tc26_gost_28147_constants */
-+0x2A,0x85,0x03,0x07,0x01,0x02,0x05,0x01,0x01,/* [6457] OBJ_id_tc26_gost_28147_param_Z */
-+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 */
- };
- static const ASN1_OBJECT nid_objs[NUM_NID]={
-@@ -2514,6 +2545,72 @@
-       NID_jurisdictionStateOrProvinceName,11,&(lvalues[6232]),0},
- {"jurisdictionC","jurisdictionCountryName",
-       NID_jurisdictionCountryName,11,&(lvalues[6243]),0},
-+{"id-tc26","id-tc26",NID_id_tc26,5,&(lvalues[6254]),0},
-+{"gost89-cnt-12","gost89-cnt-12",NID_gost89_cnt_12,0,NULL,0},
-+{"gost-mac-12","gost-mac-12",NID_gost_mac_12,0,NULL,0},
-+{"id-tc26-algorithms","id-tc26-algorithms",NID_id_tc26_algorithms,6,
-+      &(lvalues[6259]),0},
-+{"id-tc26-sign","id-tc26-sign",NID_id_tc26_sign,7,&(lvalues[6265]),0},
-+{"gost2012_256","GOST R 34.10-2012 with 256 bit modulus",
-+      NID_id_GostR3410_2012_256,8,&(lvalues[6272]),0},
-+{"gost2012_512","GOST R 34.10-2012 with 512 bit modulus",
-+      NID_id_GostR3410_2012_512,8,&(lvalues[6280]),0},
-+{"id-tc26-digest","id-tc26-digest",NID_id_tc26_digest,7,
-+      &(lvalues[6288]),0},
-+{"md_gost12_256","GOST R 34.11-2012 with 256 bit hash",
-+      NID_id_GostR3411_2012_256,8,&(lvalues[6295]),0},
-+{"md_gost12_512","GOST R 34.11-2012 with 512 bit hash",
-+      NID_id_GostR3411_2012_512,8,&(lvalues[6303]),0},
-+{"id-tc26-signwithdigest","id-tc26-signwithdigest",
-+      NID_id_tc26_signwithdigest,7,&(lvalues[6311]),0},
-+{"id-tc26-signwithdigest-gost3410-2012-256",
-+      "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)",
-+      NID_id_tc26_signwithdigest_gost3410_2012_256,8,&(lvalues[6318]),0},
-+{"id-tc26-signwithdigest-gost3410-2012-512",
-+      "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)",
-+      NID_id_tc26_signwithdigest_gost3410_2012_512,8,&(lvalues[6326]),0},
-+{"id-tc26-mac","id-tc26-mac",NID_id_tc26_mac,7,&(lvalues[6334]),0},
-+{"id-tc26-hmac-gost-3411-2012-256","HMAC GOST 34.11-2012 256 bit",
-+      NID_id_tc26_hmac_gost_3411_2012_256,8,&(lvalues[6341]),0},
-+{"id-tc26-hmac-gost-3411-2012-512","HMAC GOST 34.11-2012 512 bit",
-+      NID_id_tc26_hmac_gost_3411_2012_512,8,&(lvalues[6349]),0},
-+{"id-tc26-cipher","id-tc26-cipher",NID_id_tc26_cipher,7,
-+      &(lvalues[6357]),0},
-+{"id-tc26-agreement","id-tc26-agreement",NID_id_tc26_agreement,7,
-+      &(lvalues[6364]),0},
-+{"id-tc26-agreement-gost-3410-2012-256",
-+      "id-tc26-agreement-gost-3410-2012-256",
-+      NID_id_tc26_agreement_gost_3410_2012_256,8,&(lvalues[6371]),0},
-+{"id-tc26-agreement-gost-3410-2012-512",
-+      "id-tc26-agreement-gost-3410-2012-512",
-+      NID_id_tc26_agreement_gost_3410_2012_512,8,&(lvalues[6379]),0},
-+{"id-tc26-constants","id-tc26-constants",NID_id_tc26_constants,6,
-+      &(lvalues[6387]),0},
-+{"id-tc26-sign-constants","id-tc26-sign-constants",
-+      NID_id_tc26_sign_constants,7,&(lvalues[6393]),0},
-+{"id-tc26-gost-3410-2012-512-constants",
-+      "id-tc26-gost-3410-2012-512-constants",
-+      NID_id_tc26_gost_3410_2012_512_constants,8,&(lvalues[6400]),0},
-+{"id-tc26-gost-3410-2012-512-paramSetTest",
-+      "GOST R 34.10-2012 (512 bit) testing parameter set",
-+      NID_id_tc26_gost_3410_2012_512_paramSetTest,9,&(lvalues[6408]),0},
-+{"id-tc26-gost-3410-2012-512-paramSetA",
-+      "GOST R 34.10-2012 (512 bit) ParamSet A",
-+      NID_id_tc26_gost_3410_2012_512_paramSetA,9,&(lvalues[6417]),0},
-+{"id-tc26-gost-3410-2012-512-paramSetB",
-+      "GOST R 34.10-2012 (512 bit) ParamSet B",
-+      NID_id_tc26_gost_3410_2012_512_paramSetB,9,&(lvalues[6426]),0},
-+{"id-tc26-digest-constants","id-tc26-digest-constants",
-+      NID_id_tc26_digest_constants,7,&(lvalues[6435]),0},
-+{"id-tc26-cipher-constants","id-tc26-cipher-constants",
-+      NID_id_tc26_cipher_constants,7,&(lvalues[6442]),0},
-+{"id-tc26-gost-28147-constants","id-tc26-gost-28147-constants",
-+      NID_id_tc26_gost_28147_constants,8,&(lvalues[6449]),0},
-+{"id-tc26-gost-28147-param-Z","GOST 28147-89 TC26 parameter set",
-+      NID_id_tc26_gost_28147_param_Z,9,&(lvalues[6457]),0},
-+{"INN","INN",NID_INN,8,&(lvalues[6466]),0},
-+{"OGRN","OGRN",NID_OGRN,5,&(lvalues[6474]),0},
-+{"SNILS","SNILS",NID_SNILS,5,&(lvalues[6479]),0},
- };
- static const unsigned int sn_objs[NUM_SN]={
-@@ -2614,6 +2711,7 @@
- 35,   /* "IDEA-CFB" */
- 36,   /* "IDEA-ECB" */
- 46,   /* "IDEA-OFB" */
-+988,  /* "INN" */
- 181,  /* "ISO" */
- 183,  /* "ISO-US" */
- 645,  /* "ITU-T" */
-@@ -2635,6 +2733,7 @@
- 17,   /* "O" */
- 178,  /* "OCSP" */
- 180,  /* "OCSPSigning" */
-+989,  /* "OGRN" */
- 379,  /* "ORG" */
- 18,   /* "OU" */
- 749,  /* "Oakley-EC2N-3" */
-@@ -2700,6 +2799,7 @@
- 188,  /* "SMIME" */
- 167,  /* "SMIME-CAPS" */
- 100,  /* "SN" */
-+990,  /* "SNILS" */
- 16,   /* "ST" */
- 143,  /* "SXNetID" */
- 458,  /* "UID" */
-@@ -2858,10 +2958,14 @@
- 156,  /* "friendlyName" */
- 509,  /* "generationQualifier" */
- 815,  /* "gost-mac" */
-+960,  /* "gost-mac-12" */
- 811,  /* "gost2001" */
- 851,  /* "gost2001cc" */
-+963,  /* "gost2012_256" */
-+964,  /* "gost2012_512" */
- 813,  /* "gost89" */
- 814,  /* "gost89-cnt" */
-+959,  /* "gost89-cnt-12" */
- 812,  /* "gost94" */
- 850,  /* "gost94cc" */
- 797,  /* "hmacWithMD5" */
-@@ -3115,6 +3219,30 @@
- 194,  /* "id-smime-spq" */
- 250,  /* "id-smime-spq-ets-sqt-unotice" */
- 249,  /* "id-smime-spq-ets-sqt-uri" */
-+958,  /* "id-tc26" */
-+975,  /* "id-tc26-agreement" */
-+976,  /* "id-tc26-agreement-gost-3410-2012-256" */
-+977,  /* "id-tc26-agreement-gost-3410-2012-512" */
-+961,  /* "id-tc26-algorithms" */
-+974,  /* "id-tc26-cipher" */
-+985,  /* "id-tc26-cipher-constants" */
-+978,  /* "id-tc26-constants" */
-+965,  /* "id-tc26-digest" */
-+984,  /* "id-tc26-digest-constants" */
-+986,  /* "id-tc26-gost-28147-constants" */
-+987,  /* "id-tc26-gost-28147-param-Z" */
-+980,  /* "id-tc26-gost-3410-2012-512-constants" */
-+982,  /* "id-tc26-gost-3410-2012-512-paramSetA" */
-+983,  /* "id-tc26-gost-3410-2012-512-paramSetB" */
-+981,  /* "id-tc26-gost-3410-2012-512-paramSetTest" */
-+972,  /* "id-tc26-hmac-gost-3411-2012-256" */
-+973,  /* "id-tc26-hmac-gost-3411-2012-512" */
-+971,  /* "id-tc26-mac" */
-+962,  /* "id-tc26-sign" */
-+979,  /* "id-tc26-sign-constants" */
-+968,  /* "id-tc26-signwithdigest" */
-+969,  /* "id-tc26-signwithdigest-gost3410-2012-256" */
-+970,  /* "id-tc26-signwithdigest-gost3410-2012-512" */
- 676,  /* "identified-organization" */
- 461,  /* "info" */
- 748,  /* "inhibitAnyPolicy" */
-@@ -3140,6 +3268,8 @@
- 460,  /* "mail" */
- 493,  /* "mailPreferenceOption" */
- 467,  /* "manager" */
-+966,  /* "md_gost12_256" */
-+967,  /* "md_gost12_512" */
- 809,  /* "md_gost94" */
- 875,  /* "member" */
- 182,  /* "member-body" */
-@@ -3497,12 +3627,22 @@
- 813,  /* "GOST 28147-89" */
- 849,  /* "GOST 28147-89 Cryptocom ParamSet" */
- 815,  /* "GOST 28147-89 MAC" */
-+987,  /* "GOST 28147-89 TC26 parameter set" */
- 851,  /* "GOST 34.10-2001 Cryptocom" */
- 850,  /* "GOST 34.10-94 Cryptocom" */
- 811,  /* "GOST R 34.10-2001" */
- 817,  /* "GOST R 34.10-2001 DH" */
-+982,  /* "GOST R 34.10-2012 (512 bit) ParamSet A" */
-+983,  /* "GOST R 34.10-2012 (512 bit) ParamSet B" */
-+981,  /* "GOST R 34.10-2012 (512 bit) testing parameter set" */
-+963,  /* "GOST R 34.10-2012 with 256 bit modulus" */
-+964,  /* "GOST R 34.10-2012 with 512 bit modulus" */
-+969,  /* "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)" */
-+970,  /* "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)" */
- 812,  /* "GOST R 34.10-94" */
- 818,  /* "GOST R 34.10-94 DH" */
-+966,  /* "GOST R 34.11-2012 with 256 bit hash" */
-+967,  /* "GOST R 34.11-2012 with 512 bit hash" */
- 809,  /* "GOST R 34.11-94" */
- 816,  /* "GOST R 34.11-94 PRF" */
- 807,  /* "GOST R 34.11-94 with GOST R 34.10-2001" */
-@@ -3510,12 +3650,15 @@
- 808,  /* "GOST R 34.11-94 with GOST R 34.10-94" */
- 852,  /* "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" */
- 854,  /* "GOST R 3410-2001 Parameter Set Cryptocom" */
-+972,  /* "HMAC GOST 34.11-2012 256 bit" */
-+973,  /* "HMAC GOST 34.11-2012 512 bit" */
- 810,  /* "HMAC GOST 34.11-94" */
- 432,  /* "Hold Instruction Call Issuer" */
- 430,  /* "Hold Instruction Code" */
- 431,  /* "Hold Instruction None" */
- 433,  /* "Hold Instruction Reject" */
- 634,  /* "ICC or token signature" */
-+988,  /* "INN" */
- 294,  /* "IPSec End System" */
- 295,  /* "IPSec Tunnel" */
- 296,  /* "IPSec User" */
-@@ -3560,6 +3703,7 @@
- 366,  /* "OCSP Nonce" */
- 371,  /* "OCSP Service Locator" */
- 180,  /* "OCSP Signing" */
-+989,  /* "OGRN" */
- 161,  /* "PBES2" */
- 69,   /* "PBKDF2" */
- 162,  /* "PBMAC1" */
-@@ -3573,6 +3717,7 @@
-  2,   /* "RSA Data Security, Inc. PKCS" */
- 188,  /* "S/MIME" */
- 167,  /* "S/MIME Capabilities" */
-+990,  /* "SNILS" */
- 387,  /* "SNMPv2" */
- 512,  /* "Secure Electronic Transactions" */
- 386,  /* "Security" */
-@@ -3825,7 +3970,9 @@
- 509,  /* "generationQualifier" */
- 601,  /* "generic cryptogram" */
- 99,   /* "givenName" */
-+960,  /* "gost-mac-12" */
- 814,  /* "gost89-cnt" */
-+959,  /* "gost89-cnt-12" */
- 855,  /* "hmac" */
- 780,  /* "hmac-md5" */
- 781,  /* "hmac-sha1" */
-@@ -4053,6 +4200,22 @@
- 194,  /* "id-smime-spq" */
- 250,  /* "id-smime-spq-ets-sqt-unotice" */
- 249,  /* "id-smime-spq-ets-sqt-uri" */
-+958,  /* "id-tc26" */
-+975,  /* "id-tc26-agreement" */
-+976,  /* "id-tc26-agreement-gost-3410-2012-256" */
-+977,  /* "id-tc26-agreement-gost-3410-2012-512" */
-+961,  /* "id-tc26-algorithms" */
-+974,  /* "id-tc26-cipher" */
-+985,  /* "id-tc26-cipher-constants" */
-+978,  /* "id-tc26-constants" */
-+965,  /* "id-tc26-digest" */
-+984,  /* "id-tc26-digest-constants" */
-+986,  /* "id-tc26-gost-28147-constants" */
-+980,  /* "id-tc26-gost-3410-2012-512-constants" */
-+971,  /* "id-tc26-mac" */
-+962,  /* "id-tc26-sign" */
-+979,  /* "id-tc26-sign-constants" */
-+968,  /* "id-tc26-signwithdigest" */
- 34,   /* "idea-cbc" */
- 35,   /* "idea-cfb" */
- 36,   /* "idea-ecb" */
-@@ -4661,6 +4824,9 @@
- 639,  /* OBJ_set_brand_JCB                2 23 42 8 35 */
- 805,  /* OBJ_cryptopro                    1 2 643 2 2 */
- 806,  /* OBJ_cryptocom                    1 2 643 2 9 */
-+958,  /* OBJ_id_tc26                      1 2 643 7 1 */
-+989,  /* OBJ_OGRN                         1 2 643 100 1 */
-+990,  /* OBJ_SNILS                        1 2 643 100 3 */
- 184,  /* OBJ_X9_57                        1 2 840 10040 */
- 405,  /* OBJ_ansi_X9_62                   1 2 840 10045 */
- 389,  /* OBJ_Enterprises                  1 3 6 1 4 1 */
-@@ -4745,6 +4911,8 @@
- 816,  /* OBJ_id_GostR3411_94_prf          1 2 643 2 2 23 */
- 817,  /* OBJ_id_GostR3410_2001DH          1 2 643 2 2 98 */
- 818,  /* OBJ_id_GostR3410_94DH            1 2 643 2 2 99 */
-+961,  /* OBJ_id_tc26_algorithms           1 2 643 7 1 1 */
-+978,  /* OBJ_id_tc26_constants            1 2 643 7 1 2 */
-  1,   /* OBJ_rsadsi                       1 2 840 113549 */
- 185,  /* OBJ_X9cm                         1 2 840 10040 4 */
- 127,  /* OBJ_id_pkix                      1 3 6 1 5 5 7 */
-@@ -4795,6 +4963,15 @@
- 842,  /* OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet 1 2 643 2 2 35 3 */
- 843,  /* OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet 1 2 643 2 2 36 0 */
- 844,  /* OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet 1 2 643 2 2 36 1 */
-+962,  /* OBJ_id_tc26_sign                 1 2 643 7 1 1 1 */
-+965,  /* OBJ_id_tc26_digest               1 2 643 7 1 1 2 */
-+968,  /* OBJ_id_tc26_signwithdigest       1 2 643 7 1 1 3 */
-+971,  /* OBJ_id_tc26_mac                  1 2 643 7 1 1 4 */
-+974,  /* OBJ_id_tc26_cipher               1 2 643 7 1 1 5 */
-+975,  /* OBJ_id_tc26_agreement            1 2 643 7 1 1 6 */
-+979,  /* OBJ_id_tc26_sign_constants       1 2 643 7 1 2 1 */
-+984,  /* OBJ_id_tc26_digest_constants     1 2 643 7 1 2 2 */
-+985,  /* OBJ_id_tc26_cipher_constants     1 2 643 7 1 2 5 */
-  2,   /* OBJ_pkcs                         1 2 840 113549 1 */
- 431,  /* OBJ_hold_instruction_none        1 2 840 10040 2 1 */
- 432,  /* OBJ_hold_instruction_call_issuer 1 2 840 10040 2 2 */
-@@ -4846,6 +5023,19 @@
- 851,  /* OBJ_id_GostR3410_2001_cc         1 2 643 2 9 1 5 4 */
- 849,  /* OBJ_id_Gost28147_89_cc           1 2 643 2 9 1 6 1 */
- 854,  /* OBJ_id_GostR3410_2001_ParamSet_cc 1 2 643 2 9 1 8 1 */
-+988,  /* OBJ_INN                          1 2 643 3 131 1 1 */
-+963,  /* OBJ_id_GostR3410_2012_256        1 2 643 7 1 1 1 1 */
-+964,  /* OBJ_id_GostR3410_2012_512        1 2 643 7 1 1 1 2 */
-+966,  /* OBJ_id_GostR3411_2012_256        1 2 643 7 1 1 2 2 */
-+967,  /* OBJ_id_GostR3411_2012_512        1 2 643 7 1 1 2 3 */
-+969,  /* OBJ_id_tc26_signwithdigest_gost3410_2012_256 1 2 643 7 1 1 3 2 */
-+970,  /* OBJ_id_tc26_signwithdigest_gost3410_2012_512 1 2 643 7 1 1 3 3 */
-+972,  /* OBJ_id_tc26_hmac_gost_3411_2012_256 1 2 643 7 1 1 4 1 */
-+973,  /* OBJ_id_tc26_hmac_gost_3411_2012_512 1 2 643 7 1 1 4 2 */
-+976,  /* OBJ_id_tc26_agreement_gost_3410_2012_256 1 2 643 7 1 1 6 1 */
-+977,  /* OBJ_id_tc26_agreement_gost_3410_2012_512 1 2 643 7 1 1 6 2 */
-+980,  /* OBJ_id_tc26_gost_3410_2012_512_constants 1 2 643 7 1 2 1 2 */
-+986,  /* OBJ_id_tc26_gost_28147_constants 1 2 643 7 1 2 5 1 */
- 186,  /* OBJ_pkcs1                        1 2 840 113549 1 1 */
- 27,   /* OBJ_pkcs3                        1 2 840 113549 1 3 */
- 187,  /* OBJ_pkcs5                        1 2 840 113549 1 5 */
-@@ -5013,6 +5203,10 @@
- 439,  /* OBJ_pilotAttributeSyntax         0 9 2342 19200300 100 3 */
- 440,  /* OBJ_pilotObjectClass             0 9 2342 19200300 100 4 */
- 441,  /* OBJ_pilotGroups                  0 9 2342 19200300 100 10 */
-+981,  /* OBJ_id_tc26_gost_3410_2012_512_paramSetTest 1 2 643 7 1 2 1 2 0 */
-+982,  /* OBJ_id_tc26_gost_3410_2012_512_paramSetA 1 2 643 7 1 2 1 2 1 */
-+983,  /* OBJ_id_tc26_gost_3410_2012_512_paramSetB 1 2 643 7 1 2 1 2 2 */
-+987,  /* OBJ_id_tc26_gost_28147_param_Z   1 2 643 7 1 2 5 1 1 */
- 108,  /* OBJ_cast5_cbc                    1 2 840 113533 7 66 10 */
- 112,  /* OBJ_pbeWithMD5AndCast5_CBC       1 2 840 113533 7 66 12 */
- 782,  /* OBJ_id_PasswordBasedMAC          1 2 840 113533 7 66 13 */
-diff -Nuar openssl-1.0.2d/crypto/objects/objects.txt openssl-work/crypto/objects/objects.txt
---- openssl-1.0.2d/crypto/objects/objects.txt  2015-07-09 15:57:15.000000000 +0400
-+++ openssl-work/crypto/objects/objects.txt    2015-02-25 12:45:41.000000000 +0400
-@@ -1156,6 +1156,7 @@
- member-body 643 2 2   : cryptopro
- member-body 643 2 9   : cryptocom
-+member-body 643 7 1   : id-tc26
- cryptopro 3           : id-GostR3411-94-with-GostR3410-2001 : GOST R 34.11-94 with GOST R 34.10-2001
- cryptopro 4           : id-GostR3411-94-with-GostR3410-94 : GOST R 34.11-94 with GOST R 34.10-94
-@@ -1169,8 +1170,10 @@
- !Cname id-Gost28147-89
- cryptopro 21          : gost89                : GOST 28147-89
-                       : gost89-cnt
-+                      : gost89-cnt-12
- !Cname id-Gost28147-89-MAC
- cryptopro 22          : gost-mac      : GOST 28147-89 MAC
-+                      : gost-mac-12
- !Cname id-GostR3411-94-prf
- cryptopro 23          : prf-gostr3411-94      : GOST R 34.11-94 PRF
- cryptopro 98          : id-GostR3410-2001DH   : GOST R 34.10-2001 DH
-@@ -1229,6 +1232,52 @@
- cryptocom 1 8 1               : id-GostR3410-2001-ParamSet-cc : GOST R 3410-2001 Parameter Set Cryptocom
-+# TC26 GOST OIDs
-+
-+id-tc26 1             : id-tc26-algorithms
-+id-tc26-algorithms 1  : id-tc26-sign
-+!Cname id-GostR3410-2012-256
-+id-tc26-sign 1                : gost2012_256: GOST R 34.10-2012 with 256 bit modulus
-+!Cname id-GostR3410-2012-512
-+id-tc26-sign 2                : gost2012_512: GOST R 34.10-2012 with 512 bit modulus
-+
-+id-tc26-algorithms 2  : id-tc26-digest
-+!Cname id-GostR3411-2012-256
-+id-tc26-digest 2      : md_gost12_256: GOST R 34.11-2012 with 256 bit hash
-+!Cname id-GostR3411-2012-512
-+id-tc26-digest 3      : md_gost12_512: GOST R 34.11-2012 with 512 bit hash
-+
-+id-tc26-algorithms 3  : id-tc26-signwithdigest
-+id-tc26-signwithdigest 2: id-tc26-signwithdigest-gost3410-2012-256: GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)
-+id-tc26-signwithdigest 3: id-tc26-signwithdigest-gost3410-2012-512: GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)
-+
-+id-tc26-algorithms 4  : id-tc26-mac
-+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-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 2             : id-tc26-constants
-+
-+id-tc26-constants 1   : id-tc26-sign-constants
-+id-tc26-sign-constants 2: id-tc26-gost-3410-2012-512-constants
-+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-constants 2     : id-tc26-digest-constants
-+id-tc26-constants 5     : id-tc26-cipher-constants
-+id-tc26-cipher-constants 1    : id-tc26-gost-28147-constants
-+id-tc26-gost-28147-constants 1        : id-tc26-gost-28147-param-Z : GOST 28147-89 TC26 parameter set
-+
-+member-body 643 3 131 1 1     : INN   : INN
-+member-body 643 100 1         : OGRN  : OGRN
-+member-body 643 100 3         : SNILS : SNILS
-+
- # Definitions for Camellia cipher - CBC MODE
- 1 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC          : camellia-128-cbc
-diff -Nuar openssl-1.0.2d/crypto/objects/obj_mac.h openssl-work/crypto/objects/obj_mac.h
---- openssl-1.0.2d/crypto/objects/obj_mac.h    2015-07-09 15:58:04.000000000 +0400
-+++ openssl-work/crypto/objects/obj_mac.h      2015-03-26 13:00:22.000000000 +0400
-@@ -3678,6 +3678,10 @@
- #define NID_cryptocom           806
- #define OBJ_cryptocom           OBJ_member_body,643L,2L,9L
-+#define SN_id_tc26              "id-tc26"
-+#define NID_id_tc26             958
-+#define OBJ_id_tc26             OBJ_member_body,643L,7L,1L
-+
- #define SN_id_GostR3411_94_with_GostR3410_2001          "id-GostR3411-94-with-GostR3410-2001"
- #define LN_id_GostR3411_94_with_GostR3410_2001          "GOST R 34.11-94 with GOST R 34.10-2001"
- #define NID_id_GostR3411_94_with_GostR3410_2001         807
-@@ -3716,11 +3720,17 @@
- #define SN_gost89_cnt           "gost89-cnt"
- #define NID_gost89_cnt          814
-+#define SN_gost89_cnt_12                "gost89-cnt-12"
-+#define NID_gost89_cnt_12               959
-+
- #define SN_id_Gost28147_89_MAC          "gost-mac"
- #define LN_id_Gost28147_89_MAC          "GOST 28147-89 MAC"
- #define NID_id_Gost28147_89_MAC         815
- #define OBJ_id_Gost28147_89_MAC         OBJ_cryptopro,22L
-+#define SN_gost_mac_12          "gost-mac-12"
-+#define NID_gost_mac_12         960
-+
- #define SN_id_GostR3411_94_prf          "prf-gostr3411-94"
- #define LN_id_GostR3411_94_prf          "GOST R 34.11-94 PRF"
- #define NID_id_GostR3411_94_prf         816
-@@ -3886,6 +3896,141 @@
- #define NID_id_GostR3410_2001_ParamSet_cc               854
- #define OBJ_id_GostR3410_2001_ParamSet_cc               OBJ_cryptocom,1L,8L,1L
-+#define SN_id_tc26_algorithms           "id-tc26-algorithms"
-+#define NID_id_tc26_algorithms          961
-+#define OBJ_id_tc26_algorithms          OBJ_id_tc26,1L
-+
-+#define SN_id_tc26_sign         "id-tc26-sign"
-+#define NID_id_tc26_sign                962
-+#define OBJ_id_tc26_sign                OBJ_id_tc26_algorithms,1L
-+
-+#define SN_id_GostR3410_2012_256                "gost2012_256"
-+#define LN_id_GostR3410_2012_256                "GOST R 34.10-2012 with 256 bit modulus"
-+#define NID_id_GostR3410_2012_256               963
-+#define OBJ_id_GostR3410_2012_256               OBJ_id_tc26_sign,1L
-+
-+#define SN_id_GostR3410_2012_512                "gost2012_512"
-+#define LN_id_GostR3410_2012_512                "GOST R 34.10-2012 with 512 bit modulus"
-+#define NID_id_GostR3410_2012_512               964
-+#define OBJ_id_GostR3410_2012_512               OBJ_id_tc26_sign,2L
-+
-+#define SN_id_tc26_digest               "id-tc26-digest"
-+#define NID_id_tc26_digest              965
-+#define OBJ_id_tc26_digest              OBJ_id_tc26_algorithms,2L
-+
-+#define SN_id_GostR3411_2012_256                "md_gost12_256"
-+#define LN_id_GostR3411_2012_256                "GOST R 34.11-2012 with 256 bit hash"
-+#define NID_id_GostR3411_2012_256               966
-+#define OBJ_id_GostR3411_2012_256               OBJ_id_tc26_digest,2L
-+
-+#define SN_id_GostR3411_2012_512                "md_gost12_512"
-+#define LN_id_GostR3411_2012_512                "GOST R 34.11-2012 with 512 bit hash"
-+#define NID_id_GostR3411_2012_512               967
-+#define OBJ_id_GostR3411_2012_512               OBJ_id_tc26_digest,3L
-+
-+#define SN_id_tc26_signwithdigest               "id-tc26-signwithdigest"
-+#define NID_id_tc26_signwithdigest              968
-+#define OBJ_id_tc26_signwithdigest              OBJ_id_tc26_algorithms,3L
-+
-+#define SN_id_tc26_signwithdigest_gost3410_2012_256             "id-tc26-signwithdigest-gost3410-2012-256"
-+#define LN_id_tc26_signwithdigest_gost3410_2012_256             "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)"
-+#define NID_id_tc26_signwithdigest_gost3410_2012_256            969
-+#define OBJ_id_tc26_signwithdigest_gost3410_2012_256            OBJ_id_tc26_signwithdigest,2L
-+
-+#define SN_id_tc26_signwithdigest_gost3410_2012_512             "id-tc26-signwithdigest-gost3410-2012-512"
-+#define LN_id_tc26_signwithdigest_gost3410_2012_512             "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)"
-+#define NID_id_tc26_signwithdigest_gost3410_2012_512            970
-+#define OBJ_id_tc26_signwithdigest_gost3410_2012_512            OBJ_id_tc26_signwithdigest,3L
-+
-+#define SN_id_tc26_mac          "id-tc26-mac"
-+#define NID_id_tc26_mac         971
-+#define OBJ_id_tc26_mac         OBJ_id_tc26_algorithms,4L
-+
-+#define SN_id_tc26_hmac_gost_3411_2012_256              "id-tc26-hmac-gost-3411-2012-256"
-+#define LN_id_tc26_hmac_gost_3411_2012_256              "HMAC GOST 34.11-2012 256 bit"
-+#define NID_id_tc26_hmac_gost_3411_2012_256             972
-+#define OBJ_id_tc26_hmac_gost_3411_2012_256             OBJ_id_tc26_mac,1L
-+
-+#define SN_id_tc26_hmac_gost_3411_2012_512              "id-tc26-hmac-gost-3411-2012-512"
-+#define LN_id_tc26_hmac_gost_3411_2012_512              "HMAC GOST 34.11-2012 512 bit"
-+#define NID_id_tc26_hmac_gost_3411_2012_512             973
-+#define OBJ_id_tc26_hmac_gost_3411_2012_512             OBJ_id_tc26_mac,2L
-+
-+#define SN_id_tc26_cipher               "id-tc26-cipher"
-+#define NID_id_tc26_cipher              974
-+#define OBJ_id_tc26_cipher              OBJ_id_tc26_algorithms,5L
-+
-+#define SN_id_tc26_agreement            "id-tc26-agreement"
-+#define NID_id_tc26_agreement           975
-+#define OBJ_id_tc26_agreement           OBJ_id_tc26_algorithms,6L
-+
-+#define SN_id_tc26_agreement_gost_3410_2012_256         "id-tc26-agreement-gost-3410-2012-256"
-+#define NID_id_tc26_agreement_gost_3410_2012_256                976
-+#define OBJ_id_tc26_agreement_gost_3410_2012_256                OBJ_id_tc26_agreement,1L
-+
-+#define SN_id_tc26_agreement_gost_3410_2012_512         "id-tc26-agreement-gost-3410-2012-512"
-+#define NID_id_tc26_agreement_gost_3410_2012_512                977
-+#define OBJ_id_tc26_agreement_gost_3410_2012_512                OBJ_id_tc26_agreement,2L
-+
-+#define SN_id_tc26_constants            "id-tc26-constants"
-+#define NID_id_tc26_constants           978
-+#define OBJ_id_tc26_constants           OBJ_id_tc26,2L
-+
-+#define SN_id_tc26_sign_constants               "id-tc26-sign-constants"
-+#define NID_id_tc26_sign_constants              979
-+#define OBJ_id_tc26_sign_constants              OBJ_id_tc26_constants,1L
-+
-+#define SN_id_tc26_gost_3410_2012_512_constants         "id-tc26-gost-3410-2012-512-constants"
-+#define NID_id_tc26_gost_3410_2012_512_constants                980
-+#define OBJ_id_tc26_gost_3410_2012_512_constants                OBJ_id_tc26_sign_constants,2L
-+
-+#define SN_id_tc26_gost_3410_2012_512_paramSetTest              "id-tc26-gost-3410-2012-512-paramSetTest"
-+#define LN_id_tc26_gost_3410_2012_512_paramSetTest              "GOST R 34.10-2012 (512 bit) testing parameter set"
-+#define NID_id_tc26_gost_3410_2012_512_paramSetTest             981
-+#define OBJ_id_tc26_gost_3410_2012_512_paramSetTest             OBJ_id_tc26_gost_3410_2012_512_constants,0L
-+
-+#define SN_id_tc26_gost_3410_2012_512_paramSetA         "id-tc26-gost-3410-2012-512-paramSetA"
-+#define LN_id_tc26_gost_3410_2012_512_paramSetA         "GOST R 34.10-2012 (512 bit) ParamSet A"
-+#define NID_id_tc26_gost_3410_2012_512_paramSetA                982
-+#define OBJ_id_tc26_gost_3410_2012_512_paramSetA                OBJ_id_tc26_gost_3410_2012_512_constants,1L
-+
-+#define SN_id_tc26_gost_3410_2012_512_paramSetB         "id-tc26-gost-3410-2012-512-paramSetB"
-+#define LN_id_tc26_gost_3410_2012_512_paramSetB         "GOST R 34.10-2012 (512 bit) ParamSet B"
-+#define NID_id_tc26_gost_3410_2012_512_paramSetB                983
-+#define OBJ_id_tc26_gost_3410_2012_512_paramSetB                OBJ_id_tc26_gost_3410_2012_512_constants,2L
-+
-+#define SN_id_tc26_digest_constants             "id-tc26-digest-constants"
-+#define NID_id_tc26_digest_constants            984
-+#define OBJ_id_tc26_digest_constants            OBJ_id_tc26_constants,2L
-+
-+#define SN_id_tc26_cipher_constants             "id-tc26-cipher-constants"
-+#define NID_id_tc26_cipher_constants            985
-+#define OBJ_id_tc26_cipher_constants            OBJ_id_tc26_constants,5L
-+
-+#define SN_id_tc26_gost_28147_constants         "id-tc26-gost-28147-constants"
-+#define NID_id_tc26_gost_28147_constants                986
-+#define OBJ_id_tc26_gost_28147_constants                OBJ_id_tc26_cipher_constants,1L
-+
-+#define SN_id_tc26_gost_28147_param_Z           "id-tc26-gost-28147-param-Z"
-+#define LN_id_tc26_gost_28147_param_Z           "GOST 28147-89 TC26 parameter set"
-+#define NID_id_tc26_gost_28147_param_Z          987
-+#define OBJ_id_tc26_gost_28147_param_Z          OBJ_id_tc26_gost_28147_constants,1L
-+
-+#define SN_INN          "INN"
-+#define LN_INN          "INN"
-+#define NID_INN         988
-+#define OBJ_INN         OBJ_member_body,643L,3L,131L,1L,1L
-+
-+#define SN_OGRN         "OGRN"
-+#define LN_OGRN         "OGRN"
-+#define NID_OGRN                989
-+#define OBJ_OGRN                OBJ_member_body,643L,100L,1L
-+
-+#define SN_SNILS                "SNILS"
-+#define LN_SNILS                "SNILS"
-+#define NID_SNILS               990
-+#define OBJ_SNILS               OBJ_member_body,643L,100L,3L
-+
- #define SN_camellia_128_cbc             "CAMELLIA-128-CBC"
- #define LN_camellia_128_cbc             "camellia-128-cbc"
- #define NID_camellia_128_cbc            751
-diff -Nuar openssl-1.0.2d/crypto/objects/obj_mac.num openssl-work/crypto/objects/obj_mac.num
---- openssl-1.0.2d/crypto/objects/obj_mac.num  2015-07-09 15:58:03.000000000 +0400
-+++ openssl-work/crypto/objects/obj_mac.num    2015-02-25 12:49:43.000000000 +0400
-@@ -955,3 +955,36 @@
- jurisdictionLocalityName              955
- jurisdictionStateOrProvinceName               956
- jurisdictionCountryName               957
-+id_tc26               958
-+gost89_cnt_12         959
-+gost_mac_12           960
-+id_tc26_algorithms            961
-+id_tc26_sign          962
-+id_GostR3410_2012_256         963
-+id_GostR3410_2012_512         964
-+id_tc26_digest                965
-+id_GostR3411_2012_256         966
-+id_GostR3411_2012_512         967
-+id_tc26_signwithdigest                968
-+id_tc26_signwithdigest_gost3410_2012_256              969
-+id_tc26_signwithdigest_gost3410_2012_512              970
-+id_tc26_mac           971
-+id_tc26_hmac_gost_3411_2012_256               972
-+id_tc26_hmac_gost_3411_2012_512               973
-+id_tc26_cipher                974
-+id_tc26_agreement             975
-+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_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_digest_constants              984
-+id_tc26_cipher_constants              985
-+id_tc26_gost_28147_constants          986
-+id_tc26_gost_28147_param_Z            987
-+INN           988
-+OGRN          989
-+SNILS         990
-diff -Nuar openssl-1.0.2d/crypto/objects/obj_xref.h openssl-work/crypto/objects/obj_xref.h
---- openssl-1.0.2d/crypto/objects/obj_xref.h   2015-07-09 16:02:55.000000000 +0400
-+++ openssl-work/crypto/objects/obj_xref.h     2015-03-26 13:00:21.000000000 +0400
-@@ -56,6 +56,10 @@
-      NID_dh_cofactor_kdf},
-     {NID_dhSinglePass_cofactorDH_sha512kdf_scheme, NID_sha512,
-      NID_dh_cofactor_kdf},
-+    {NID_id_tc26_signwithdigest_gost3410_2012_256, NID_id_GostR3411_2012_256,
-+     NID_id_GostR3410_2012_256},
-+    {NID_id_tc26_signwithdigest_gost3410_2012_512, NID_id_GostR3411_2012_512,
-+     NID_id_GostR3410_2012_512},
- };
- static const nid_triple *const sigoid_srt_xref[] = {
-@@ -96,4 +100,6 @@
-     &sigoid_srt[26],
-     &sigoid_srt[27],
-     &sigoid_srt[28],
-+    &sigoid_srt[40],
-+    &sigoid_srt[41],
- };
-diff -Nuar openssl-1.0.2d/crypto/objects/obj_xref.txt openssl-work/crypto/objects/obj_xref.txt
---- openssl-1.0.2d/crypto/objects/obj_xref.txt 2015-07-09 15:57:15.000000000 +0400
-+++ openssl-work/crypto/objects/obj_xref.txt   2015-02-24 15:22:17.000000000 +0400
-@@ -44,6 +44,8 @@
- id_GostR3411_94_with_GostR3410_94     id_GostR3411_94 id_GostR3410_94
- id_GostR3411_94_with_GostR3410_94_cc  id_GostR3411_94 id_GostR3410_94_cc
- id_GostR3411_94_with_GostR3410_2001_cc        id_GostR3411_94 id_GostR3410_2001_cc
-+id_tc26_signwithdigest_gost3410_2012_256 id_GostR3411_2012_256 id_GostR3410_2012_256
-+id_tc26_signwithdigest_gost3410_2012_512 id_GostR3411_2012_512 id_GostR3410_2012_512
- # ECDH KDFs and their corresponding message digests and schemes
- dhSinglePass_stdDH_sha1kdf_scheme             sha1    dh_std_kdf
- dhSinglePass_stdDH_sha224kdf_scheme           sha224  dh_std_kdf
-
diff --git a/patches/1.0.2/pkcs12.diff b/patches/1.0.2/pkcs12.diff
deleted file mode 100644 (file)
index f6267ba..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-diff -Nuar openssl-1.0.2d/crypto/evp/evp_pbe.c openssl-work/crypto/evp/evp_pbe.c
---- openssl-1.0.2d/crypto/evp/evp_pbe.c        2015-07-09 15:53:21.000000000 +0400
-+++ openssl-work/crypto/evp/evp_pbe.c  2015-03-26 13:00:21.000000000 +0400
-@@ -121,6 +121,10 @@
-     {EVP_PBE_TYPE_PRF, NID_hmacWithSHA384, -1, NID_sha384, 0},
-     {EVP_PBE_TYPE_PRF, NID_hmacWithSHA512, -1, NID_sha512, 0},
-     {EVP_PBE_TYPE_PRF, NID_id_HMACGostR3411_94, -1, NID_id_GostR3411_94, 0},
-+    {EVP_PBE_TYPE_PRF, NID_id_tc26_hmac_gost_3411_2012_256, -1,
-+     NID_id_GostR3411_2012_256, 0},
-+    {EVP_PBE_TYPE_PRF, NID_id_tc26_hmac_gost_3411_2012_512, -1,
-+     NID_id_GostR3411_2012_512, 0},
- };
- #ifdef TEST
-diff -Nuar openssl-1.0.2d/crypto/pkcs12/p12_mutl.c openssl-work/crypto/pkcs12/p12_mutl.c
---- openssl-1.0.2d/crypto/pkcs12/p12_mutl.c    2015-07-09 15:53:21.000000000 +0400
-+++ openssl-work/crypto/pkcs12/p12_mutl.c      2015-06-17 14:48:18.000000000 +0400
-@@ -65,6 +65,28 @@
- # include <openssl/rand.h>
- # include <openssl/pkcs12.h>
-+# define TK26_MAC_KEY_LEN 32
-+
-+static int PKCS12_gen_gost_mac_key(const char *pass, int passlen,
-+                                   const unsigned char *salt, int saltlen,
-+                                   int iter, const EVP_MD *digest, int keylen,
-+                                   unsigned char *key)
-+{
-+    unsigned char out[96];
-+
-+    if (keylen != TK26_MAC_KEY_LEN) {
-+        return 0;
-+    }
-+
-+    if (!PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter,
-+                           digest, 96, out)) {
-+        return 0;
-+    }
-+    memcpy(key, out + 64, TK26_MAC_KEY_LEN);
-+    OPENSSL_cleanse(out, 96);
-+    return 1;
-+}
-+
- /* Generate a MAC */
- int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
-                    unsigned char *mac, unsigned int *maclen)
-@@ -73,7 +95,7 @@
-     HMAC_CTX hmac;
-     unsigned char key[EVP_MAX_MD_SIZE], *salt;
-     int saltlen, iter;
--    int md_size;
-+    int md_size = 0;
-     if (!PKCS7_type_is_data(p12->authsafes)) {
-         PKCS12err(PKCS12_F_PKCS12_GEN_MAC, PKCS12_R_CONTENT_TYPE_NOT_DATA);
-@@ -93,8 +115,19 @@
-     md_size = EVP_MD_size(md_type);
-     if (md_size < 0)
-         return 0;
--    if (!PKCS12_key_gen(pass, passlen, salt, saltlen, PKCS12_MAC_ID, iter,
--                        md_size, key, md_type)) {
-+    if ((md_type->type == NID_id_GostR3411_94
-+         || md_type->type == NID_id_GostR3411_2012_256
-+         || md_type->type == NID_id_GostR3411_2012_512)
-+        && !getenv("LEGACY_GOST_PKCS12")) {
-+        md_size = TK26_MAC_KEY_LEN;
-+        if (!PKCS12_gen_gost_mac_key(pass, passlen, salt, saltlen, iter,
-+                                     md_type, md_size, key)) {
-+            PKCS12err(PKCS12_F_PKCS12_GEN_MAC, PKCS12_R_KEY_GEN_ERROR);
-+            return 0;
-+        }
-+    } else
-+        if (!PKCS12_key_gen(pass, passlen, salt, saltlen, PKCS12_MAC_ID, iter,
-+                            md_size, key, md_type)) {
-         PKCS12err(PKCS12_F_PKCS12_GEN_MAC, PKCS12_R_KEY_GEN_ERROR);
-         return 0;
-     }
-
diff --git a/patches/1.0.2/smimecap.diff b/patches/1.0.2/smimecap.diff
deleted file mode 100644 (file)
index 2451b51..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Nuar openssl-1.0.2d/crypto/cms/cms_sd.c openssl-work/crypto/cms/cms_sd.c
---- openssl-1.0.2d/crypto/cms/cms_sd.c 2015-07-09 15:57:15.000000000 +0400
-+++ openssl-work/crypto/cms/cms_sd.c   2015-03-26 13:00:20.000000000 +0400
-@@ -941,6 +941,8 @@
- int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap)
- {
-     if (!cms_add_cipher_smcap(smcap, NID_aes_256_cbc, -1)
-+        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1)
-+        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1)
-         || !cms_add_digest_smcap(smcap, NID_id_GostR3411_94, -1)
-         || !cms_add_cipher_smcap(smcap, NID_id_Gost28147_89, -1)
-         || !cms_add_cipher_smcap(smcap, NID_aes_192_cbc, -1)
-diff -Nuar openssl-1.0.2d/crypto/pkcs7/pk7_smime.c openssl-work/crypto/pkcs7/pk7_smime.c
---- openssl-1.0.2d/crypto/pkcs7/pk7_smime.c    2015-07-09 15:53:21.000000000 +0400
-+++ openssl-work/crypto/pkcs7/pk7_smime.c      2015-03-26 13:00:21.000000000 +0400
-@@ -185,6 +185,8 @@
-                 goto err;
-             }
-             if (!add_cipher_smcap(smcap, NID_aes_256_cbc, -1)
-+                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1)
-+                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1)
-                 || !add_digest_smcap(smcap, NID_id_GostR3411_94, -1)
-                 || !add_cipher_smcap(smcap, NID_id_Gost28147_89, -1)
-                 || !add_cipher_smcap(smcap, NID_aes_192_cbc, -1)
-
diff --git a/test/00-engine.t b/test/00-engine.t
new file mode 100644 (file)
index 0000000..9104ab0
--- /dev/null
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+use Test::More tests => 7;
+use Cwd 'abs_path';
+
+# prepare data for 
+
+open F,">","testdata.dat";
+print F "12345670" x 128;
+close F;
+
+# Set OPENSSL_ENGINES environment variable to just built engine
+if(!defined $ENV{'OPENSSL_ENGINES'}){
+       $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
+}
+
+$key='0123456789abcdef' x 2;
+
+#
+# You can redefine engine to use using ENGINE_NAME environment variable
+# 
+$engine=$ENV{'ENGINE_NAME'}||"gost";
+
+# Reopen STDERR to eliminate extra output
+open STDERR, ">>","tests.err";
+
+if (exists $ENV{'OPENSSL_CONF'}) {
+       delete $ENV{'OPENSSL_CONF'}
+}
+#
+# This test needs output of openssl engine -c command.
+# Default one  is hardcoded below, but you can place file
+# ${ENGINE_NAME}.info into this directory if you use this test suite
+# to test other engine implementing GOST cryptography.
+#
+if ( -f $engine . ".info") {
+       diag("Reading $engine.info");
+       open F, "<", $engine . ".info";
+       read F,$engine_info,1024;
+} else {
+
+$engine_info= <<EOINF;
+(gost) Reference implementation of GOST engine
+ [gost89, gost89-cnt, gost89-cnt-12, gost89-cbc, grasshopper-ecb, grasshopper-cbc, grasshopper-cfb, grasshopper-ofb, grasshopper-ctr, md_gost94, gost-mac, md_gost12_256, md_gost12_512, gost-mac-12, gost2001, gost-mac, gost2012_256, gost2012_512, gost-mac-12]
+EOINF
+}
+
+$ENV{'OPENSSL_CONF'}=abs_path("no_such_file.cfg");
+is(`openssl engine -c $engine`,
+$engine_info,
+"load engine without any config");
+
+is(`openssl dgst -engine $engine -md_gost94 testdata.dat`,
+"md_gost94(testdata.dat)= f7fc6d16a6a5c12ac4f7d320e0fd0d8354908699125e09727a4ef929122b1cae\n",
+"compute digest without config");
+
+
+open F,">","test.cnf";
+print F <<EOCFG;
+openssl_conf = openssl_def
+[openssl_def]
+engines = engines
+[engines]
+${engine}=gost_conf
+[gost_conf]
+default_algorithms = ALL
+
+EOCFG
+close F;
+$ENV{'OPENSSL_CONF'}=abs_path('test.cnf');
+
+is(`openssl engine -c $engine`,
+$engine_info,
+"load engine with config");
+
+is(`openssl dgst -md_gost94 testdata.dat`,
+"md_gost94(testdata.dat)= f7fc6d16a6a5c12ac4f7d320e0fd0d8354908699125e09727a4ef929122b1cae\n",
+"compute digest with config without explicit engine param");
+
+is(`openssl dgst -engine $engine -md_gost94 testdata.dat`,
+"md_gost94(testdata.dat)= f7fc6d16a6a5c12ac4f7d320e0fd0d8354908699125e09727a4ef929122b1cae\n",
+"compute digest with both config and explicit engine param");
+
+like(`openssl ciphers`, qr|GOST2001-GOST89-GOST89|, 'display GOST2001-GOST89-GOST89 cipher');
+
+like(`openssl ciphers`, qr|GOST2012-GOST8912-GOST8912|, 'display GOST2012-GOST8912-GOST8912 cipher');
+
+unlink('testdata.dat');
+unlink('test.cnf');
diff --git a/test/01-digest.t b/test/01-digest.t
new file mode 100644 (file)
index 0000000..3838fd2
--- /dev/null
@@ -0,0 +1,115 @@
+#!/usr/bin/perl 
+use Test::More tests => 16;
+use Cwd 'abs_path';
+
+# Set OPENSSL_ENGINES environment variable to just built engine
+if(!defined $ENV{'OPENSSL_ENGINES'}){
+        $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
+}
+# Set engine name from environment to allow testing of different engines
+$engine=$ENV{'ENGINE_NAME'}||"gost";
+# Reopen STDERR to eliminate extra output
+open STDERR, ">>","tests.err";
+
+# prepare data for 
+
+open F,">","testm1.dat";
+print F "012345678901234567890123456789012345678901234567890123456789012";
+close F;
+is(`openssl dgst -engine ${engine} -md_gost12_256 testm1.dat`,
+"md_gost12_256(testm1.dat)= 9d151eefd8590b89daa6ba6cb74af9275dd051026bb149a452fd84e5e57b5500\n",
+"GOST R 34.11-2012 256bit example 1 from standard");
+
+is(`openssl dgst -engine ${engine} -md_gost12_512 testm1.dat`,
+"md_gost12_512(testm1.dat)= 1b54d01a4af5b9d5cc3d86d68d285462b19abc2475222f35c085122be4ba1ffa00ad30f8767b3a82384c6574f024c311e2a481332b08ef7f41797891c1646f48\n",
+"GOST R 34.11-2012 512bit example 1 from standard");
+
+unlink("testm1.dat");
+
+open F,">","testm2.dat";
+print F pack("H*","d1e520e2e5f2f0e82c20d1f2f0e8e1eee6e820e2edf3f6e82c20e2e5fef2fa20f120eceef0ff20f1f2f0e5ebe0ece820ede020f5f0e0e1f0fbff20efebfaeafb20c8e3eef0e5e2fb");
+close F;
+is(`openssl dgst -engine ${engine} -md_gost12_256 testm2.dat`,
+"md_gost12_256(testm2.dat)= 9dd2fe4e90409e5da87f53976d7405b0c0cac628fc669a741d50063c557e8f50\n",
+"GOST R 34.11-2012 256bit example 2 from standard");
+
+is(`openssl dgst -engine ${engine} -md_gost12_512 testm2.dat`,
+"md_gost12_512(testm2.dat)= 1e88e62226bfca6f9994f1f2d51569e0daf8475a3b0fe61a5300eee46d961376035fe83549ada2b8620fcd7c496ce5b33f0cb9dddc2b6460143b03dabac9fb28\n",
+"GOST R 34.11-2012 512bit example 2 from standard");
+
+unlink("testm2.dat");
+
+
+open F,">","testdata.dat";
+binmode F;
+print F "12345670" x 128;
+close F;
+is(`openssl dgst -engine ${engine} -md_gost94 testdata.dat`,
+"md_gost94(testdata.dat)= f7fc6d16a6a5c12ac4f7d320e0fd0d8354908699125e09727a4ef929122b1cae\n",
+"GOST R 34.11-94 1K ascii");
+
+is(`openssl dgst -engine ${engine} -md_gost12_256 testdata.dat`,
+"md_gost12_256(testdata.dat)= 1906512b86a1283c68cec8419e57113efc562a1d0e95d8f4809542900c416fe4\n",
+"GOST R 34.11-2012 256bit 1K ascii");
+
+is(`openssl dgst -engine ${engine} -md_gost12_512 testdata.dat`,
+"md_gost12_512(testdata.dat)= 283587e434864d0d4bea97c0fb10e2dd421572fc859304bdf6a94673d652c59049212bad7802b4fcf5eecc1f8fab569d60f2c20dbd789a7fe4efbd79d8137ee7\n",
+"GOST R 34.11-2012 512bit 1K ascii");
+
+unlink("testdata.dat");
+
+open F,">","testdata2.dat";
+binmode F;
+print F "\x00\x01\x02\x15\x84\x67\x45\x31" x 128;
+close F;
+
+is(`openssl dgst -engine ${engine} -md_gost94 testdata2.dat`,
+"md_gost94(testdata2.dat)= 69f529aa82d9344ab0fa550cdf4a70ecfd92a38b5520b1906329763e09105196\n",
+"GOST R 34.11-94 1K binary");
+
+is(`openssl dgst -engine ${engine} -md_gost12_256 testdata2.dat`,
+"md_gost12_256(testdata2.dat)= 2eb1306be3e490f18ff0e2571a077b3831c815c46c7d4fdf9e0e26de4032b3f3\n",
+"GOST R 34.11-2012 256bit 1K binary");
+
+is(`openssl dgst -engine ${engine} -md_gost12_512 testdata2.dat`,
+"md_gost12_512(testdata2.dat)= 55656e5bcf795b499031a7833cd7dc18fe10d4a47e15be545c6ab3f304a4fe411c4c39de5b1fc6844880111441e0b92bf1ec2fb7840453fe39a2b70ced461968\n",
+"GOST R 34.11-2012 512bit 1K binary");
+
+unlink("testdata2.dat");
+
+open F, ">","testdata3.dat";
+binmode F;
+print F substr("12345670" x 128,0,539);
+close F;
+
+is(`openssl dgst -engine ${engine} -md_gost94 testdata3.dat`,
+"md_gost94(testdata3.dat)= bd5f1e4b539c7b00f0866afdbc8ed452503a18436061747a343f43efe888aac9\n",
+"GOST R 34.11-94 539 bytes");
+
+is(`openssl dgst -engine ${engine} -md_gost12_256 testdata3.dat`,
+"md_gost12_256(testdata3.dat)= c98a17f9fadff78d08521e4179a7b2e6275f3b1da88339a3cb961a3514e5332e\n",
+"GOST R 34.11-2012 256bit 539 bytes");
+
+is(`openssl dgst -engine ${engine} -md_gost12_512 testdata3.dat`,
+"md_gost12_512(testdata3.dat)= d5ad93fbc9ed7abc1cf28d00827a052b40bea74b04c4fd753102c1bcf9f9dad5142887f8a4cceaa0d64a0a8291592413d6adb956b99138a0023e127ff37bdf08\n",
+"GOST R 34.11-2012 512bit 539 bytes");
+
+unlink "testdata3.dat";
+open F , ">","bigdata.dat";
+binmode F;
+print F  ("121345678" x 7 . "1234567\n") x 4096,"12345\n";
+close F;
+
+is(`openssl dgst -engine ${engine} -md_gost94 bigdata.dat`,
+"md_gost94(bigdata.dat)= e5d3ac4ea3f67896c51ff919cedb9405ad771e39f0f2eab103624f9a758e506f\n",
+"GOST R 34.11-94 128K");
+
+is(`openssl dgst -engine ${engine} -md_gost12_256 bigdata.dat`,
+"md_gost12_256(bigdata.dat)= 50e935d725d9359e5991b6b7eba8b3539fca03584d26adf4c827c982ffd49367\n",
+"GOST R 34.11-2012 256bit 128K");
+
+is(`openssl dgst -engine ${engine} -md_gost12_512 bigdata.dat`,
+"md_gost12_512(bigdata.dat)= 1d93645ebfbb477660f98b7d1598e37fbf3bfc8234ead26e2246e1b979e590ac46138158a692f9a0c9ac2550758b4d0d4c9fb8af5e595a16d3760c6516443f82\n",
+"GOST R 34.11-2012 512bit 128K");
+
+unlink "bigdata.dat";
diff --git a/test/02-mac.t b/test/02-mac.t
new file mode 100644 (file)
index 0000000..5713dca
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/perl 
+use Test::More tests => 19;
+use Cwd 'abs_path';
+
+# prepare data for 
+
+open F,">","testdata.dat";
+print F "12345670" x 128;
+close F;
+
+open F,">","testbig.dat";
+print F ("12345670" x 8 . "\n") x  4096;
+close F;
+# Set OPENSSL_ENGINES environment variable to just built engine
+if(!defined $ENV{'OPENSSL_ENGINES'}){
+        $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
+}
+
+$key='0123456789abcdef' x 2;
+
+$engine=$ENV{'ENGINE_NAME'}||"gost";
+
+# Reopen STDERR to eliminate extra output
+open STDERR, ">>","tests.err";
+
+is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} testdata.dat`,
+"GOST-MAC-gost-mac(testdata.dat)= 2ee8d13d\n",
+"GOST MAC - default size");
+
+for ($i=1;$i<=8; $i++) {
+       is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} -sigopt size:$i testdata.dat`,
+"GOST-MAC-gost-mac(testdata.dat)= ".substr("2ee8d13dff7f037d",0,$i*2)."\n",
+"GOST MAC - size $i bytes");
+}
+
+
+
+is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} testbig.dat`,
+"GOST-MAC-gost-mac(testbig.dat)= 5efab81f\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");
+
+
+for ($i=1;$i<=8; $i++) {
+       is(`openssl dgst -engine ${engine} -mac gost-mac-12 -macopt key:${key} -sigopt size:$i testdata.dat`,
+"GOST-MAC-12-gost-mac-12(testdata.dat)= ".substr("be4453ec1ec327be",0,$i*2)."\n",
+"GOST MAC parameters 2012 - size $i bytes");
+}
+unlink('testdata.dat');
+unlink('testbig.dat');
diff --git a/test/03-encrypt.t b/test/03-encrypt.t
new file mode 100644 (file)
index 0000000..d5b56c4
--- /dev/null
@@ -0,0 +1,161 @@
+#!/usr/bin/perl
+use Test::More tests => 48;
+use Cwd 'abs_path';
+
+#
+# If this variable is set, engine would be loaded via configuration
+# file. Otherwise - via command line
+# 
+$use_config = 1;
+
+# prepare data for 
+
+
+# Set OPENSSL_ENGINES environment variable to just built engine
+if(!defined $ENV{'OPENSSL_ENGINES'}){
+        $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
+}
+
+$key='0123456789abcdef' x 2;
+
+#
+# You can redefine engine to use using ENGINE_NAME environment variable
+# 
+$engine=$ENV{'ENGINE_NAME'}||"gost";
+
+# Reopen STDERR to eliminate extra output
+open STDERR, ">>","tests.err";
+
+our $count=0;
+
+#
+# parameters -paramset = oid of the parameters
+# -cleartext - data to encrypt
+# -ciphertext - expected ciphertext (hex-encoded)
+# -key - key (hex-encoded)
+# -iv  - IV (hex-encoded)
+# 
+
+open F,">","test.cnf";
+if (defined($use_config) && $use_config) {
+       $eng_param = "";
+       open F,">","test.cnf";
+       print F <<EOCFG;
+openssl_conf = openssl_def
+[openssl_def]
+engines = engines
+[engines]
+${engine}=gost_conf
+[gost_conf]
+default_algorithms = ALL
+
+EOCFG
+} else {
+       $eng_param = "-engine $engine"
+}
+close F;
+$ENV{'OPENSSL_CONF'}=abs_path('test.cnf');
+       
+sub crypt_test {
+       my %p = @_;
+       our $count++;
+       open my $f, ">", "test$count.clear";
+       print $f $p{-cleartext};
+       close $f;
+       
+       $ENV{'CRYPT_PARAMS'} = $p{-paramset} if exists $p{-paramset};
+       my $ctext = `openssl enc ${eng_param} -e -$p{-alg} -K $p{-key} -iv $p{-iv} -in test$count.clear`;
+       is($?,0,"$p{-name} - encrypt successful");
+       is(unpack("H*",$ctext),$p{-ciphertext},"$p{-name} - ciphertext expected");
+       open my $f, ">", "test$count.enc";
+       print $f $ctext;
+       close $f;
+       my $otext = `openssl enc ${eng_param} -d -$p{-alg} -K $p{-key} -iv $p{-iv} -in test$count.enc`;
+       is($?,0,"$p{-name} - decrypt successful");
+       is($otext,$p{-cleartext},"$p{-name} - decrypted correctly");
+       unlink "test$count.enc";
+       unlink "test$count.clear";
+       delete $ENV{'CRYPT_PARAMS'};
+}
+
+$key = '0123456789ABCDEF' x 4;
+$iv =  '0000000000000000';
+$clear1 = "The quick brown fox jumps over the lazy dog\n";
+
+crypt_test(-paramset=> "1.2.643.2.2.31.1", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => '07f4102c6185c4a09e676e269bfa4bc9c5df6575916b879bd13a893a2285ee6690107cdeef7a315d2eb54bfa', 
+                  -alg => 'gost89',
+                  -name=> 'CFB short text, paramset A');
+
+crypt_test(-paramset=> "1.2.643.2.2.31.2", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => '11465c1c9708033e784fbb5536f2719c38353cb488b01f195c20d4c027022e8300d98bb66c138afbe878c88b', 
+                  -alg => 'gost89',
+                  -name=> 'CFB short text, paramset B');
+
+crypt_test(-paramset=> "1.2.643.2.2.31.3", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => '2f213b390c9b6ceb18de479686d23f4f03c76644a0aab8894b50b71a3bbb3c027ec4c2d569ba0e6a873bd46e', 
+                  -alg => 'gost89',
+                  -name=> 'CFB short text, paramset C');
+
+crypt_test(-paramset=> "1.2.643.2.2.31.4", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => 'e835f59a7fdfd84764efe1e987660327f5d0de187afea72f9cd040983a5e5bbeb4fe1aa5ff85d623ebc4d435', 
+                  -alg => 'gost89',
+                  -name=> 'CFB short text, paramset D');
+
+
+crypt_test(-paramset=> "1.2.643.2.2.31.1", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => 'bcb821452e459f10f92019171e7c3b27b87f24b174306667f67704812c07b70b5e7420f74a9d54feb4897df8', 
+                  -alg => 'gost89-cnt',
+                  -name=> 'CNT short text');
+
+crypt_test(-paramset=> "1.2.643.2.2.31.2", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => 'bcb821452e459f10f92019171e7c3b27b87f24b174306667f67704812c07b70b5e7420f74a9d54feb4897df8', 
+                  -alg => 'gost89-cnt',
+                  -name=> 'CNT short text, paramset param doesnt affect cnt');
+
+                  
+crypt_test(-paramset=> "1.2.643.2.2.31.1", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => 'cf3f5f713b3d10abd0c6f7bafb6aaffe13dfc12ef5c844f84873aeaaf6eb443a9747c9311b86f97ba3cdb5c4',
+                  -alg => 'gost89-cnt-12',
+                  -name=> 'CNT-12 short text');
+
+crypt_test(-paramset=> "1.2.643.2.2.31.2", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => 'cf3f5f713b3d10abd0c6f7bafb6aaffe13dfc12ef5c844f84873aeaaf6eb443a9747c9311b86f97ba3cdb5c4',
+                  -alg => 'gost89-cnt-12',
+                  -name=> 'CNT-12 short text, paramset param doesnt affect cnt');
+
+
+crypt_test(-paramset=> "1.2.643.2.2.31.1", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => '3a3293e75089376572da44966cd1759c29d2f1e5e1c3fa9674909a63026da3dc51a4266bff37fb74a3a07155c9ca8fcf', 
+                  -alg => 'gost89-cbc',
+                  -name=> 'CBC short text, paramset A');
+
+
+crypt_test(-paramset=> "1.2.643.2.2.31.2", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => 'af2a2167b75852378af176ac9950e3c4bffc94d3d4355191707adbb16d6c8e3f3a07868c4702babef18393edfac60a6d', 
+                  -alg => 'gost89-cbc',
+                  -name=> 'CBC short text, paramset B');
+
+crypt_test(-paramset=> "1.2.643.2.2.31.3", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => '987c0fb3d84530467a1973791e0a25e33c5d14591976f8c1573bdb9d056eb7b353f66fef3ffe2e3524583b3997123c8a', 
+                  -alg => 'gost89-cbc',
+                  -name=> 'CBC short text, paramset C');
+
+crypt_test(-paramset=> "1.2.643.2.2.31.4", -key => $key, -iv => $iv,
+                  -cleartext => $clear1,
+                  -ciphertext => 'e076b09822d4786a2863125d16594d765d8acd0f360e52df42e9d52c8e6c0e6595b5f6bbecb04a22c8ae5f4f87c1523b', 
+                  -alg => 'gost89-cbc',
+                  -name=> 'CBC short text, paramset D');
+
+unlink "test.cnf";
diff --git a/test/04-pkey.t b/test/04-pkey.t
new file mode 100644 (file)
index 0000000..84ae81e
--- /dev/null
@@ -0,0 +1,163 @@
+#!/usr/bin/perl
+use Test::More tests => 15;
+use Cwd 'abs_path';
+
+#
+# If this variable is set, engine would be loaded via configuration
+# file. Otherwise - via command line
+# 
+$use_config = 1;
+
+# prepare data for 
+
+
+# Set OPENSSL_ENGINES environment variable to just built engine
+if(!defined $ENV{'OPENSSL_ENGINES'}){
+        $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
+}
+
+$engine=$ENV{'ENGINE_NAME'}||"gost";
+
+# Reopen STDERR to eliminate extra output
+open STDERR, ">>","tests.err";
+
+
+open F,">","test.cnf";
+if (defined($use_config) && $use_config) {
+       $eng_param = "";
+       open F,">","test.cnf";
+       print F <<EOCFG;
+openssl_conf = openssl_def
+[openssl_def]
+engines = engines
+[engines]
+${engine}=gost_conf
+[gost_conf]
+default_algorithms = ALL
+
+EOCFG
+} else {
+       $eng_param = "-engine $engine"
+}
+close F;
+$ENV{'OPENSSL_CONF'}=abs_path('test.cnf');
+
+
+@keys=(['gost2001','A',"-----BEGIN PRIVATE KEY-----
+MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIgIgRhUDJ1WQASIf
+nx+aUM2eagzV9dCt6mQ5wdtenr2ZS/Y=
+-----END PRIVATE KEY-----
+","Private key: 46150327559001221F9F1F9A50CD9E6A0CD5F5D0ADEA6439C1DB5E9EBD994BF6
+","Public key:
+   X:789094AF6386A43AF191210FFED0AEA5D1D9750D8FF8BCD1B584BFAA966850E4
+   Y:25ED63EE42624403D08FC60E5F8130F121ECDC5E297D9E3C7B106C906E0855E9
+Parameter set: id-GostR3410-2001-CryptoPro-A-ParamSet
+","-----BEGIN PUBLIC KEY-----
+MGMwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEDQwAEQORQaJaqv4S10bz4
+jw112dGlrtD+DyGR8TqkhmOvlJB46VUIbpBsEHs8nn0pXtzsIfEwgV8Oxo/QA0Ri
+Qu5j7SU=
+-----END PUBLIC KEY-----
+"],
+['gost2001','B'=>'-----BEGIN PRIVATE KEY-----
+MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwIGByqFAwICHgEEIgIgImwnCcqcfuXK
+MVYg+UWQhiXYKz1yQ8kDSB7Ly515XH4=
+-----END PRIVATE KEY-----
+','Private key: 226C2709CA9C7EE5CA315620F945908625D82B3D7243C903481ECBCB9D795C7E
+','Public key:
+   X:59C15439385CBE790274D6537D318A35B27413D265FFDC5FBE5354DF8C7AC591
+   Y:11B771AC016AA817542184D05F2C7DDD0F9A5A5C9F840A79B5B7A73658F3048A
+Parameter set: id-GostR3410-2001-CryptoPro-B-ParamSet
+','-----BEGIN PUBLIC KEY-----
+MGMwHAYGKoUDAgITMBIGByqFAwICIwIGByqFAwICHgEDQwAEQJHFeozfVFO+X9z/
+ZdITdLI1ijF9U9Z0Anm+XDg5VMFZigTzWDant7V5CoSfXFqaD919LF/QhCFUF6hq
+AaxxtxE=
+-----END PUBLIC KEY-----
+'],
+['gost2001','C'=>'-----BEGIN PRIVATE KEY-----
+MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwMGByqFAwICHgEEIgIgKKUJVY2xlp24
+mky1F9inWeq3mm0J/uza6HsDvspgSzY=
+-----END PRIVATE KEY-----
+','Private key: 28A509558DB1969DB89A4CB517D8A759EAB79A6D09FEECDAE87B03BECA604B36
+','Public key:
+   X:58154320380CCFD2A101D2B7844516984023CF5A38610C4F98220E017270B2D4
+   Y:14C6977A6E9C0412DF5B53E69CD48DAF2B5805F55F6ACBEB4E01BA7B2BF84FC8
+Parameter set: id-GostR3410-2001-CryptoPro-C-ParamSet
+','-----BEGIN PUBLIC KEY-----
+MGMwHAYGKoUDAgITMBIGByqFAwICIwMGByqFAwICHgEDQwAEQNSycHIBDiKYTwxh
+OFrPI0CYFkWEt9IBodLPDDggQxVYyE/4K3u6AU7ry2pf9QVYK6+N1JzmU1vfEgSc
+bnqXxhQ=
+-----END PUBLIC KEY-----
+'],
+['gost2001','XA'=>,'-----BEGIN PRIVATE KEY-----
+MEUCAQAwHAYGKoUDAgITMBIGByqFAwICJAAGByqFAwICHgEEIgIgOFuMMveKUx/C
+BOSjl9XCepDCHWHv/1bcjdKexKGJkZw=
+-----END PRIVATE KEY-----
+','Private key: 385B8C32F78A531FC204E4A397D5C27A90C21D61EFFF56DC8DD29EC4A189919C
+','Public key:
+   X:FA969CB29310E897978A1C9245107B46499D5C14A3975BF8E10EF5F613BE4EC6
+   Y:17FCFACCB0F838AE730E8B4021E880937824214DFF5365A61576AC5E72F92E35
+Parameter set: id-GostR3410-2001-CryptoPro-XchA-ParamSet
+','-----BEGIN PUBLIC KEY-----
+MGMwHAYGKoUDAgITMBIGByqFAwICJAAGByqFAwICHgEDQwAEQMZOvhP29Q7h+FuX
+oxRcnUlGexBFkhyKl5foEJOynJb6NS75cl6sdhWmZVP/TSEkeJOA6CFAiw5zrjj4
+sMz6/Bc=
+-----END PUBLIC KEY-----
+'],
+['gost2001','XB'=>,'-----BEGIN PRIVATE KEY-----
+MEUCAQAwHAYGKoUDAgITMBIGByqFAwICJAEGByqFAwICHgEEIgIgE7WWqiYWoKLs
+7ezZ8L8Q9JcT73Jf5NYfFnlnoKRIQGg=
+-----END PRIVATE KEY-----
+','Private key: 13B596AA2616A0A2ECEDECD9F0BF10F49713EF725FE4D61F167967A0A4484068
+','Public key:
+   X:1D33A01774E501EFADD6C7A936728AF644749E98FEF5AE77A25E185955ED2E14
+   Y:FAD2D8101A99EDE8FBDF118B70A9894F4E6DE962B68D27E39B057624A51727
+Parameter set: id-GostR3410-2001-CryptoPro-XchB-ParamSet
+','-----BEGIN PUBLIC KEY-----
+MGMwHAYGKoUDAgITMBIGByqFAwICJAEGByqFAwICHgEDQwAEQBQu7VVZGF6id671
+/piedET2inI2qcfWre8B5XQXoDMdJxelJHYFm+MnjbZi6W1OT4mpcIsR3/vo7Zka
+ENjS+gA=
+-----END PUBLIC KEY-----
+']
+);
+for $keyinfo (@keys) {
+       my ($alg,$paramset,$seckey,$sectext,$pubtext,$pubkey) = @$keyinfo;
+       open F,">",'tmp.pem';
+       print F $seckey;
+       close F;
+       #1.  Прочитать секретный ключ и напечатать публичный и секретный ключи
+       is(`openssl pkey -noout -text -in tmp.pem`,$sectext . $pubtext,
+               "Print key pair $alg:$paramset");
+       #2. Прочитать секретный ключ и вывести публичный (все алгоритмы)
+    is(`openssl pkey -pubout -in tmp.pem`,$pubkey,
+               "Compute public key $alg:$paramset");
+       open F,">","tmp.pem";
+       print F $pubkey;
+       close F;
+       #3. Прочитать публичный и напечать его в виде текста
+       is(`openssl pkey -pubin -noout -in tmp.pem -text`,$pubtext,
+               "Read and print public key $alg:paramset");
+
+}
+unlink "tmp.pem";
+#4. Сгенерировать ключ два раза (для всех алгоритов и параметров).
+# Проверить что получились числа требуемой длины и они не совпадают
+
+
+#5. Проверить эталонную подпись
+
+#6. Выработать подпись и проверить её
+
+#7. Выработать подпись, поменять в ней один бит и убедиться что она
+# перестала проверяться
+
+# 8. Выработать подпись, поменять 1 бит в подписываемых данных и
+# убедитсья, что подпись перестала быть корректной.
+
+# 9. Выработать shared ключ по vko
+
+# 10. Разобрать стандартый encrypted key
+
+# 11. Сгенерирвоать encrypted key и его разобрать.
+
+unlink "test.cnf";
+
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644 (file)
index 0000000..2a00f54
--- /dev/null
@@ -0,0 +1,4 @@
+PERL=@PERL@
+
+test: 
+       $(PERL) ./run_tests
diff --git a/test/run_tests b/test/run_tests
new file mode 100644 (file)
index 0000000..ad93e3f
--- /dev/null
@@ -0,0 +1,5 @@
+#!/usr/bin/perl
+use TAP::Harness;
+
+my $harness = TAP::Harness->new();
+$harness->runtests(glob("*.t"));