X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=test_tls.c;h=1e805c3e67118d57a18a1f381f9c0ccbd14794a6;hb=b85ad0f1bf5be3684c2243e0c1fc09464f244b26;hp=216fb2a8f263d5922a70d1f2733134011f841057;hpb=8fff4a245e57cd2e3479a35cf5a8be534bee5e1c;p=openssl-gost%2Fengine.git diff --git a/test_tls.c b/test_tls.c index 216fb2a..1e805c3 100644 --- a/test_tls.c +++ b/test_tls.c @@ -8,6 +8,11 @@ * See https://www.openssl.org/source/license.html for details */ +#ifdef _MSC_VER +# pragma warning(push, 3) +# include +# pragma warning(pop) +#endif #include "e_gost_err.h" #include "gost_lcl.h" #include @@ -30,20 +35,22 @@ #include #include +#ifdef __GNUC__ /* For X509_NAME_add_entry_by_txt */ -#pragma GCC diagnostic ignored "-Wpointer-sign" - -#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; \ - } \ - }) +# pragma GCC diagnostic ignored "-Wpointer-sign" +#endif + +#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" @@ -355,13 +362,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)); char *p; if ((p = getenv("VERBOSE"))) @@ -377,9 +378,6 @@ int main(int argc, char **argv) ret |= test("gost2012_512", "B"); ret |= test("gost2012_512", "C"); - ENGINE_finish(eng); - ENGINE_free(eng); - if (ret) printf(cDRED "= Some tests FAILED!\n" cNORM); else