]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_eng.c
Merge pull request #105 from vt-alt/test_params
[openssl-gost/engine.git] / gost_eng.c
index 1cac94430e344e0cdcd604740ee29d89449a3e66..74fe13e205209c984c5d6e146875d67cec425256 100644 (file)
@@ -122,6 +122,8 @@ static int gost_engine_finish(ENGINE* e) {
 }
 
 static int gost_engine_destroy(ENGINE* e) {
+    EVP_delete_digest_alias("streebog256");
+    EVP_delete_digest_alias("streebog512");
     digest_gost_destroy();
     digest_gost2012_256_destroy();
     digest_gost2012_512_destroy();
@@ -162,7 +164,7 @@ static int gost_engine_destroy(ENGINE* e) {
     return 1;
 }
 
-static int bind_gost(ENGINE* e, const char* id) {
+int bind_gost(ENGINE* e, const char* id) {
     int ret = 0;
     if (id != NULL && strcmp(id, engine_gost_id) != 0)
         return 0;
@@ -293,6 +295,11 @@ static int bind_gost(ENGINE* e, const char* id) {
         goto end;
     }
 
+    if(!EVP_add_digest_alias(SN_id_GostR3411_2012_256, "streebog256")
+       ||      !EVP_add_digest_alias(SN_id_GostR3411_2012_512, "streebog512")) {
+        goto end;
+    }
+
     ENGINE_register_all_complete();
 
     ERR_load_GOST_strings();