components/openssl/openssl-1.0.1/patches/30_wanboot.patch
author Ronald Jordan <ron.jordan@oracle.com>
Fri, 15 Aug 2014 15:07:33 -0700
branchs11u2-sru
changeset 3272 e797eda2f68f
parent 3017 da8a40fb54dd
child 2156 47340bc31385
permissions -rw-r--r--
19385782 Upgrade OpenSSL version to 1.0.1i 19385718 problem in LIBRARY/OPENSSL 19385708 problem in LIBRARY/OPENSSL 19385699 problem in LIBRARY/OPENSSL 19385688 problem in LIBRARY/OPENSSL 19385678 problem in LIBRARY/OPENSSL 19385675 problem in LIBRARY/OPENSSL 19385660 problem in LIBRARY/OPENSSL 19385653 problem in LIBRARY/OPENSSL 19385643 problem in LIBRARY/OPENSSL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3017
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
     1
#
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
     2
# This patch file makes the changes neccessary to build wanboot-openssl.o
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
     3
# binary. This is Solaris-specific: not suitable for upstream.
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
     4
#
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     5
--- openssl-1.0.0g/Makefile.org	2010-01-27 08:06:58.000000000 -0800
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
     6
+++ openssl-1.0.0g-1/Makefile.org	2012-03-26 03:04:08.440194448 -0700
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
     7
@@ -138,7 +138,13 @@
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
     8
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
     9
 BASEADDR=
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    10
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    11
+# For wanboot, we only need crypto and ssl.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    12
+# 'apps' are not patched to work in stand-alone environment anyway.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    13
+ifeq ($(PLATFORM), solaris64-sparcv9-cc-sunw-wanboot)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    14
+DIRS=   crypto ssl
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    15
+else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    16
 DIRS=   crypto ssl engines apps test tools
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    17
+endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    18
 ENGDIRS= ccgost
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    19
 SHLIBDIRS= crypto ssl
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    20
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    21
--- openssl-1.0.0g/Makefile	2012-01-18 05:42:28.000000000 -0800
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    22
+++ openssl-1.0.0g-1/Makefile	2012-03-26 03:03:59.170540344 -0700
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    23
@@ -137,7 +137,13 @@
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    24
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    25
 BASEADDR=0xFB00000
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    26
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    27
+# For wanboot, we only need crypto and ssl.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    28
+# 'apps' are not patched to work in stand-alone environment anyway.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    29
+ifeq ($(PLATFORM), solaris64-sparcv9-cc-sunw-wanboot)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    30
+DIRS=   crypto ssl
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    31
+else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    32
 DIRS=   crypto ssl engines apps test tools
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    33
+endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    34
 ENGDIRS= ccgost
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    35
 SHLIBDIRS= crypto ssl
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
    36
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    37
--- openssl-1.0.0e/crypto/cryptlib.c	2011-06-22 08:39:00.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    38
+++ openssl-1.0.0e_patched/crypto/cryptlib.c	2011-12-12 06:17:45.422476900 -0800
3017
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    39
@@ -415,6 +415,7 @@
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    40
 static void solaris_locking_callback(int mode, int type, const char *file,
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    41
     int line)
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    42
 	{
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    43
+#ifndef	_BOOT
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    44
 	if (mode & CRYPTO_LOCK)
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    45
 		{
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    46
 		pthread_mutex_lock(&solaris_openssl_locks[type]);
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    47
@@ -423,6 +424,7 @@
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    48
 		{
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    49
 		pthread_mutex_unlock(&solaris_openssl_locks[type]);
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    50
 		}
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    51
+#endif
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    52
 	}
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    53
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    54
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    55
@@ -456,6 +458,12 @@
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    56
 		}
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    57
 
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    58
 	/*
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    59
+	 * pthread_* can't be used in wanboot.
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    60
+	 * wanboot needs not be thread-safe and mutexes and locking callback
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    61
+	 * function will not be setup for wanboot.
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    62
+	 */
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    63
+#ifndef	_BOOT
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    64
+	/*
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    65
 	 * Set atfork handler so that child can setup its own mutexes and
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    66
 	 * locking callbacks when it is forked
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    67
 	 */
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    68
@@ -478,7 +486,7 @@
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    69
 		pthread_mutex_init(&solaris_openssl_locks[i], NULL);
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    70
 		}
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    71
 	locking_callback = solaris_locking_callback;
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    72
-
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    73
+#endif
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    74
 	}
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    75
 
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    76
 void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    77
