X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=test_sign.c;h=63ae3b56877d5ffdabcf88f52d2f737c672c7793;hb=ede3886cc5507c2ba000ab9b057f198da03e8766;hp=0322ac024d25de634000fca746b0eaba1fc8d907;hpb=a42d467935d3ce859e288f3934df2e25073f9ba9;p=openssl-gost%2Fengine.git diff --git a/test_sign.c b/test_sign.c index 0322ac0..63ae3b5 100644 --- a/test_sign.c +++ b/test_sign.c @@ -7,6 +7,11 @@ * See https://www.openssl.org/source/license.html for details */ +#ifdef _MSC_VER +# pragma warning(push, 3) +# include +# pragma warning(pop) +#endif #include "gost_lcl.h" #include #include @@ -20,17 +25,17 @@ #include #include -#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" @@ -47,7 +52,7 @@ struct test_sign { const char *name; - unsigned int nid; + int nid; size_t bits; const char *paramset; }; @@ -116,6 +121,9 @@ static int test_sign(struct test_sign *t) case 512: type = NID_id_GostR3410_2012_512; algname = "gost2012_512"; + break; + default: + return -1; } /* Keygen. */ @@ -239,7 +247,7 @@ static int test_sign(struct test_sign *t) const EC_GROUP *group = EC_KEY_get0_group(ec); int curve_name = EC_GROUP_get_curve_name(group); err = curve_name == t->nid; - printf("\tcurve_name (%u):\t", t->nid); + printf("\tcurve_name (%d):\t", t->nid); print_test_tf(err, curve_name, "match", "mismatch"); ret |= !err;