]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test_sign.c
tests: Load just built engine from the output directory
[openssl-gost/engine.git] / test_sign.c
index 4a63f420f0535c6e4d5c8b47d15d8bbacac88162..1d0058164f14bfda18fa93f0f44f0aebc7f00c45 100644 (file)
@@ -236,14 +236,21 @@ int main(int argc, char **argv)
 {
     int ret = 0;
 
-    setenv("OPENSSL_CONF", "../example.conf", 0);
+    setenv("OPENSSL_ENGINES", ENGINE_DIR, 0);
     OPENSSL_add_all_algorithms_conf();
     ERR_load_crypto_strings();
+    ENGINE *eng;
+    T(eng = ENGINE_by_id("gost"));
+    T(ENGINE_init(eng));
+    T(ENGINE_set_default(eng, ENGINE_METHOD_ALL));
 
     struct test_sign *sp;
     for (sp = test_signs; sp->name; sp++)
        ret |= test_sign(sp);
 
+    ENGINE_finish(eng);
+    ENGINE_free(eng);
+
     if (ret)
        printf(cDRED "= Some tests FAILED!\n" cNORM);
     else