@@ -979,6 +979,10 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    78
 	MessageBox (NULL,buf,_T("OpenSSL: FATAL"),MB_OK|MB_ICONSTOP);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    79
 }
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    80
 #else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    81
+/* Solaris libsa.a used for WAN boot doesn't provide for vfprintf(). Since
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    82
+ *  * OPENSSL_showfatal() is not used anywhere else then here we can safely use
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    83
+ *   * the code from 0.9.7d version. */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    84
+#ifndef	_BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    85
 void OPENSSL_showfatal (const char *fmta,...)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    86
 { va_list ap;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    87
 
3017
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
    88
@@ -986,14 +990,21 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    89
     vfprintf (stderr,fmta,ap);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    90
     va_end (ap);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    91
 }
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    92
+#endif	/* _BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    93
 int OPENSSL_isservice (void) { return 0; }
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    94
 #endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    95
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    96
 void OpenSSLDie(const char *file,int line,const char *assertion)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    97
 	{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    98
+#ifndef	_BOOT		
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
    99
 	OPENSSL_showfatal(
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   100
 		"%s(%d): OpenSSL internal error, assertion failed: %s\n",
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   101
 		file,line,assertion);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   102
+#else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   103
+	fprintf(stderr,
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   104
+		"%s(%d): OpenSSL internal error, assertion failed: %s\n",
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   105
+		file,line,assertion);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   106
+#endif	
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   107
 #if !defined(_WIN32) || defined(__CYGWIN__)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   108
 	abort();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   109
 #else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   110
--- openssl-1.0.0e/crypto/err/err_all.c	2009-08-09 07:58:05.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   111
+++ openssl-1.0.0e_patched/crypto/err/err_all.c	2011-12-13 05:22:01.205351400 -0800
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   112
@@ -148,7 +148,9 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   113
 	ERR_load_X509V3_strings();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   114
 	ERR_load_PKCS12_strings();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   115
 	ERR_load_RAND_strings();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   116
+#ifndef _BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   117
 	ERR_load_DSO_strings();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   118
+#endif /* _BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   119
 	ERR_load_TS_strings();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   120
 #ifndef OPENSSL_NO_ENGINE
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   121
 	ERR_load_ENGINE_strings();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   122
--- openssl-1.0.0e/crypto/evp/evp_key.c	2010-03-27 12:27:50.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   123
+++ openssl-1.0.0e_patched/crypto/evp/evp_key.c	2011-12-13 05:19:32.956908600 -0800
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   124
@@ -84,7 +84,7 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   125
 	else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   126
 		return(prompt_string);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   127
 	}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   128
-
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   129
+#ifndef	_BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   130
 /* For historical reasons, the standard function for reading passwords is
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   131
  * in the DES library -- if someone ever wants to disable DES,
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   132
  * this function will fail */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   133
@@ -111,6 +111,7 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   134
 	OPENSSL_cleanse(buff,BUFSIZ);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   135
 	return ret;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   136
 	}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   137
+#endif	/* !_BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   138
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   139
 int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   140
 	     const unsigned char *salt, const unsigned char *data, int datal,
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   141
--- openssl-1.0.0e/crypto/rand/rand_unix.c	2009-04-06 07:31:36.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   142
+++ openssl-1.0.0e_patched/crypto/rand/rand_unix.c	2011-12-19 07:28:39.988944800 -0800
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   143
@@ -122,7 +122,11 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   144
 #include <sys/time.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   145
 #include <sys/times.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   146
 #include <sys/stat.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   147
+#ifdef	_BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   148
+#include <sys/fcntl.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   149
+#else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   150
 #include <fcntl.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   151
+#endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   152
 #include <unistd.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   153
 #include <time.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   154
 #if defined(OPENSSL_SYS_LINUX) /* should actually be available virtually everywhere */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   155
