components/openssl/README
author jenny.yung@oracle.com <jenny.yung@oracle.com>
Wed, 07 May 2014 15:49:55 -0700
changeset 1884 d1a47da60382
parent 1680 49cf3ba424f0
child 1911 17096cac036b
permissions -rw-r--r--
17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random 18713629 openssl-t4-inline.sparc-patch shouldn't be sparc only
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     1
#
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     2
# CDDL HEADER START
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     3
#
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     7
#
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    11
# and limitations under the License.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    12
#
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    18
#
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    19
# CDDL HEADER END
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    20
#
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
    21
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    22
#
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    23
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    24
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    25
Build Layout
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    26
---
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    27
1596
59869c4257d0 PSARC/2013/383 OpenSSL FIPS 140-2 version update
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1587
diff changeset
    28
OpenSSL build is run four times. Once for regular dynamic 1.0.1 non-fips, once 
59869c4257d0 PSARC/2013/383 OpenSSL FIPS 140-2 version update
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1587
diff changeset
    29
for static 1.0.1 bits to link with standalone wanboot binary, once for 1.0.1
59869c4257d0 PSARC/2013/383 OpenSSL FIPS 140-2 version update
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1587
diff changeset
    30
fips-140, and once for 1.0.1 FIPS-140 canister (in the openssl-fips component)
59869c4257d0 PSARC/2013/383 OpenSSL FIPS 140-2 version update
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1587
diff changeset
    31
needed to build 1.0.1 FIPS-140 certified libraries. All builds apart from 
745
09fd85317532 7141635 Deliver wanboot-openssl.o for wanboot
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 426
diff changeset
    32
static libraries for wanboot are done for 32 and 64 bits. So, in total, OpenSSL
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
    33
is built seven times. OpenSSL for wanboot is only build on sparc.
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    34
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
    35
See also comments in all the Makefiles for more information.
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    36
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    37
OpenSSL Version
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    38
---
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    39
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
    40
For non-FIPS build, we currently deliver OpenSSL 1.0.1 with some updates
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    41
from OpenSSL 1.0.2 to make T4 instructions embedded in the OpenSSL
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    42
upstream code.  As of April 2013, 1.0.2 is not yet released, and therefore,
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    43
we have decided to patch the code.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    44
The following files/code are copied in from 1.0.2.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    45
added:
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
    46
   components/openssl/openssl-1.0.1/inline-t4/aest4-sparcv9.pl
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
    47
   components/openssl/openssl-1.0.1/inline-t4/dest4-sparcv9.pl
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    48
   components/openssl/openssl-1.0.1/inline-t4/md5-sparcv9.pl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    49
   components/openssl/openssl-1.0.1/inline-t4/sparc_arch.h
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
    50
   components/openssl/openssl-1.0.1/inline-t4/sparct4-mont.pl
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
    51
   components/openssl/openssl-1.0.1/inline-t4/sparcv9_modes.pl
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
    52
   components/openssl/openssl-1.0.1/inline-t4/sparcv9-gf2m.pl
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
    53
   components/openssl/openssl-1.0.1/inline-t4/vis3-mont.pl
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    54
   components/openssl/openssl-1.0.1/patches/openssl-t4-inline.sparc-patch
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    55
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    56
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    57
The non-fips Build.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    58
---
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    59
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    60
The non-fips build is the main build of OpenSSL and includes the regular
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    61
binaries, libraries, man pages, and header files.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    62
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    63
Patches
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    64
---
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    65
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    66
08-6193522.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    67
Give CA.pl better defaults. See 6193522 for more information.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    68
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    69
11-6546806.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    70
Make sure the HMAC_CTX_init(3) man page gets delivered. See 6546806 for
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    71
more information.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    72
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    73
14-manpage_openssl.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    74
Force openssl to install man pages into man[1357]openssl instead of man[1357].
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    75
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    76
15-pkcs11_engine-0.9.8a.patch
1489
bad87e4131b9 17361355 Remove devcrypto engine
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1382
diff changeset
    77
Patch which adds the pkcs11 engine. See also the engine/pkcs11
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    78
sub-directory. 
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    79
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    80
18-compiler_opts.patch
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
    81
Adds five Solaris specific configurations (both 32bit and 64bit for both sparc
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
    82
and x86, plus 64bit sparc for wanboot) to Configure which are then explicitly
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
    83
