summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-02-11 02:33:18 +0100
committerRichard Levitte <levitte@openssl.org>2018-02-23 07:40:42 +0100
commit072bfcc90b6f7c206e39339da519567c4460250c (patch)
tree899396acb974ca8b9c4f0df23268b1ad12ac0aa8 /include
parent4eefdbda815c2cd76d788049c839e90a5ac6b843 (diff)
STORE: Add the possibility to specify an expected info type
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2688)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/store.h9
-rw-r--r--include/openssl/storeerr.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/include/openssl/store.h b/include/openssl/store.h
index ff42953e6c..d4222512f7 100644
--- a/include/openssl/store.h
+++ b/include/openssl/store.h
@@ -151,6 +151,12 @@ const char *OSSL_STORE_INFO_type_string(int type);
*/
void OSSL_STORE_INFO_free(OSSL_STORE_INFO *info);
+/*
+ * Add expected return type (which can be unspecified) to the loading channel.
+ * This MUST happen before the first STORE_load().
+ */
+int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type);
+
/*-
* Function to register a loader for the given URI scheme.
@@ -177,6 +183,9 @@ typedef int (*OSSL_STORE_ctrl_fn)(OSSL_STORE_LOADER_CTX *ctx, int cmd,
va_list args);
int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *loader,
OSSL_STORE_ctrl_fn ctrl_function);
+typedef int (*OSSL_STORE_expect_fn)(OSSL_STORE_LOADER_CTX *ctx, int expected);
+int OSSL_STORE_LOADER_set_expect(OSSL_STORE_LOADER *loader,
+ OSSL_STORE_expect_fn expect_function);
typedef OSSL_STORE_INFO *(*OSSL_STORE_load_fn)(OSSL_STORE_LOADER_CTX *ctx,
const UI_METHOD *ui_method,
void *ui_data);
diff --git a/include/openssl/storeerr.h b/include/openssl/storeerr.h
index 5476d007bd..864a9070e3 100644
--- a/include/openssl/storeerr.h
+++ b/include/openssl/storeerr.h
@@ -26,6 +26,7 @@ int ERR_load_OSSL_STORE_strings(void);
# define OSSL_STORE_F_FILE_NAME_TO_URI 126
# define OSSL_STORE_F_FILE_OPEN 120
# define OSSL_STORE_F_OSSL_STORE_ATTACH_PEM_BIO 127
+# define OSSL_STORE_F_OSSL_STORE_EXPECT 130
# define OSSL_STORE_F_OSSL_STORE_FILE_ATTACH_PEM_BIO_INT 128
# define OSSL_STORE_F_OSSL_STORE_GET0_LOADER_INT 100
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CERT 101
@@ -60,6 +61,7 @@ int ERR_load_OSSL_STORE_strings(void);
# define OSSL_STORE_R_INVALID_SCHEME 106
# define OSSL_STORE_R_IS_NOT_A 112
# define OSSL_STORE_R_LOADER_INCOMPLETE 116
+# define OSSL_STORE_R_LOADING_STARTED 117
# define OSSL_STORE_R_NOT_A_CERTIFICATE 100
# define OSSL_STORE_R_NOT_A_CRL 101
# define OSSL_STORE_R_NOT_A_KEY 102