summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-04-09 14:39:54 +0200
committerRichard Levitte <levitte@openssl.org>2019-04-23 15:51:39 +0200
commit0109e030db9207a47e195b4c3a3b13e9017f0ed2 (patch)
tree835826a1f94de53d09cb15c8752ce428ffdd0b46 /include
parentAdd the possibility to display and use MODULESDIR (diff)
downloadopenssl-0109e030db9207a47e195b4c3a3b13e9017f0ed2.tar.xz
openssl-0109e030db9207a47e195b4c3a3b13e9017f0ed2.zip
Add a way for the application to get OpenSSL configuration data
OpenSSL_version(OPENSSL_DIR) gives you a nicely formatted string for display, but if all you really want is the directory itself, you were forced to parsed the string. This introduces a new function to get diverse configuration data from the library, OPENSSL_info(). This works the same way as OpenSSL_version(), but has its own series of types, currently including: OPENSSL_INFO_CONFIG_DIR returns OPENSSLDIR OPENSSL_INFO_ENGINES_DIR returns ENGINESDIR OPENSSL_INFO_MODULES_DIR returns MODULESDIR OPENSSL_INFO_DSO_EXTENSION returns DSO_EXTENSION OPENSSL_INFO_DIR_FILENAME_SEPARATOR returns directory/filename separator OPENSSL_INFO_LIST_SEPARATOR returns list separator For scripting purposes, this also adds the command 'openssl info'. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8709)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/crypto.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h
index 80786c8461..a7e78e4caf 100644
--- a/include/openssl/crypto.h
+++ b/include/openssl/crypto.h
@@ -165,6 +165,18 @@ const char *OpenSSL_version(int type);
# define OPENSSL_FULL_VERSION_STRING 7
# define OPENSSL_MODULES_DIR 8
+const char *OPENSSL_info(int type);
+/*
+ * The series starts at 1001 to avoid confusion with the OpenSSL_version
+ * types.
+ */
+# define OPENSSL_INFO_CONFIG_DIR 1001
+# define OPENSSL_INFO_ENGINES_DIR 1002
+# define OPENSSL_INFO_MODULES_DIR 1003
+# define OPENSSL_INFO_DSO_EXTENSION 1004
+# define OPENSSL_INFO_DIR_FILENAME_SEPARATOR 1005
+# define OPENSSL_INFO_LIST_SEPARATOR 1006
+
int OPENSSL_issetugid(void);
typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,