used by the Makefiles. Wanboot configuration is special in that it doesn't link
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
    84
with libc and uses -xF=%all to put functions in separate sections, so that
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
    85
unused code can be discarded.
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    86
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    87
Care should be taken if modifying this patch as changes to compile-time options
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    88
can change the ABI. One example of this is the use of RC4_INT vs RC4_CHAR.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    89
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    90
20-remove_rpath.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    91
Prevent build binaries having an unnecessary runpath (/lib).
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    92
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    93
23-noexstack.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    94
Build with non-executable stacks and non-executable data (x86).
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    95
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    96
27-6978791.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    97
Modifies Makefile.shared so that libssl is built with -znodelete.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    98
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
    99
28-enginesdir.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   100
Adds a new "enginesdir" option to the Configure script which allows a user to
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   101
specify the engines directory.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   102
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   103
30_wanboot.patch:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   104
Wanboot specific patches.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   105
- modified Makefiles not to build in engines apps test tools
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   106
- not using vfprintf for error print in crypto/cryptlib.c
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   107
- not using ERR_load_DSO_strings() in crypto/err/err_all.c
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   108
- not using EVP_read_pw_string() in crypto/evp/evp_key.c
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   109
    - reading password is implemented in disabled DES library
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   110
- avoid select() in crypto/rand/rand_unix.c
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   111
- direct reading of IP to avoid sscanf() in crypto/x509v3/v3_utl.c
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   112
- using functions from libsock in e_os.h
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   113
- by-passing version of sparc detection in crypto/sparcv9cap.c
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   114
    - results in not using FPU for big numbers multiplication
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   115
    - should be ok - original detection seems broken, FPU gets never used
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   116
- implementation of atoi()
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   117
- avoid using ssl_fill_hello_random() in s3_clnt.c
419
a926b383669b 7025650 Default 32-bit /usr/bin/openssl hurts performance on 64-bit amd64 and sparcv9
Dan Anderson <dan.anderson@oracle.com>
parents: 363
diff changeset
   118
1884
d1a47da60382 17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random
jenny.yung@oracle.com <jenny.yung@oracle.com>
parents: 1680
diff changeset
   119
37_openssl_t4_inline.patch
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   120
SPARC-only patch.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   121
Add patch to support inline T4 instruction in OpenSSL upstream code until
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   122
OpenSSL 1.0.2 is released.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   123
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   124
opensslconf.patch
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   125
Modifies opensslconf.h so that it is suitable for both 32bit and 64bit installs.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   126
OpenSSL either builds for 32bit or 64bit - it doesn't allow for combined 32bit
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   127
and 64bit builds.
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   128
1884
d1a47da60382 17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random
jenny.yung@oracle.com <jenny.yung@oracle.com>
parents: 1680
diff changeset
   129
38_remove_illegal_instruction_calls.patch
d1a47da60382 17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random
jenny.yung@oracle.com <jenny.yung@oracle.com>
parents: 1680
diff changeset
   130
SPARC patch. Solaris-only patch.
d1a47da60382 17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random
jenny.yung@oracle.com <jenny.yung@oracle.com>
parents: 1680
diff changeset
   131
For instructions in sparcv9cap.c, remove if not supported on any platforms.
d1a47da60382 17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random
jenny.yung@oracle.com <jenny.yung@oracle.com>
parents: 1680
diff changeset
   132
Otherwise modify them to call getisax() to check for HW capability instead. 
d1a47da60382 17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random
jenny.yung@oracle.com <jenny.yung@oracle.com>
parents: 1680
diff changeset
   133
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   134
The fips Build
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   135
---
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   136
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   137
We are now shipping FIPS-140 certified OpenSSL 1.0.1 with S12 and S11.2.
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   138
The admin may choose to activate 'openssl-fips' implementation using 'pkg mediator'.
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   139
The change will come soon.
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   140
363
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   141
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   142
Patches
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   143
---
9c0cad004039 7039910 move OpenSSL from SFW to Userland gate
Jan Pechanec <Jan.Pechanec@Oracle.COM>
parents:
diff changeset
   144
1596
59869c4257d0 PSARC/2013/383 OpenSSL FIPS 140-2 version update
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1587
diff changeset
   145
