summaryrefslogtreecommitdiffstats
path: root/crypto/store/store_strings.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-12-08 15:51:31 +0100
committerRichard Levitte <levitte@openssl.org>2017-06-29 11:55:31 +0200
commit71a5516dcc8a91a9c4fbb724ea7e3658e85f2ad2 (patch)
treeba9b278594053af5efeb2af40d64ffb43007eabe /crypto/store/store_strings.c
parentc785fd48e68611c837f4e30027c02b84525501af (diff)
Add the STORE module
This STORE module adds the following functionality: - A function OSSL_STORE_open(), OSSL_STORE_load() and OSSL_STORE_close() that accesses a URI and helps loading the supported objects (PKEYs, CERTs and CRLs for the moment) from it. - An opaque type OSSL_STORE_INFO that holds information on each loaded object. - A few functions to retrieve desired data from a OSSL_STORE_INFO reference. - Functions to register and unregister loaders for different URI schemes. This enables dynamic addition of loaders from applications or from engines. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)
Diffstat (limited to 'crypto/store/store_strings.c')
-rw-r--r--crypto/store/store_strings.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/store/store_strings.c b/crypto/store/store_strings.c
new file mode 100644
index 0000000000..76cf316483
--- /dev/null
+++ b/crypto/store/store_strings.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/store.h>
+
+static char *type_strings[] = {
+ "Name", /* OSSL_STORE_INFO_NAME */
+ "Parameters", /* OSSL_STORE_INFO_PARAMS */
+ "Pkey", /* OSSL_STORE_INFO_PKEY */
+ "Certificate", /* OSSL_STORE_INFO_CERT */
+ "CRL" /* OSSL_STORE_INFO_CRL */
+};
+
+const char *OSSL_STORE_INFO_type_string(int type)
+{
+ int types = sizeof(type_strings) / sizeof(type_strings[0]);
+
+ if (type < 1 || type > types)
+ return NULL;
+
+ return type_strings[type - 1];
+}