summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2019-08-19 09:18:33 +1000
committerShane Lontis <shane.lontis@oracle.com>2019-08-19 09:18:33 +1000
commit25e601445ae244ed623b2f5d6b28788488d87663 (patch)
treefe5c8cc5d0d9e828de208626a316e922dec258ff /include
parent5e0d9c861bc44070c61b9b109884dc8aa5e2e8d1 (diff)
Add fips provider code for handling self test data
More PR's related to self test will be derived from this PR. Note: the code removed in core_get_params() was causing a freeze since the fips module was being loaded from a config file, which then called core_get_params() which then tried to init the config fle again... Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9596)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/core_names.h5
-rw-r--r--include/openssl/core_numbers.h12
-rw-r--r--include/openssl/fips_names.h46
3 files changed, 63 insertions, 0 deletions
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h
index e2d16be964..c1bc3a7d7b 100644
--- a/include/openssl/core_names.h
+++ b/include/openssl/core_names.h
@@ -34,6 +34,11 @@ extern "C" {
*/
#define OSSL_PROV_PARAM_BUILDINFO "buildinfo"
+/*
+ * The module filename
+ * Type: OSSL_PARAM_OCTET_STRING
+ */
+#define OSSL_PROV_PARAM_MODULE_FILENAME "module-filename"
/* cipher parameters */
#define OSSL_CIPHER_PARAM_PADDING "padding" /* int */
diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h
index ad8b345f87..95cfe46a2d 100644
--- a/include/openssl/core_numbers.h
+++ b/include/openssl/core_numbers.h
@@ -118,6 +118,18 @@ OSSL_CORE_MAKE_FUNC(int,
OSSL_CORE_MAKE_FUNC(void,
OPENSSL_cleanse, (void *ptr, size_t len))
+/* Bio functions provided by the core */
+#define OSSL_FUNC_BIO_NEW_FILE 22
+#define OSSL_FUNC_BIO_NEW_MEMBUF 23
+#define OSSL_FUNC_BIO_READ 24
+#define OSSL_FUNC_BIO_FREE 25
+
+OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_file, (const char *filename, const char *mode))
+OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_membuf, (const void *buf, int len))
+OSSL_CORE_MAKE_FUNC(int, BIO_read, (BIO *bio, void *data, size_t data_len,
+ size_t *bytes_read))
+OSSL_CORE_MAKE_FUNC(int, BIO_free, (BIO *bio))
+
/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
# define OSSL_FUNC_PROVIDER_TEARDOWN 1024
OSSL_CORE_MAKE_FUNC(void,provider_teardown,(void *provctx))
diff --git a/include/openssl/fips_names.h b/include/openssl/fips_names.h
new file mode 100644
index 0000000000..28226f5f88
--- /dev/null
+++ b/include/openssl/fips_names.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (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
+ */
+
+#ifndef OSSL_FIPS_NAMES_H
+# define OSSL_FIPS_NAMES_H
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/*
+ * Parameter names that the FIPS Provider defines
+ */
+
+/*
+ * The calculated MAC of the module file (Used for FIPS Self Testing)
+ * Type: OSSL_PARAM_UTF8_STRING
+ */
+# define OSSL_PROV_FIPS_PARAM_MODULE_MAC "module-checksum"
+/*
+ * A version number for the fips install process (Used for FIPS Self Testing)
+ * Type: OSSL_PARAM_UTF8_STRING
+ */
+# define OSSL_PROV_FIPS_PARAM_INSTALL_VERSION "install-version"
+/*
+ * The calculated MAC of the install status indicator (Used for FIPS Self Testing)
+ * Type: OSSL_PARAM_UTF8_STRING
+ */
+# define OSSL_PROV_FIPS_PARAM_INSTALL_MAC "install-checksum"
+/*
+ * The install status indicator (Used for FIPS Self Testing)
+ * Type: OSSL_PARAM_UTF8_STRING
+ */
+# define OSSL_PROV_FIPS_PARAM_INSTALL_STATUS "install-status"
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif /* OSSL_FIPS_NAMES_H */