]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Produce correct GOST signatures
authorVitaly Chikunov <vt@altlinux.org>
Thu, 19 Jul 2018 00:58:06 +0000 (03:58 +0300)
committerVitaly Chikunov <vt@altlinux.org>
Fri, 20 Jul 2018 00:32:15 +0000 (03:32 +0300)
Offset commit 7f572e958b13041056f377a62d3219633cfb1e8a
Old openssl still needs EVP_MD_FLAG_PKEY_METHOD_SIGNATURE flag to be
set.

gost_md.c
gost_md2012.c

index 5d2c537a7acd95ef49f626490d71ce11014ed00d..c088f8608995e719e9aa6158b497305dc3c33379 100644 (file)
--- a/gost_md.c
+++ b/gost_md.c
@@ -27,6 +27,7 @@ EVP_MD *digest_gost(void)
         EVP_MD *md;
 
         if ((md = EVP_MD_meth_new(NID_id_GostR3411_94, NID_undef)) == NULL
+           || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_PKEY_METHOD_SIGNATURE)
             || !EVP_MD_meth_set_result_size(md, 32)
             || !EVP_MD_meth_set_input_blocksize(md, 32)
             || !EVP_MD_meth_set_app_datasize(md,
index 5acb111d3f20a798acc8b87999111fbe576c4ec9..9385b080c908c9df0426d76b1fdb65f719206cc4 100644 (file)
@@ -37,6 +37,7 @@ EVP_MD *digest_gost2012_256(void)
 
         if ((md =
              EVP_MD_meth_new(NID_id_GostR3411_2012_256, NID_undef)) == NULL
+           || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_PKEY_METHOD_SIGNATURE)
             || !EVP_MD_meth_set_result_size(md, 32)
             || !EVP_MD_meth_set_input_blocksize(md, 64)
             || !EVP_MD_meth_set_app_datasize(md, sizeof(gost2012_hash_ctx))
@@ -67,6 +68,7 @@ EVP_MD *digest_gost2012_512(void)
 
         if ((md =
              EVP_MD_meth_new(NID_id_GostR3411_2012_512, NID_undef)) == NULL
+           || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_PKEY_METHOD_SIGNATURE)
             || !EVP_MD_meth_set_result_size(md, 64)
             || !EVP_MD_meth_set_input_blocksize(md, 64)
             || !EVP_MD_meth_set_app_datasize(md, sizeof(gost2012_hash_ctx))