Add the provider_algs.h internal header file
authorMatt Caswell <matt@openssl.org>
Wed, 3 Apr 2019 15:39:34 +0000 (16:39 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 19 Apr 2019 08:31:54 +0000 (09:31 +0100)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8700)

build.info
providers/build.info
providers/common/ciphers/aes.c
providers/common/digests/sha2.c
providers/common/include/internal/provider_algs.h [new file with mode: 0644]
providers/default/defltprov.c

index a0ecb21881637a2c998a8cfbae4e244a36cbe379..ce5dfd055d6bb0d8359ee1d6c8535bc4a867ea5e 100644 (file)
@@ -3,7 +3,7 @@
 SUBDIRS=crypto ssl apps test util tools fuzz engines providers
 
 LIBS=libcrypto libssl
-INCLUDE[libcrypto]=. crypto/include include
+INCLUDE[libcrypto]=. crypto/include include providers/common/include
 INCLUDE[libssl]=. include
 DEPEND[libssl]=libcrypto
 
index 1628e1feb4ba5f52996051e54df3114b4ff3780c..ef107a7334f93cd39e4ca7dc27fced3b2ea3cc04 100644 (file)
@@ -7,7 +7,7 @@ IF[{- !$disabled{fips} -}]
     SOURCE[fips]=fips.ld
     GENERATE[fips.ld]=../util/providers.num
   ENDIF
-  INCLUDE[fips]=.. ../include ../crypto/include
+  INCLUDE[fips]=.. ../include ../crypto/include common/include
   DEFINE[fips]=FIPS_MODE
 ENDIF
 
index 8559d26238c71fe1ceb6b83b9859c59865591ad8..a73f20cd73bf5a2d4c00b96910f2f7bd53e303f3 100644 (file)
@@ -14,6 +14,7 @@
 #include <openssl/evp.h>
 #include <openssl/params.h>
 #include "internal/cryptlib.h"
+#include "internal/provider_algs.h"
 #include "ciphers_locl.h"
 
 static void PROV_AES_KEY_generic_init(PROV_AES_KEY *ctx,
@@ -195,7 +196,6 @@ static int aes_set_params(void *vctx, const OSSL_PARAM params[])
     return 1;
 }
 
-extern const OSSL_DISPATCH aes256ecb_functions[];
 const OSSL_DISPATCH aes256ecb_functions[] = {
     { OSSL_FUNC_CIPHER_NEWCTX, (void (*)(void))aes_256_ecb_newctx },
     { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void))aes_einit },
index 2a0ae64671ef109d6ba20c17ad62889885c439e0..c9f616db68b6c09327815071cfc7401dcc833510 100644 (file)
@@ -10,6 +10,7 @@
 #include <openssl/sha.h>
 #include <openssl/crypto.h>
 #include <openssl/core_numbers.h>
+#include "internal/provider_algs.h"
 
 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -73,7 +74,6 @@ static size_t sha256_block_size(void)
     return SHA256_CBLOCK;
 }
 
-extern const OSSL_DISPATCH sha256_functions[];
 const OSSL_DISPATCH sha256_functions[] = {
     { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))sha256_newctx },
     { OSSL_FUNC_DIGEST_INIT, (void (*)(void))SHA256_Init },
diff --git a/providers/common/include/internal/provider_algs.h b/providers/common/include/internal/provider_algs.h
new file mode 100644 (file)
index 0000000..4e0fc55
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * 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
+ */
+
+/* Digests */
+extern const OSSL_DISPATCH sha256_functions[];
+
+/* Ciphers */
+extern const OSSL_DISPATCH aes256ecb_functions[];
index dcc70800dbd51f89aa232953cc6c6905b216bec0..5cfbf695c73b57dbebe775cb5c69a18ed18c0524 100644 (file)
@@ -13,6 +13,7 @@
 #include <openssl/core_numbers.h>
 #include <openssl/core_names.h>
 #include <openssl/params.h>
+#include "internal/provider_algs.h"
 
 /* Functions provided by the core */
 static OSSL_core_get_param_types_fn *c_get_param_types = NULL;
@@ -49,15 +50,11 @@ static int deflt_get_params(const OSSL_PROVIDER *prov,
     return 1;
 }
 
-extern const OSSL_DISPATCH sha256_functions[];
-
 static const OSSL_ALGORITHM deflt_digests[] = {
     { "SHA256", "default=yes", sha256_functions },
     { NULL, NULL, NULL }
 };
 
-extern const OSSL_DISPATCH aes256ecb_functions[];
-
 static const OSSL_ALGORITHM deflt_ciphers[] = {
     { "AES-256-ECB", "default=yes", aes256ecb_functions },
     { NULL, NULL, NULL }