usr/src/lib/openssl/README
author Cyril Plisko <cyril.plisko@grigale.com>
Tue, 06 Apr 2010 16:00:14 +0300
changeset 11 87960ed158f9
parent 4 834920bc5f09
child 44 6135d8b0a676
permissions -rw-r--r--
Import sfw build 137 Bugs Fixed ---------- 6926835 Wireshark cannot open files typed into the location bar 6930214 CVE-2010-0624: Heap-based buffer overflow in GNU Tar 6933424 Various sfw manual pages need to be adjusted to use the new OpenSolaris package names. 6937764 upgrade OpenSSL to 0.9.8n (and fix CVE-2010-0740)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     1
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     2
Build Layout
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     3
---
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     4
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     5
OpenSSL is built twice. Once for "fips" and once for "non-fips". Both
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     6
the fips and non-fips builds share Patches and Configure-time options
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     7
where possible. It is very important that they are ABI compatible. All
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     8
the common patches are contained in the Patches sub-directory and common
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     9
configuration is taken from Makefile.com in the top-level openssl
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    10
directory. If a particular build requires a modification which is not
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    11
common to both builds then the patch is kept in the build specific
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    12
sub-directory.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    13
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    14
In addition to the regular Makefile targets both the fips and non-fips
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    15
builds have the following targets:
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    16
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    17
all32
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    18
all64
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    19
install32
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    20
install64
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    21
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    22
This makes building any subset easy.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    23
i.e. to build and install the 64bit non-fips OpenSSL the following
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    24
command is used:
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    25
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    26
$ cd openssl/non-fips
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    27
$ make install64
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    28
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    29
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    30
The fips Build
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    31
---
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    32
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    33
The "fips" build has the following deliverables (symbolic links and
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    34
architecture specific binaries are excluded):
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    35
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    36
/lib/openssl/fips-140/libcrypto.so.0.9.8
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    37
/usr/include/openssl/fips-140/openssl/fips.h
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    38
/usr/include/openssl/fips-140/openssl/fips_rand.h
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    39
/usr/include/openssl/fips-140/openssl/opensslconf.h
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    40
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    41
A build-time requirement for the fips build is the FIPS Object Module.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    42
The FIPS Object Module has very stringent build requirements as
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    43
specified in its Security Policy:
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    44
http://www.openssl.org/docs/fips/SecurityPolicy-1.2.pdf
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    45
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    46
In essence the FIPS Object Module may not be patched or modified in any
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    47
way, the build must be performed with "./config [no-asm], make, 
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    48
make install". The only way to influence the build is by modifying the
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    49
environment it is run in. isalist is "faked" so that the 32bit build can
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    50
be built even when running with a 64bit kernel (see isalist.sh). make is
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    51
run by a wrapper script so that "make install" can be run even as a
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    52
non-root user (see make.sh).  If modifications are to be make to how the
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    53
FIPS Object Module is built the security policy must be consulted to
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    54
ensure that the build is still compliant.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    55
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    56
The non-fips Build.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    57
---
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    58
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    59
The "non-fips" build is the main build of OpenSSL and includes the
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    60
regular binaries, libraries and header files. The openssl binary from
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    61
this build is patched to work with both the fips build of libcrypto and
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    62
the non-fips build of libcrypto.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    63
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    64
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    65
Patches
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    66
---
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    67
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    68
08-6193522.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    69
Give CA.pl better defaults. See 6193522 for more information.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    70
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    71
11-6546806.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    72
Make sure the HMAC_CTX_init(3) man page gets delivered. See 6546806 for
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    73
more information.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    74
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    75
14-manpage_openssl.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    76
Force openssl to install man pages into man[1357]openssl instead of
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    77
man[1357].
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    78
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    79
15-pkcs11_engine-0.9.8a.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    80
Patch which adds the pkcs11 engine. See also the pkcs11-engine/
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    81
sub-directory. 
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    82
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    83
18-compiler_opts.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    84
Adds four Solaris specific configurations (both 32bit and 64bit for both
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    85
sparc and x86) to Configure which are then explicitly used by the
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    86
Makefiles.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    87
Care should be taken if modifying this patch as changes to compile-time
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    88
options can change the ABI. One example of this is the use of RC4_INT vs
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    89
RC4_CHAR.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    90
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    91
20-remove_rpath.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    92
Prevent build binaries having an unnecessary runpath (/lib).
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    93
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    94
23-noexstack.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    95
Build with non-executable stacks and non-executable data (x86).
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    96
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    97
25-fips_rand.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    98
fips_rand.h assumes that des.h will be found in the same directory. This
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    99
is probably normally true however we deliver the FIPS specific header
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   100
files into a non-standard location (see above) and so is not true for
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   101
Solaris. This patch makes sure that des.h is found by changing
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   102
fips_rand.h to look in the system header files for openssl/des.h.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   103
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   104
26-openssl_fips.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   105
Modifies openssl so that it will run with the non-fips libcrypto as well
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   106
as the fips libcrypto. If it is run with the fips libcrypto it can be
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   107
run in FIPS mode. Instead of directly using the FIPS specific symbols
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   108
they are looked up at runtime. This is necessary as the non-fips
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   109
libcrypto won't have the those FIPS specific symbols.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   110
The CRYPTO_NUM_LOCKS pre-processor macro varies between the fips and
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   111
non-fips build of libcrypto. A run-time mechanism is available which
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   112
returns the number of locks - the CRYPTO_num_locks() function. Using
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   113
this function is required if the openssl binary is to be run with both
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   114
the fips and non-fips versions of libcrypto. 
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   115
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   116
opensslconf.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   117
Modifies opensslconf.h so that it is suitable for both 32bit and 64bit
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   118
installs. OpenSSL either builds for 32bit or 64bit - it doesn't allow
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   119
for combined 32bit and 64bit builds.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   120
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   121
sparc-01-ccwrap.patch
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   122
A sparc only patch which modifies fipsld for the FIPS Capable OpenSSL
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   123
build by replacing calls to CC with CCWRAP. CCRWAP (ccwrap.sh) simply
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   124
runs the original CC command without the "-g" option.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   125
From the patch:
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   126
# Wrap the calls to cc to remove the "-g" option when compiling
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   127
# (SPARC only). If "-g" is used on SPARC to build libcrypto.so
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   128
# the fingerprint will be incorrectly generated as "-g" promotes
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   129
# static symbols to globals which then interacts with the linker to
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   130
# produce a changed text section.
8f1801a322e9 Import sfw build 128
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
   131