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