]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Output provider info
authorVitaly Chikunov <vt@altlinux.org>
Sun, 19 Dec 2021 22:35:58 +0000 (01:35 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Mon, 20 Dec 2021 09:34:13 +0000 (12:34 +0300)
Output something in `openssl list -providers` so it's merrier.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
gost_prov.c
test/00-provider.t

index 390275c5eaaad4ef85ba41eef76f5a12d58884ec..b4de15fe1e4974197bc6dbf2c7e33b1490a513ca 100644 (file)
@@ -8,6 +8,7 @@
  **********************************************************************/
 
 #include <openssl/core_dispatch.h>
+#include <openssl/core_names.h>
 #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;
 }
 
index 85ad249670660adb3db94c47ad9a74633cde48d5..b35d1e3281b02fbbfc7864f2fc9b44623d6b1241 100644 (file)
@@ -9,6 +9,8 @@ my $provider = 'gostprov';
 my $provider_info = <<EOINF;
 Providers:
   gostprov
+    name: OpenSSL GOST Provider
+    status: active
 EOINF
 
 # Normally, this test recipe tests the default GOST provider.  However, it's