OSSL_STORE: Add OSSL_STORE_vctrl()
authorRichard Levitte <levitte@openssl.org>
Wed, 14 Feb 2018 09:28:08 +0000 (10:28 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 14 Feb 2018 19:11:06 +0000 (20:11 +0100)
It's a convenient complement to OSSL_STORE_ctrl()

Suggested by Norm Green

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/5363)

crypto/store/store_lib.c
include/openssl/store.h
util/libcrypto.num

index 2cc247d12ed1eac10a21a11c6baea536ec34727b..24876a3f40192cb9343cbfe733f9d2ef449aa2fd 100644 (file)
@@ -109,16 +109,22 @@ OSSL_STORE_CTX *OSSL_STORE_open(const char *uri, const UI_METHOD *ui_method,
 int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd, ...)
 {
     va_list args;
 int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd, ...)
 {
     va_list args;
-    int ret = 0;
+    int ret;
 
     va_start(args, cmd);
 
     va_start(args, cmd);
-    if (ctx->loader->ctrl != NULL)
-        ret = ctx->loader->ctrl(ctx->loader_ctx, cmd, args);
+    ret = OSSL_STORE_vctrl(ctx, cmd, args);
     va_end(args);
 
     return ret;
 }
 
     va_end(args);
 
     return ret;
 }
 
+int OSSL_STORE_vctrl(OSSL_STORE_CTX *ctx, int cmd, va_list args)
+{
+    if (ctx->loader->ctrl != NULL)
+        return ctx->loader->ctrl(ctx->loader_ctx, cmd, args);
+    return 0;
+}
+
 OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx)
 {
     OSSL_STORE_INFO *v = NULL;
 OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx)
 {
     OSSL_STORE_INFO *v = NULL;
index 8ec2edc8efb270aaac085b9f3e610a049c016e00..ff42953e6cb0dcb91b489f606ef734b28093a4f1 100644 (file)
@@ -58,6 +58,7 @@ OSSL_STORE_CTX *OSSL_STORE_open(const char *uri, const UI_METHOD *ui_method,
  * Each command takes different arguments.
  */
 int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd, ... /* args */);
  * Each command takes different arguments.
  */
 int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd, ... /* args */);
+int OSSL_STORE_vctrl(OSSL_STORE_CTX *ctx, int cmd, va_list args);
 
 /*
  * Common ctrl commands that different loaders may choose to support.
 
 /*
  * Common ctrl commands that different loaders may choose to support.
index c7be54087cf27e6babf310618b04ea595b8b950b..c4384e6de7d1802f0e0235a47ab6151443468aae 100644 (file)
@@ -4505,3 +4505,4 @@ RAND_DRBG_lock                          4446      1_1_1   EXIST::FUNCTION:
 RAND_DRBG_unlock                        4447   1_1_1   EXIST::FUNCTION:
 RAND_DRBG_enable_locking                4448   1_1_1   EXIST::FUNCTION:
 RAND_DRBG_secure_new                    4449   1_1_1   EXIST::FUNCTION:
 RAND_DRBG_unlock                        4447   1_1_1   EXIST::FUNCTION:
 RAND_DRBG_enable_locking                4448   1_1_1   EXIST::FUNCTION:
 RAND_DRBG_secure_new                    4449   1_1_1   EXIST::FUNCTION:
+OSSL_STORE_vctrl                        4450   1_1_1   EXIST::FUNCTION: