]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test_params.c
MSVC: Fix include files
[openssl-gost/engine.git] / test_params.c
index 4e6317e796995b0f40e4b0a4f8b74c240e32dfe4..e0947e28c109f57efaaba1e906494416b05d355b 100644 (file)
 #include <openssl/safestack.h>
 #include <string.h>
 
-#define T(e) ({ if (!(e)) { \
-               ERR_print_errors_fp(stderr); \
-               OpenSSLDie(__FILE__, __LINE__, #e); \
-           } \
-        })
-#define TE(e) ({ if (!(e)) { \
-               ERR_print_errors_fp(stderr); \
-               fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \
-               return -1; \
-           } \
-        })
+#define T(e) \
+    if (!(e)) { \
+        ERR_print_errors_fp(stderr); \
+        OpenSSLDie(__FILE__, __LINE__, #e); \
+    }
+#define TE(e) \
+    if (!(e)) { \
+        ERR_print_errors_fp(stderr); \
+        fprintf(stderr, "Error at %s:%d %s\n", __FILE__, __LINE__, #e); \
+        return -1; \
+    }
 
 #define cRED   "\033[1;31m"
 #define cDRED  "\033[0;31m"
@@ -1127,7 +1127,7 @@ static int test_param(struct test_param *t)
        T(mdtype = EVP_get_digestbynid(hash_nid));
        T(EVP_VerifyInit(md_ctx, mdtype));
        /* Feed byte-by-byte. */
-       int i;
+       size_t i;
        for (i = 0; i < t->data_len; i++)
            T(EVP_VerifyUpdate(md_ctx, &t->data[i], 1));
        err = EVP_VerifyFinal(md_ctx, sig, siglen, pkey);
@@ -1160,13 +1160,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));
 
     struct test_param **tpp;
     for (tpp = test_params; *tpp; tpp++)
@@ -1176,9 +1170,6 @@ int main(int argc, char **argv)
     for (tc = test_certs; tc->cert; tc++)
        ret |= test_cert(tc);
 
-    ENGINE_finish(eng);
-    ENGINE_free(eng);
-
     if (ret)
        printf(cDRED "= Some tests FAILED!" cNORM "\n");
     else