Makefile revision 7101
235N/A#
235N/A# CDDL HEADER START
822N/A#
822N/A# The contents of this file are subject to the terms of the
822N/A# Common Development and Distribution License (the "License").
235N/A# You may not use this file except in compliance with the License.
1252N/A#
235N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
235N/A# or http://www.opensolaris.org/os/licensing.
919N/A# See the License for the specific language governing permissions
919N/A# and limitations under the License.
919N/A#
919N/A# When distributing Covered Code, include this CDDL HEADER in each
919N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
919N/A# If applicable, add the following below this CDDL HEADER, with the
919N/A# fields enclosed by brackets "[]" replaced with your own identifying
919N/A# information: Portions Copyright [yyyy] [name of copyright owner]
919N/A#
919N/A# CDDL HEADER END
919N/A#
919N/A
919N/A#
919N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
919N/A#
919N/A
919N/A#
235N/A# This component is not to be installed. It is used to build FIPS-140
235N/A# certified OpenSSL libraries.
235N/A#
822N/A
235N/Ainclude ../../../make-rules/shared-macros.mk
970N/A
970N/ACOMPONENT_NAME = openssl-fips
970N/ACOMPONENT_VERSION = 2.0.13
970N/ACOMPONENT_SRC = $(COMPONENT_NAME)-$(COMPONENT_VERSION)
970N/ACOMPONENT_ARCHIVE = $(COMPONENT_SRC).tar.gz
970N/ACOMPONENT_ARCHIVE_HASH= \
970N/A sha256:3ff723f93901f750779a2e67ff15985c357f1a15c892c9504446fbc85c6f77da
1003N/ACOMPONENT_ARCHIVE_URL = http://www.openssl.org/source/$(COMPONENT_ARCHIVE)
970N/ACOMPONENT_BUGDB= library/openssl
235N/A
1252N/Ainclude $(WS_MAKE_RULES)/prep.mk
235N/Ainclude $(WS_MAKE_RULES)/configure.mk
911N/A
1252N/APATH=$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin:/usr/perl5/bin
1252N/A
911N/A# In order to build a 32bit version on a 64bit system the isalist(1) command
235N/A# must be substituted for the 32bit build so that amd64|sparcv9 is not part of
493N/A# its output. isalist is used internally when configuring the canister before
493N/A# building it. In order to allow make install to be run as a no-op we have to
235N/A# fake "make install" since we do not want to install the files anywhere. The
235N/A# command sets U1 and U2 are defined in the FIPS 2.0.5 security policy and must be
235N/A# run as shown there. Nothing from the tarball can be modified. We use the U2
235N/A# command set, see below.
822N/AFAKE_ISALIST = 32/isalist 64/isalist
235N/AFAKE_MAKE = fips-gmake
1124N/AFAKE_CC = cc
1124N/AFAKE_APPS = $(FAKE_ISALIST) $(FAKE_MAKE) $(FAKE_CC)
1124N/A
235N/ACLEAN_PATHS += $(FAKE_APPS)
1252N/A
235N/A# Do not use $(PWD), it would not work if run from a different directory with
235N/A# "gmake -C" as we do from openssl-default
235N/A# we'll also pick up gcc if we find it in the path, so force it to
235N/A# find one that doesn't work like it wants
1124N/AFIPS_PATH_32 = $(COMPONENT_DIR)/32:$(COMPONENT_DIR)/gcc:$(PATH)
1265N/AFIPS_PATH_64 = $(COMPONENT_DIR)/64:$(COMPONENT_DIR)/gcc:$(PATH)
1124N/A
1124N/A# HMAC-SHA-1 digest of the OpenSSL FIPS tar file is used for the
1124N/A# integrity test requirement for the FIPS-140 validation.
1124N/A# Note: COMPONENT_ARCHIVE_HASH is a SHA256 digest used by the Userland
822N/A# Consolidation to check the file integrity.
822N/AOPENSSL_FIPS_HMAC_KEY = etaonrishdlcupfm
981N/AOPENSSL_FIPS_HMAC = 26f923491458df77a1f4c6ce39fef2f5bea88cd5
235N/A
1124N/A# There is a broken link in the tarball which causes cp(1) to fail which would
1124N/A# fail the whole configure process. It's safer to get rid of the link than
1124N/A# adding "true" at the end of COMPONENT_PRE_CONFIGURE_ACTION since that could
970N/A# hide real issues.
970N/ACOMPONENT_PRE_CONFIGURE_ACTION = ( cd $(@D); \
970N/A $(RM) $(SOURCE_DIR)/test/fips_aes_data; $(CP) -r $(SOURCE_DIR)/* .; )
970N/A
970N/A# There is a specific way that must be followed to build the FIPS-140 canister.
970N/A# It is "./config fipscanisterbuild; make; make install" and is called a command
970N/A# set "U2" in the OpenSSL FIPS-140 User Guide.
947N/Aifeq ($(MACH), sparc)
235N/ACONFIGURE_SCRIPT_32 = config
247N/A# For 64-bit, use './Configure fipscanisterbuild solaris64-sparcv9-cc'.
947N/ACONFIGURE_SCRIPT_64 = ./Configure
235N/ACONFIGURE_OPTIONS.64 = solaris64-sparcv9-cc
247N/ACONFIGURE_SCRIPT = $(CONFIGURE_SCRIPT_$(BITS))
947N/Aelse
947N/ACONFIGURE_SCRIPT = config
970N/Aendif
970N/A
947N/ACONFIGURE_OPTIONS = fipscanisterbuild
947N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
947N/ACOMPONENT_BUILD_ARGS =
947N/ACOMPONENT_BUILD_TARGETS =
947N/ACOMPONENT_INSTALL_ARGS =
947N/ACOMPONENT_INSTALL_TARGETS = install
235N/A# Ignore default CC_FOR_BUILD, CC, and CXX in CONFIGURE_ENV.
241N/ACONFIGURE_ENV += CC_FOR_BUILD=
493N/ACONFIGURE_ENV += CC=
493N/ACONFIGURE_ENV += CXX=
235N/ACONFIGURE_ENV += FIPS_SITE_LD=$(LD) PATH=$(FIPS_PATH_$(BITS))
493N/A# Add COMPONENT_DIR to PATH so cc wrapper can be found.
493N/ACOMPONENT_BUILD_ENV += FIPS_SITE_LD=$(LD) REALCC=$(CC) MYMAKE=$(MAKE) PATH=$(COMPONENT_DIR):$(PATH)
1124N/A
963N/A$(BUILD_32_and_64): $(FAKE_APPS)
1124N/A
1124N/A# You should not use this target with this component unless testing or
1097N/A# debugging. The OpenSSL FIPS-140 policy is strict and full U2 command set
493N/A# should be run. See above for more information.
1097N/Aconfigure: $(CONFIGURE_32_and_64)
1097N/A
493N/Abuild: $(BUILD_32_and_64)
235N/A
1124N/A# We must make the "install" target a no-op (but must run it to be compliant).
1124N/A# See above for more information.
1124N/Ainstall: GMAKE = $(COMPONENT_DIR)/fips-gmake
1124N/Ainstall: $(BUILD_DIR_32)/.verified $(BUILD_DIR_64)/.verified
1124N/A
1124N/A# This is a recommended set of commands to verify that the FIPS-140 mode can be
1124N/A# used and that we used the correct tarball.
1124N/A$(BUILD_DIR)/%/.verified: $(BUILD_DIR)/%/.installed
1124N/A (printf x; \
1124N/A $(ENV) - OPENSSL_FIPS=1 LD_LIBRARY_PATH=/lib/openssl/fips-140/64 \
970N/A /lib/openssl/fips-140/openssl sha1 -hmac $(OPENSSL_FIPS_HMAC_KEY) \
970N/A $(COMPONENT_ARCHIVE)) | \
970N/A $(NAWK) '{ if ($$2 != "$(OPENSSL_FIPS_HMAC)") exit 1 }'
1097N/A @echo Basic FIPS-140 mode verification passed.
1097N/A $(TOUCH) $@
1097N/A
1030N/Atest: $(NO_TESTS)
822N/A
235N/Asystem-test: $(NO_TESTS)
235N/A
822N/A