]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_prov.c
MSVC: Fix casting warning C4057
[openssl-gost/engine.git] / gost_prov.c
index e7fdd967d2b0856fc197929694c7b4f8b98b7d94..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;
 }
 
@@ -143,6 +153,7 @@ struct prov_ctx_st {
 # define OSSL_provider_init GOST_provider_init
 #endif
 
+OPENSSL_EXPORT
 int OSSL_provider_init(const OSSL_CORE_HANDLE *core,
                        const OSSL_DISPATCH *in,
                        const OSSL_DISPATCH **out,