]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test_context.c
Now that there is an actual openssl-3.0 branch, switch to use that
[openssl-gost/engine.git] / test_context.c
index 2348f59c7037e597fc0e854124dd4c1710b86e2b..1e284c0689fab2879fdcb0039a2d966b766d55e4 100644 (file)
@@ -28,9 +28,9 @@
 #define cDBLUE "\033[0;34m"
 #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");}
 
 static void hexdump(const void *ptr, size_t len)
 {
@@ -61,7 +61,7 @@ static int test_contexts_cipher(int nid, const int enc, int acpkm)
     const EVP_CIPHER *type = EVP_get_cipherbynid(nid);
     const char *name = EVP_CIPHER_name(type);
 
-    printf(cBLUE "%s test for %s (nid %d)\n" cNORM,
+    printf(cBLUE "%s test for %s (nid %d)" cNORM "\n",
        enc ? "Encryption" : "Decryption", name, nid);
 
     /* produce base encryption */
@@ -137,7 +137,7 @@ static int test_contexts_digest(int nid, int mac)
     const EVP_MD *type = EVP_get_digestbynid(nid);
     const char *name = EVP_MD_name(type);
 
-    printf(cBLUE "Digest test for %s (nid %d)\n" cNORM, name, nid);
+    printf(cBLUE "Digest test for %s (nid %d)" cNORM "\n", name, nid);
 
     /* produce base digest */
     EVP_MD_CTX *ctx, *save;
@@ -245,13 +245,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));
 
     const struct testcase_cipher *tc;
     for (tc = testcases_ciphers; tc->nid; tc++) {
@@ -263,12 +257,9 @@ int main(int argc, char **argv)
        ret |= test_contexts_digest(td->nid, td->mac);
     }
 
-    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;
 }