From: Vitaly Chikunov Date: Sun, 19 Dec 2021 22:35:58 +0000 (+0300) Subject: Output provider info X-Git-Tag: v3.0.1~15 X-Git-Url: https://wagner.pp.ru/gitweb/?a=commitdiff_plain;ds=inline;h=e847cc4876d2b105b119e0db1e4166d266642a66;hp=b85ad0f1bf5be3684c2243e0c1fc09464f244b26;p=openssl-gost%2Fengine.git Output provider info Output something in `openssl list -providers` so it's merrier. Signed-off-by: Vitaly Chikunov --- diff --git a/gost_prov.c b/gost_prov.c index 390275c..b4de15f 100644 --- a/gost_prov.c +++ b/gost_prov.c @@ -8,6 +8,7 @@ **********************************************************************/ #include +#include #include "gost_prov.h" #include "gost_lcl.h" #include "prov/err.h" /* libprov err functions */ @@ -99,6 +100,15 @@ static const OSSL_ALGORITHM *gost_operation(void *vprovctx, static int gost_get_params(void *provctx, OSSL_PARAM *params) { + OSSL_PARAM *p; + + p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_NAME); + if (p != NULL && !OSSL_PARAM_set_utf8_ptr(p, "OpenSSL GOST Provider")) + return 0; + p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_STATUS); + if (p != NULL && !OSSL_PARAM_set_int(p, 1)) /* We never fail. */ + return 0; + return 1; } diff --git a/test/00-provider.t b/test/00-provider.t index 85ad249..b35d1e3 100644 --- a/test/00-provider.t +++ b/test/00-provider.t @@ -9,6 +9,8 @@ my $provider = 'gostprov'; my $provider_info = <