]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_md.c
Produce correct GOST signatures
[openssl-gost/engine.git] / gost_md.c
index 54a2fe511f4912a12bb0b573c03edb32a76088c0..c088f8608995e719e9aa6158b497305dc3c33379 100644 (file)
--- a/gost_md.c
+++ b/gost_md.c
@@ -27,10 +27,12 @@ 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,
-                                             sizeof(struct ossl_gost_digest_ctx))
+                                             sizeof(struct
+                                                    ossl_gost_digest_ctx))
             || !EVP_MD_meth_set_init(md, gost_digest_init)
             || !EVP_MD_meth_set_update(md, gost_digest_update)
             || !EVP_MD_meth_set_final(md, gost_digest_final)
@@ -84,6 +86,7 @@ int gost_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
 int gost_digest_cleanup(EVP_MD_CTX *ctx)
 {
     if (EVP_MD_CTX_md_data(ctx))
-        memset(EVP_MD_CTX_md_data(ctx), 0, sizeof(struct ossl_gost_digest_ctx));
+        memset(EVP_MD_CTX_md_data(ctx), 0,
+               sizeof(struct ossl_gost_digest_ctx));
     return 1;
 }