From: Vitaly Chikunov Date: Sat, 9 May 2020 19:47:24 +0000 (+0300) Subject: test: List untested digests and ciphers X-Git-Tag: v3.0.0~122^2~6 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=cded1d0aa04a386faa3778d0b029c78abd996e93;p=openssl-gost%2Fengine.git test: List untested digests and ciphers It's good to know what needs to be done. --- diff --git a/test_ciphers.c b/test_ciphers.c index 95e3e99..15c7511 100644 --- a/test_ciphers.c +++ b/test_ciphers.c @@ -24,6 +24,7 @@ #define cGREEN "\033[1;32m" #define cDGREEN "\033[0;32m" #define cBLUE "\033[1;34m" +#define cMAGENT "\033[1;35m" #define cDBLUE "\033[0;34m" #define cNORM "\033[m" #define TEST_ASSERT(e) {if ((test = (e))) \ @@ -490,6 +491,19 @@ int main(int argc, char **argv) t->iv, t->iv_size, t->acpkm); } + ENGINE_CIPHERS_PTR fn_c; + T(fn_c = ENGINE_get_ciphers(eng)); + const int *nids; + int n, k; + n = fn_c(eng, NULL, &nids, 0); + for (k = 0; k < n; ++k) { + for (t = testcases; t->nid; t++) + if (t->nid == nids[k]) + break; + if (!t->nid) + printf(cMAGENT "Cipher %s is untested!\n" cNORM, OBJ_nid2sn(nids[k])); + } + ENGINE_finish(eng); ENGINE_free(eng); diff --git a/test_digest.c b/test_digest.c index ce7f60a..7ad999a 100644 --- a/test_digest.c +++ b/test_digest.c @@ -47,6 +47,7 @@ #define cDGREEN "\033[0;32m" #define cBLUE "\033[1;34m" #define cDBLUE "\033[0;34m" +#define cMAGENT "\033[1;35m" #define cNORM "\033[m" #define TEST_ASSERT(e) {if ((test = (e))) \ printf(cRED " Test FAILED\n" cNORM); \ @@ -726,6 +727,19 @@ int main(int argc, char **argv) ret |= do_synthetic_test(tv); } + ENGINE_DIGESTS_PTR fn_c; + T(fn_c = ENGINE_get_digests(eng)); + const int *nids; + int n, k; + n = fn_c(eng, NULL, &nids, 0); + for (k = 0; k < n; ++k) { + for (tv = testvecs; tv->nid; tv++) + if (tv->nid == nids[k]) + break; + if (!tv->nid) + printf(cMAGENT "Digest %s is untested!\n" cNORM, OBJ_nid2sn(nids[k])); + } + ENGINE_finish(eng); ENGINE_free(eng);