GH975 Add ex_data functions for X509_STORE
authorKazuki Yamaguchi <k@rhe.jp>
Tue, 19 Apr 2016 01:22:15 +0000 (10:22 +0900)
committerRich Salz <rsalz@openssl.org>
Wed, 27 Apr 2016 12:23:53 +0000 (08:23 -0400)
Add X509_STORE_{set,get}_ex_data() function and
X509_STORE_get_ex_new_index() macro.

X509_STORE has ex_data and the documentation also mentions them but they
are not actually implemented.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/x509/x509_lu.c
include/openssl/x509_vfy.h

index b8229662030903300aa1bdae0f3124e41c996596..92c25996a76b25c114bd1ef05698f196b8b4e548 100644 (file)
@@ -743,6 +743,16 @@ void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
     ctx->lookup_crls = cb;
 }
 
+int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data)
+{
+    return CRYPTO_set_ex_data(&ctx->ex_data, idx, data);
+}
+
+void *X509_STORE_get_ex_data(X509_STORE *ctx, int idx)
+{
+    return CRYPTO_get_ex_data(&ctx->ex_data, idx);
+}
+
 X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx)
 {
     return ctx->ctx;
index f357d1a66a157dabdd96af2e200da52f07311067..6df09ebf0d09c123af6a565cf205a96a24b73322 100644 (file)
@@ -292,6 +292,10 @@ void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
                                    STACK_OF(X509_CRL) *(*cb) (X509_STORE_CTX
                                                               *ctx,
                                                               X509_NAME *nm));
+#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
+    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef)
+int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data);
+void *X509_STORE_get_ex_data(X509_STORE *ctx, int idx);
 
 X509_STORE_CTX *X509_STORE_CTX_new(void);