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