]> wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_md2012.c
Add perl test harness to CMakeLists to run on make test
[openssl-gost/engine.git] / gost_md2012.c
index 712e0acd88a8db7e1fe8f7b501717a69450dd520..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))
@@ -161,9 +163,7 @@ static int gost_digest_ctrl_512(EVP_MD_CTX *ctx, int type, int arg, void *ptr)
                 strcpy(*((char **)ptr), micalg_512);
                 return 1;
             }
-            return 0;
         }
-        return 1;
     default:
         return 0;
     }