@@ -253,6 +257,11 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   156
 	const char **egdsocket = NULL;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   157
 #endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   158
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   159
+#ifdef _BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   160
+/* open() is provided by standalone libsa not visible from here */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   161
+extern int open(const char *, int);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   162
+#endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   163
+
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   164
 #ifdef DEVRANDOM
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   165
 	memset(randomstats,0,sizeof(randomstats));
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   166
 	/* Use a random entropy pool device. Linux, FreeBSD and OpenBSD
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   167
@@ -295,9 +304,13 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   168
 				{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   169
 				int try_read = 0;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   170
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   171
-#if defined(OPENSSL_SYS_BEOS_R5)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   172
+#if defined(OPENSSL_SYS_BEOS_R5) || defined(_BOOT)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   173
 				/* select() is broken in BeOS R5, so we simply
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   174
 				 *  try to read something and snooze if we couldn't */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   175
+				/* 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   176
+				 * select() is not available when linking stand-alone
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   177
+				 * library for wanboot 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   178
+				 */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   179
 				try_read = 1;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   180
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   181
 #elif defined(OPENSSL_SYS_LINUX)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   182
@@ -355,6 +368,7 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   183
 				else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   184
 					r = -1;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   185
 				
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   186
+#ifndef	_BOOT				
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   187
 				/* Some Unixen will update t in select(), some
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   188
 				   won't.  For those who won't, or if we
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   189
 				   didn't use select() in the first place,
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   190
@@ -366,13 +380,17 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   191
 				}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   192
 			while ((r > 0 ||
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   193
 			       (errno == EINTR || errno == EAGAIN)) && usec != 0 && n < ENTROPY_NEEDED);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   194
+#else	/* _BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   195
+				}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   196
+			while (r > 0 && n < ENTROPY_NEEDED);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   197
+#endif	/* _BOOT */			
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   198
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   199
 			close(fd);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   200
 			}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   201
 		}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   202
 #endif /* defined(DEVRANDOM) */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   203
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   204
-#ifdef DEVRANDOM_EGD
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   205
+#if defined(DEVRANDOM_EGD) && !defined(_BOOT)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   206
 	/* Use an EGD socket to read entropy from an EGD or PRNGD entropy
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   207
 	 * collecting daemon. */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   208
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   209
@@ -395,6 +413,7 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   210
 		}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   211
 #endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   212
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   213
+#ifndef	_BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   214
 	/* put in some default random data, we need more than just this */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   215
 	l=curr_pid;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   216
 	RAND_add(&l,sizeof(l),0.0);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   217
@@ -403,6 +422,7 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   218
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   219
 	l=time(NULL);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   220
 	RAND_add(&l,sizeof(l),0.0);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   221
+#endif /* !_BOOT */	
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   222
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   223
 #if defined(OPENSSL_SYS_BEOS)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   224
 	{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   225
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   226
--- openssl-1.0.0e/crypto/rand/randfile.c	2011-03-19 02:44:37.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   227
+++ openssl-1.0.0e_patched/crypto/rand/randfile.c	2011-12-13 05:26:51.884824200 -0800
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   228
@@ -57,9 +57,11 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   229
  */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   230
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   231
 /* We need to define this to get macros like S_IFBLK and S_IFCHR */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   232
+#ifndef	_BOOT
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   233
 #if !defined(OPENSSL_SYS_VXWORKS)
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   234
 #define _XOPEN_SOURCE 500
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   235
 #endif
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   236
+#endif	/* _BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   237
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   238
 #include <errno.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   239
 #include <stdio.h>
3272
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   240
@@ -179,6 +181,7 @@
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   241
 	return(ret);
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   242
 	}
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   243
 
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   244
+#ifndef	_BOOT
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   245
 int RAND_write_file(const char *file)
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   246
 	{
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   247
 	unsigned char buf[BUFSIZE];
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   248
@@ -327,3 +330,5 @@
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   249
 #endif
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   250
 	return(buf);
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   251
 	}
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   252
+
e797eda2f68f 19385782 Upgrade OpenSSL version to 1.0.1i
Ronald Jordan <ron.jordan@oracle.com>
parents: 3017
diff changeset
   253
