summaryrefslogtreecommitdiffstats
path: root/include/internal/property.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-06-01 20:02:24 +0200
committerPauli <pauli@openssl.org>2021-06-05 20:29:47 +1000
commit6ec3b2cf4992a304b4ab36f7b9e9ff130bd495b7 (patch)
tree348097b950d9bc6de530d93dfe8f0c70cc8bd983 /include/internal/property.h
parent0b3fe363e6188dcb854d480180c9af91cc613f2c (diff)
property: Add functionality to query data from a property definition
This required making some OSSL_PROPERTY types a little less private. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15570)
Diffstat (limited to 'include/internal/property.h')
-rw-r--r--include/internal/property.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/internal/property.h b/include/internal/property.h
index 856cd740ad..bcea21d80c 100644
--- a/include/internal/property.h
+++ b/include/internal/property.h
@@ -17,6 +17,12 @@
typedef struct ossl_method_store_st OSSL_METHOD_STORE;
typedef struct ossl_property_list_st OSSL_PROPERTY_LIST;
+typedef enum {
+ OSSL_PROPERTY_TYPE_STRING, OSSL_PROPERTY_TYPE_NUMBER,
+ OSSL_PROPERTY_TYPE_VALUE_UNDEFINED
+} OSSL_PROPERTY_TYPE;
+typedef struct ossl_property_definition_st OSSL_PROPERTY_DEFINITION;
+
/* Initialisation */
int ossl_property_parse_init(OSSL_LIB_CTX *ctx);
@@ -33,6 +39,15 @@ int ossl_property_is_enabled(OSSL_LIB_CTX *ctx, const char *property_name,
/* Free a parsed property list */
void ossl_property_free(OSSL_PROPERTY_LIST *p);
+/* Get a property from a property list */
+const OSSL_PROPERTY_DEFINITION *
+ossl_property_find_property(const OSSL_PROPERTY_LIST *list,
+ OSSL_LIB_CTX *libctx, const char *name);
+OSSL_PROPERTY_TYPE ossl_property_get_type(const OSSL_PROPERTY_DEFINITION *prop);
+const char *ossl_property_get_string_value(OSSL_LIB_CTX *libctx,
+ const OSSL_PROPERTY_DEFINITION *prop);
+int64_t ossl_property_get_number_value(const OSSL_PROPERTY_DEFINITION *prop);
+
/* Implementation store functions */
OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx);