#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");}
struct test_param {
unsigned int param; /* NID of EC parameters */
static void print_test_result(int err)
{
if (err == 1)
- printf(cGREEN "correct\n" cNORM);
+ printf(cGREEN "correct" cNORM "\n");
else if (err == 0)
- printf(cRED "incorrect\n" cNORM);
+ printf(cRED "incorrect" cNORM "\n");
else
ERR_print_errors_fp(stderr);
}
int hash_nid = 0;
const char *sn = OBJ_nid2sn(t->param);
- printf(cBLUE "Test %s (cp):\n" cNORM, sn);
+ printf(cBLUE "Test %s (cp):" cNORM "\n", sn);
switch (t->len) {
case 256 / 8:
{
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++)
for (tc = test_certs; tc->cert; tc++)
ret |= test_cert(tc);
- 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;
}