+#endif /* _BOOT */
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   254
--- openssl-1.0.0e/crypto/x509v3/v3_utl.c	2009-07-27 14:08:53.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   255
+++ openssl-1.0.0e_patched/crypto/x509v3/v3_utl.c	2011-12-13 05:10:08.844191400 -0800
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   256
@@ -659,9 +659,52 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   257
 		}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   258
 	}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   259
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   260
+#if	defined(_BOOT)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   261
+/* This function was copied from bio/b_sock.c */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   262
+static int get_ip(const char *str, unsigned char ip[4])
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   263
+	{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   264
+	unsigned int tmp[4];
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   265
+	int num=0,c,ok=0;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   266
+
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   267
+	tmp[0]=tmp[1]=tmp[2]=tmp[3]=0;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   268
+
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   269
+	for (;;)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   270
+		{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   271
+		c= *(str++);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   272
+		if ((c >= '0') && (c <= '9'))
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   273
+			{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   274
+			ok=1;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   275
+			tmp[num]=tmp[num]*10+c-'0';
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   276
+			if (tmp[num] > 255) return(0);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   277
+			}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   278
+		else if (c == '.')
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   279
+			{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   280
+			if (!ok) return(-1);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   281
+			if (num == 3) return(0);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   282
+			num++;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   283
+			ok=0;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   284
+			}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   285
+		else if (c == '\0' && (num == 3) && ok)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   286
+			break;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   287
+		else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   288
+			return(0);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   289
+		}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   290
+	ip[0]=tmp[0];
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   291
+	ip[1]=tmp[1];
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   292
+	ip[2]=tmp[2];
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   293
+	ip[3]=tmp[3];
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   294
+	return(1);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   295
+	}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   296
+#endif /* _BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   297
+
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   298
 static int ipv4_from_asc(unsigned char *v4, const char *in)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   299
 	{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   300
 	int a0, a1, a2, a3;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   301
+
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   302
+#if	defined(_BOOT)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   303
+	if (get_ip(in, v4) != 1)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   304
+		return 0;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   305
+#else	/* _BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   306
 	if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   307
 		return 0;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   308
 	if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   309
@@ -671,6 +716,7 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   310
 	v4[1] = a1;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   311
 	v4[2] = a2;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   312
 	v4[3] = a3;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   313
+#endif	/* _BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   314
 	return 1;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   315
 	}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   316
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   317
--- openssl-1.0.0e/e_os.h	2011-12-19 04:17:51.631087400 -0800
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   318
+++ openssl-1.0.0e_patched/e_os.h	2011-12-19 04:15:15.776668900 -0800
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   319
@@ -206,10 +206,19 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   320
 #define get_last_socket_error()	errno
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   321
 #define clear_socket_error()	errno=0
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   322
 #define ioctlsocket(a,b,c)	ioctl(a,b,c)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   323
+#ifdef	_BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   324
+#include <netinet/in.h>
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   325
+extern int socket_read(int, void *, size_t, int);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   326
+extern int socket_close(int);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   327
+#define	closesocket(s)		socket_close(s)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   328
+#define	readsocket(s,b,n)	socket_read((s),(b),(n), 200)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   329
+#define	writesocket(s,b,n)	send((s),(b),(n), 0)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   330
+#else  /* !_BOOT */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   331
 #define closesocket(s)		close(s)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   332
 #define readsocket(s,b,n)	read((s),(b),(n))
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   333
 #define writesocket(s,b,n)	write((s),(b),(n))
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   334
 #endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   335
+#endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   336
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   337
 #ifdef WIN16 /* never the case */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   338
 #  define MS_CALLBACK	_far _loadds
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   339
--- openssl-1.0.0e/crypto/sparcv9cap.c	2010-09-05 12:48:01.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   340
+++ openssl-1.0.0e_patched/crypto/sparcv9cap.c	2011-12-23 05:24:02.011607700 -0800
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   341
@@ -12,7 +12,11 @@
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   342
 #define SPARCV9_VIS2		(1<<3)	/* reserved */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   343
 #define SPARCV9_FMADD		(1<<4)	/* reserved for SPARC64 V */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   344
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   345
+#ifndef	_BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   346
 static int OPENSSL_sparcv9cap_P=SPARCV9_TICK_PRIVILEGED;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   347
