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