All the patches from 1.0.1 (non-fips) are used in 1.0.1(fips) as well aside from
59869c4257d0 PSARC/2013/383 OpenSSL FIPS 140-2 version update
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1587
diff changeset
   146
14-manpage_openssl.patch which is not needed since we do not deliver 1.0.1(fips) man
59869c4257d0 PSARC/2013/383 OpenSSL FIPS 140-2 version update
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1587
diff changeset
   147
pages.  Once we make fips version public, we should deliver man page.
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   148
(coming soon)
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   149
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   150
The wanboot Build
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   151
----
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   152
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   153
There are some significant differences when building OpenSSL for wanboot.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   154
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   155
Some additional Configuration options are needed:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   156
-DNO_CHMOD		chmod not available in stand-alone environment
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   157
-DBOOT			guard for wanboot specific patches
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   158
-DOPENSSL_NO_DTLS1	to avoid dtls1_min_mtu() - DTLS not used anyway
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   159
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   160
List of object files for wanboot-openssl.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   161
----
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   162
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   163
At this moment, object files for wanboot-openssl.o need to be listed explicitly.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   164
This is cumbersome and relatively tedious with respect to upgrading to higher
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   165
version of openssl. 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   166
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   167
In future, it would be nice, if this could be performed automatically by the
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   168
linker. The required interface for wanboot is already defined in a mapfile and
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   169
linker option '-zdiscard-unused=sections,files' is already used to discard
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   170
unused code. 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   171
But sadly, at this moment when the linker is given all the object files, it
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   172
correctly discards some unused files, but references to undefined symbols from
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   173
the discarded files don't get discarded along. Later, these undefined references
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   174
cause wanboot linking failure. 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   175
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   176
In order to determine which openssl object files are required for wanboot,
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   177
first build static standalone openssl bits in Userland. As a site effect,
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   178
static libraries libssl.a and libcrypto.a are created in build/sparcv9-wanboot.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   179
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   180
    $ cd $USERLAND/components/openssl/openssl-1.0.1 ; gmake build
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   181
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   182
Next, collect some information from linking wanboot static libraries in ON.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   183
This can be done by the following hack.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   184
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   185
    $ cd $ON/usr/src/psm/stand/boot/sparcv9/sun4
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   186
    $ touch wanboot.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   187
    $ LD_OPTIONS="-Dfiles,symbols,output=ld.dbg \
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   188
        -L$USERLAND/components/openssl/openssl-1.0.1/build/sparcv9-wanboot " \
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   189
        WAN_OPENSSL=" -lwanboot -lssl -lcrypto" dmake all
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   190
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   191
The following sort of information ends up in ld.dbg (note that the debugging
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   192
output from the link-editor is not considered a 'stable interface' and may
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   193
change in the future):
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   194
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   195
    debug: file=/builds/tkuthan/ul-wanboot-rebuilt/components/openssl/openssl-1.0.1/build/sparcv9-wanboot/libcrypto.a(sparcv9cap.o)  [ ET_REL ]
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   196
    debug:
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   197
    debug: symbol table processing; file=/builds/tkuthan/ul-wanboot-rebuilt/components/openssl/openssl-1.0.1/build/sparcv9-wanboot/libcrypto.a(sparcv9cap.o)  [ ET_REL ]
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   198
    debug: symbol[1]=sparcv9cap.c
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   199
    ....
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   200
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   201
Now run the following script in Userland:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   202
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   203
    #!/bin/bash
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   204
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   205
    # set to workspace paths:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   206
    USERLAND=/builds/tkuthan/ul-wanboot-rebuilt
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   207
    ON=/builds/tkuthan/on11u1-wanboot-rti
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   208
 
