]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test_derive.c
Modify .github/before_script.sh to install cpanm as a standalone script
[openssl-gost/engine.git] / test_derive.c
index b9f60ed2a5733096d00b83585998fe30721cfd8c..c99ccef5acbbb0383349a213cbc55541ff4a18a2 100644 (file)
@@ -31,9 +31,9 @@
 #define cCYAN   "\033[1;36m"
 #define cNORM   "\033[m"
 #define TEST_ASSERT(e) {if ((test = (e))) \
-                 printf(cRED "  Test FAILED\n" cNORM); \
+                 printf(cRED "  Test FAILED" cNORM "\n"); \
              else \
-                 printf(cGREEN "  Test passed\n" cNORM);}
+                 printf(cGREEN "  Test passed" cNORM "\n");}
 
 #ifndef OSSL_NELEM
 # define OSSL_NELEM(x) (sizeof(x)/sizeof((x)[0]))
@@ -185,7 +185,7 @@ static EVP_PKEY *load_private_key(int key_nid, int param_nid, const char *pk,
             printf("Public key %08x matches private key %08x\n",
                    *(int *)pub, *(int *)pk);
         else {
-            printf(cRED "Public key mismatch!\n" cNORM);
+            printf(cRED "Public key mismatch!" cNORM "\n");
             exit(1);
         }
         EC_POINT_free(xy);
@@ -364,13 +364,7 @@ int main(int argc, char **argv)
 {
     int ret = 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));
 
     int i;
     for (i = 0; i < OSSL_NELEM(derive_tests); i++)
@@ -389,13 +383,10 @@ int main(int argc, char **argv)
         ret |= test_derive_alg("gost2012_512", "C", i);
     }
 
-    ENGINE_finish(eng);
-    ENGINE_free(eng);
-
     if (ret)
-        printf(cDRED "= Some tests FAILED!\n" cNORM);
+        printf(cDRED "= Some tests FAILED!" cNORM "\n");
     else
-        printf(cDGREEN "= All tests passed!\n" cNORM);
+        printf(cDGREEN "= All tests passed!" cNORM "\n");
     return ret;
 }
 /* vim: set expandtab cinoptions=\:0,l1,t0,g0,(0 sw=4 : */