Fix no-cmac
authorMatt Caswell <matt@openssl.org>
Wed, 28 Aug 2019 14:46:26 +0000 (15:46 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 29 Aug 2019 11:03:30 +0000 (12:03 +0100)
Don't include files that we don't want to build

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9718)

providers/common/macs/build.info
providers/common/macs/cmac_prov.c
providers/fips/fipsprov.c

index 6bd17291a6c85f68800ce94caed978a2f0af06ea..832a1e76ecfc5051c17b2889055b12f0079644de 100644 (file)
@@ -1,4 +1,8 @@
-$COMMON=cmac_prov.c gmac_prov.c hmac_prov.c kmac_prov.c
+$COMMON=gmac_prov.c hmac_prov.c kmac_prov.c
+
+IF[{- !$disabled{cmac} -}]
+  $COMMON=$COMMON cmac_prov.c
+ENDIF
 
 LIBS=../../../libcrypto
 SOURCE[../../../libcrypto]=$COMMON
index 693423130dd59ff0c6792bd2662b151aacee8d85..f63f405abf9020f02c71dd5ed62fa691e70ba36d 100644 (file)
@@ -7,18 +7,15 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_CMAC
+#include <openssl/core_numbers.h>
+#include <openssl/core_names.h>
+#include <openssl/params.h>
+#include <openssl/engine.h>
+#include <openssl/evp.h>
+#include <openssl/cmac.h>
 
-# include <openssl/core_numbers.h>
-# include <openssl/core_names.h>
-# include <openssl/params.h>
-# include <openssl/engine.h>
-# include <openssl/evp.h>
-# include <openssl/cmac.h>
-
-# include "internal/provider_algs.h"
-# include "internal/provider_ctx.h"
+#include "internal/provider_algs.h"
+#include "internal/provider_ctx.h"
 
 /*
  * Forward declaration of everything implemented here.  This is not strictly
@@ -256,5 +253,3 @@ const OSSL_DISPATCH cmac_functions[] = {
     { OSSL_FUNC_MAC_SET_CTX_PARAMS, (void (*)(void))cmac_set_ctx_params },
     { 0, NULL }
 };
-
-#endif
index 9a7193bb4f4010cb02df6d87f59d62e90fdc8d9e..f8f0a90c249734fb21836da2c84a66b667cfeeca 100644 (file)
@@ -332,7 +332,9 @@ static const OSSL_ALGORITHM fips_ciphers[] = {
 };
 
 static const OSSL_ALGORITHM fips_macs[] = {
+#ifndef OPENSSL_NO_CMAC
     { "CMAC", "fips=yes", cmac_functions },
+#endif
     { "GMAC", "fips=yes", gmac_functions },
     { "HMAC", "fips=yes", hmac_functions },
     { "KMAC128", "fips=yes", kmac128_functions },