1680
49cf3ba424f0 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1596
diff changeset
   209
    BUILD=$USERLAND/components/openssl/openssl-1.0.1/build/sparcv9-wanboot
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   210
    LD_DBG=$ON/usr/src/psm/stand/boot/sparcv9/sun4/ld.dbg
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   211
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   212
    for i in `find $BUILD/crypto $BUILD/ssl -name '*.o'`
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   213
    do
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   214
            f=`basename $i`
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   215
            if grep -q "^debug: file.*\<$f\>" $LD_DBG
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   216
            then
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   217
                    echo $i | sed "s#$BUILD/##"
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   218
            fi
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   219
    done
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   220
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   221
to get the list of required object files.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   222
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   223
Additionally, you can format the list for including to Makefile by:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   224
    sort | tr '\n' ' ' | fold -s -w74 | sed -e 's/^/    /' -e 's/$/\\/'
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   225
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   226
Linking with wanboot
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   227
----
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   228
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   229
When linking with wanboot please pay attention to following pitfalls.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   230
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   231
Correct openssl header files need to be included. This is done in
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   232
$ON/usr/src/stand/lib/wanboot/Makefile
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   233
Make sure CPPFLAGS point to the right directories.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   234
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   235
EXTREME CAUTION needs to be employed, if WANBOOT GREW IN SIZE because of the
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   236
changes!
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   237
Wanboot is a statically linked standalone binary and it is loaded on a fixed
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   238
address before execution. This address is defined in 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   239
$ON/usr/src/psm/stand/boot/sparc/common/mapfile:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   240
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   241
     27 LOAD_SEGMENT text {
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   242
     28 	FLAGS = READ EXECUTE;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   243
     29 	VADDR = 0x130000;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   244
     30 	ASSIGN_SECTION {
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   245
     31 		TYPE = PROGBITS;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   246
     32 		FLAGS = ALLOC !WRITE;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   247
     33 	};
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   248
     34 };
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   249
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   250
This address (VADDR) NEEDS TO BE GREATER THEN 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   251
    size of wanboot binary + 0x4000
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   252
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   253
The reason for this is in how wanboot is loaded by OpenBoot Prom:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   254
1) user initiates boot from network - "boot net"
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   255
2) obp loads wanboot binary at address 0x4000
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   256
3) obp parses ELF header, reads virtual address where to load wanboot to
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   257
4) obp mem-copies .text section to this address
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   258
5) obp copies .data section behind .text
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   259
6) obp starts executing wanboot at entry address
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   260
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   261
If the given address is too small, obp overwrites part of .data with
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   262
instructions from .text in step 4. resulting in .data being corrupted.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   263
Initialized variables get bogus values and failure is inevitable.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   264
This is very hard to troubleshoot.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   265
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   266
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   267
Testing wanboot with new openssl
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   268
----
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   269
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   270
With every upgrade of OpenSSL, it is necessary to make sure wanboot builds and
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   271
works well with the new bits.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   272
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   273
Provided you have a freshly built ON workspace, you can link wanboot with new
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   274
OpenSSL bits by redefining WAN_OPENSSL macro:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   275
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   276
    # copy wanboot-openssl.o to ON build machine
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   277
    cp wanboot-openssl.o /var/tmp/
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   278
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   279
    # prepare to rebuild wanboot
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   280
    cd $ON
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   281
    bldenv developer.sh
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   282
    cd usr/src/psm/stand/boot/sparcv9/sun4
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   283
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   284
    # hack to force a rebuild
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   285
    touch wanboot.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   286
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   287
    # link new OpenSSL to wanboot
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   288
    WAN_OPENSSL=/var/tmp/wanboot-openssl.o dmake all
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   289
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   290
Wanboot should build without warning.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   291
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   292
If there is something like this in the output:
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   293
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   294
    Undefined                       first referenced
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   295
     symbol                             in file
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   296
    CRYPTO_ccm128_setiv                 /var/tmp/wanboot-openssl.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   297
    SSL_get_srtp_profiles               /var/tmp/wanboot-openssl.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   298
    ssl_parse_clienthello_use_srtp_ext  /var/tmp/wanboot-openssl.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   299
    CRYPTO_gcm128_setiv                 /var/tmp/wanboot-openssl.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   300
    ...
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   301
    cmac_pkey_meth                      /var/tmp/wanboot-openssl.o
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   302
    ld: fatal: symbol referencing errors. No output written to wanboot
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   303
    *** Error code 1
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   304
    dmake: Fatal error: Command failed for target `wanboot'
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   305
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   306
some additional work has to be done in OpenSSL to either satisfy the function 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   307
references listed in the linker error message, or to remove the calls to these
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   308
functions.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   309
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   310
Finally, resulting wanboot binary shall be deployed on some install server and
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 745
diff changeset
   311
wanbooting from this server shall be tested.