+int engine_is_available(const char *name)
+{
+ ENGINE *e = ENGINE_get_first();
+
+ while (e != NULL) {
+ if (strcmp(ENGINE_get_id(e), name) == 0)
+ break;
+ e = ENGINE_get_next(e);
+ }
+ ENGINE_free(e);
+ return 0;
+}
+
+void warn_if_untested(const EVP_CIPHER *ciph, void *provider)
+{
+ const struct testcase *t;
+
+ /* ENGINE provided EVP_MDs have a NULL provider */
+ if (provider != EVP_CIPHER_get0_provider(ciph))
+ return;
+
+ for (t = testcases; t->algname; t++)
+ if (EVP_CIPHER_is_a(ciph, t->algname))
+ break;
+ if (!t->algname)
+ printf(cMAGENT "Cipher %s is untested!" cNORM "\n", EVP_CIPHER_name(ciph));
+}
+
+void warn_all_untested(void)
+{
+ if (engine_is_available("gost")) {
+ ENGINE *eng;
+
+ T(eng = ENGINE_by_id("gost"));
+ T(ENGINE_init(eng));
+
+ 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)
+ warn_if_untested(ENGINE_get_cipher(eng, nids[k]), NULL);
+ ENGINE_finish(eng);
+ ENGINE_free(eng);
+ }
+ if (OSSL_PROVIDER_available(NULL, "gostprov")) {
+ OSSL_PROVIDER *prov;
+
+ T(prov = OSSL_PROVIDER_load(NULL, "gostprov"));
+ EVP_CIPHER_do_all_provided(NULL,
+ (void (*)(EVP_CIPHER *, void *))warn_if_untested,
+ prov);
+
+ OSSL_PROVIDER_unload(prov);
+ }
+}
+