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