+#else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   348
+static int OPENSSL_sparcv9cap_P = SPARCV9_VIS1;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   349
+#endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   350
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   351
 int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0, int num)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   352
 	{
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   353
@@ -33,6 +37,7 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   354
 void		_sparcv9_vis2_probe(void);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   355
 void		_sparcv9_fmadd_probe(void);
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   356
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   357
+#ifndef _BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   358
 unsigned long OPENSSL_rdtsc(void)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   359
 	{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   360
 	if (OPENSSL_sparcv9cap_P&SPARCV9_TICK_PRIVILEGED)
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   361
@@ -44,8 +49,19 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   362
 	else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   363
 		return _sparcv9_rdtick();
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   364
 	}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   365
+#endif
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   366
+
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   367
+#if defined(_BOOT)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   368
+/*
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   369
+ * Hardcoding sparc capabilities for wanboot.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   370
+ * Older CPUs are EOLed anyway.
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   371
+ */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   372
+void OPENSSL_cpuid_setup(void)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   373
+	{
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   374
+	OPENSSL_sparcv9cap_P = SPARCV9_VIS1;
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   375
+	}
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   376
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   377
-#if 0 && defined(__sun) && defined(__SVR4)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   378
+#elif 0 && defined(__sun) && defined(__SVR4)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   379
 /* This code path is disabled, because of incompatibility of
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   380
  * libdevinfo.so.1 and libmalloc.so.1 (see below for details)
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   381
  */
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   382
--- openssl-1.0.0e/crypto/sparccpuid.S	2010-09-05 12:48:01.000000000 -0700
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   383
+++ openssl-1.0.0e_patched/crypto/sparccpuid.S	2012-02-13 07:42:58.259478325 -0800
3017
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
   384
@@ -397,8 +397,13 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   385
 .type	OPENSSL_cleanse,#function
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   386
 .size	OPENSSL_cleanse,.-OPENSSL_cleanse
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   387
 
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   388
+#ifndef _BOOT
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   389
 .section	".init",#alloc,#execinstr
3017
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
   390
 	call	solaris_locking_setup
da8a40fb54dd PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2931
diff changeset
   391
 	nop
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   392
	call	OPENSSL_cpuid_setup
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   393
	nop
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   394
+#else
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   395
+	nop
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   396
+	nop
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   397
+#endif
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   398
--- openssl-1.0.1c/crypto/Makefile      Thu Aug  2 12:56:38 2012
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   399
+++ openssl-1.0.1c/crypto/Makefile.new  Thu Aug  2 12:59:43 2012
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   400
@@ -35,9 +35,9 @@
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   401
 LIB= $(TOP)/libcrypto.a
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   402
 SHARED_LIB= libcrypto$(SHLIB_EXT)
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   403
 LIBSRC=	cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   404
-	ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   405
+	ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c wanboot-stubs.c
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   406
 LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   407
-	uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ)
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   408
+	uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o wanboot-stubs.o $(CPUID_OBJ)
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   409
763
45da4d38492e 7156086 OpenSSL for wanboot should not be build in a separate directory
Tomas Kuthan <tomas.kuthan@oracle.com>
parents:
diff changeset
   410
 SRC= $(LIBSRC)
2593
b92e6df5eaf0 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 763
diff changeset
   411
2931
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   412
--- openssl-1.0.1f/ssl/s3_clnt.c    Thu Jan 30 02:53:33 2014
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   413
+++ openssl-1.0.1f/ssl/s3_clnt.c.new   Thu Jan 30 02:57:51 2014
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   414
@@ -681,8 +681,13 @@
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   415
 
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   416
 		p=s->s3->client_random;
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   417
 
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   418
+#ifndef	_BOOT
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   419
 		if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0)
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   420
 			goto err;
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   421
+#else
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   422
+		if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE) <= 0)
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   423
+			goto err;
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   424
+#endif
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   425
 
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   426
 		/* Do the message type and length last */
8e563e01c224 18161027 OpenSSL 1.0.1f: ON nightly fails with missing symbol in wanboot-openssl.o
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 2593
diff changeset
   427
 		d=p= &(buf[4]);