components/openssl/openssl-1.0.1/patches/30_wanboot.patch
branchs11-update
changeset 4461 68eb2fdf9b3a
parent 4006 c737cefdce54
child 4626 d5dbb6652eec
equal deleted inserted replaced
4458:6e71221d175a 4461:68eb2fdf9b3a
     1 #
     1 #
     2 # This patch file makes the changes neccessary to build wanboot-openssl.o
     2 # This patch file makes the changes neccessary to build wanboot-openssl.o
     3 # binary. This is Solaris-specific: not suitable for upstream.
     3 # binary. This is Solaris-specific: not suitable for upstream.
     4 #
     4 #
     5 --- openssl-1.0.0g/Makefile.org	2010-01-27 08:06:58.000000000 -0800
     5 --- openssl-1.0.0g/Makefile.org    2010-01-27 08:06:58.000000000 -0800
     6 +++ openssl-1.0.0g-1/Makefile.org	2012-03-26 03:04:08.440194448 -0700
     6 +++ openssl-1.0.0g-1/Makefile.org    2012-03-26 03:04:08.440194448 -0700
     7 @@ -138,7 +138,13 @@
     7 @@ -138,7 +138,13 @@
     8 
     8 
     9  BASEADDR=
     9  BASEADDR=
    10 
    10 
    11 +# For wanboot, we only need crypto and ssl.
    11 +# For wanboot, we only need crypto and ssl.
    16  DIRS=   crypto ssl engines apps test tools
    16  DIRS=   crypto ssl engines apps test tools
    17 +endif
    17 +endif
    18  ENGDIRS= ccgost
    18  ENGDIRS= ccgost
    19  SHLIBDIRS= crypto ssl
    19  SHLIBDIRS= crypto ssl
    20 
    20 
    21 --- openssl-1.0.0g/Makefile	2012-01-18 05:42:28.000000000 -0800
    21 --- openssl-1.0.0g/Makefile    2012-01-18 05:42:28.000000000 -0800
    22 +++ openssl-1.0.0g-1/Makefile	2012-03-26 03:03:59.170540344 -0700
    22 +++ openssl-1.0.0g-1/Makefile    2012-03-26 03:03:59.170540344 -0700
    23 @@ -137,7 +137,13 @@
    23 @@ -137,7 +137,13 @@
    24 
    24 
    25  BASEADDR=0xFB00000
    25  BASEADDR=0xFB00000
    26 
    26 
    27 +# For wanboot, we only need crypto and ssl.
    27 +# For wanboot, we only need crypto and ssl.
    32  DIRS=   crypto ssl engines apps test tools
    32  DIRS=   crypto ssl engines apps test tools
    33 +endif
    33 +endif
    34  ENGDIRS= ccgost
    34  ENGDIRS= ccgost
    35  SHLIBDIRS= crypto ssl
    35  SHLIBDIRS= crypto ssl
    36 
    36 
    37 --- openssl-1.0.0e/crypto/cryptlib.c	2011-06-22 08:39:00.000000000 -0700
    37 --- openssl-1.0.0e/crypto/cryptlib.c    2011-06-22 08:39:00.000000000 -0700
    38 +++ openssl-1.0.0e_patched/crypto/cryptlib.c	2011-12-12 06:17:45.422476900 -0800
    38 +++ openssl-1.0.0e_patched/crypto/cryptlib.c    2011-12-12 06:17:45.422476900 -0800
    39 @@ -412,6 +412,7 @@
    39 @@ -421,11 +421,13 @@
    40  static void solaris_locking_callback(int mode, int type, const char *file,
    40  static void solaris_locking_callback(int mode, int type, const char *file,
    41      int line)
    41      int line)
    42  	{
    42  {
    43 +#ifndef	_BOOT
    43 +#ifndef    _BOOT
    44  	if (mode & CRYPTO_LOCK)
    44      if (mode & CRYPTO_LOCK) {
    45  		{
    45          pthread_mutex_lock(&solaris_openssl_locks[type]);
    46  		pthread_mutex_lock(&solaris_openssl_locks[type]);
    46      } else {
    47 @@ -420,6 +421,7 @@
    47          pthread_mutex_unlock(&solaris_openssl_locks[type]);
    48  		{
    48      }
    49  		pthread_mutex_unlock(&solaris_openssl_locks[type]);
    49 +#endif
    50  		}
    50  }
    51 +#endif
    51  
    52  	}
    52  
    53  
    53 @@ -435,6 +437,7 @@
    54  
    54  static struct CRYPTO_dynlock_value *
    55 @@ -453,6 +455,12 @@
    55  solaris_dynlock_create(const char *file, int line)
    56  		}
    56  {
    57  
    57 +#ifndef    _BOOT
    58  	/*
    58      int                        ret;
    59 +	 * pthread_* can't be used in wanboot.
    59      pthread_mutex_t    *dynlock;
    60 +	 * wanboot needs not be thread-safe and mutexes and locking callback
    60 
    61 +	 * function will not be setup for wanboot.
    61 @@ -447,6 +450,9 @@
    62 +	 */
    62      OPENSSL_assert(ret);
    63 +#ifndef	_BOOT
    63 
    64 +	/*
    64      return ((struct CRYPTO_dynlock_value *)dynlock);
    65  	 * Set atfork handler so that child can setup its own mutexes and
    65 +#else
    66  	 * locking callbacks when it is forked
    66 +    return (NULL);
    67  	 */
    67 +#endif
    68 @@ -475,7 +483,7 @@
    68  }
    69  		pthread_mutex_init(&solaris_openssl_locks[i], NULL);
    69 
    70  		}
    70  static void
    71  	locking_callback = solaris_locking_callback;
    71 @@ -453,6 +459,7 @@
       
    72  solaris_dynlock_lock(int mode, struct CRYPTO_dynlock_valud *dynlock,
       
    73      const char *file, int line)
       
    74  {
       
    75 +#ifndef    _BOOT
       
    76      int        ret;
       
    77 
       
    78      if (mode & CRYPTO_LOCK) {
       
    79 @@ -462,6 +469,7 @@
       
    80      }
       
    81 
       
    82      OPENSSL_assert(ret == 0);
       
    83 +#endif
       
    84  }
       
    85 
       
    86  static void
       
    87 @@ -468,9 +476,11 @@
       
    88  solaris_dynlock_destroy(struct CRYPTO_dynlock_value *dynlock,
       
    89      const char *file, int line)
       
    90  {
       
    91 +#ifndef    _BOOT
       
    92      int ret;
       
    93      ret = pthread_mutex_destroy((pthread_mutex_t *)dynlock);
       
    94      OPENSSL_assert(ret);
       
    95 +#endif
       
    96  }
       
    97 
       
    98 
       
    99 @@ -514,6 +524,12 @@
       
   100      }
       
   101  
       
   102      /*
       
   103 +     * pthread_* can't be used in wanboot.
       
   104 +     * wanboot needs not be thread-safe and mutexes and locking callback
       
   105 +     * function will not be setup for wanboot.
       
   106 +     */
       
   107 +#ifndef    _BOOT
       
   108 +    /*
       
   109       * Set atfork handler so that child can setup its own mutexes and
       
   110       * locking callbacks when it is forked
       
   111       */
       
   112 @@ -534,7 +550,7 @@
       
   113          pthread_mutex_init(&solaris_openssl_locks[i], NULL);
       
   114      }
       
   115      locking_callback = solaris_locking_callback;
    72 -
   116 -
    73 +#endif
   117 +#endif
    74  }
   118  }
    75  
   119  
    76  void CRYPTO_set_locking_callback(void (*func) (int mode, int type,
   120  void CRYPTO_set_locking_callback(void (*func) (int mode, int type,
    77 @@ -1021,6 +1029,12 @@
   121 @@ -1084,6 +1100,12 @@
    78          MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONSTOP);
   122          MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONSTOP);
    79  }
   123  }
    80  #else
   124  #else
    81 +/*
   125 +/*
    82 + * Solaris libsa.a used for WAN boot doesn't provide for vfprintf(). Since
   126 + * Solaris libsa.a used for WAN boot doesn't provide for vfprintf(). Since
    83 + * OPENSSL_showfatal() is not used anywhere else then here we can safely use
   127 + * OPENSSL_showfatal() is not used anywhere else then here we can safely use
    84 + * the code from 0.9.7d version.
   128 + * the code from 0.9.7d version.
    85 + */
   129 + */
    86 +#ifndef	_BOOT
   130 +#ifndef    _BOOT
    87  void OPENSSL_showfatal(const char *fmta, ...)
   131  void OPENSSL_showfatal(const char *fmta, ...)
    88  {
   132  {
    89      va_list ap;
   133      va_list ap;
    90 @@ -1029,6 +1043,7 @@
   134 @@ -1092,6 +1114,7 @@
    91      vfprintf(stderr, fmta, ap);
   135      vfprintf(stderr, fmta, ap);
    92      va_end(ap);
   136      va_end(ap);
    93  }
   137  }
    94 +#endif	/* _BOOT */
   138 +#endif    /* _BOOT */
    95  
   139  
    96  int OPENSSL_isservice(void)
   140  int OPENSSL_isservice(void)
    97  {
   141  {
    98 @@ -1038,9 +1053,15 @@
   142 @@ -1101,9 +1124,15 @@
    99  
   143  
   100  void OpenSSLDie(const char *file, int line, const char *assertion)
   144  void OpenSSLDie(const char *file, int line, const char *assertion)
   101  {
   145  {
   102 +#ifndef	_BOOT		
   146 +#ifndef    _BOOT        
   103      OPENSSL_showfatal
   147      OPENSSL_showfatal
   104          ("%s(%d): OpenSSL internal error, assertion failed: %s\n", file, line,
   148          ("%s(%d): OpenSSL internal error, assertion failed: %s\n", file, line,
   105           assertion);
   149           assertion);
   106 +#else
   150 +#else
   107 +	fprintf(stderr,
   151 +    fprintf(stderr,
   108 +		"%s(%d): OpenSSL internal error, assertion failed: %s\n",
   152 +        "%s(%d): OpenSSL internal error, assertion failed: %s\n",
   109 +		file,line,assertion);
   153 +        file,line,assertion);
   110 +#endif	
   154 +#endif    
   111  #if !defined(_WIN32) || defined(__CYGWIN__)
   155  #if !defined(_WIN32) || defined(__CYGWIN__)
   112      abort();
   156      abort();
   113  #else
   157  #else
   114 --- openssl-1.0.0e/crypto/err/err_all.c	2009-08-09 07:58:05.000000000 -0700
   158 --- openssl-1.0.0e/crypto/err/err_all.c    2009-08-09 07:58:05.000000000 -0700
   115 +++ openssl-1.0.0e_patched/crypto/err/err_all.c	2011-12-13 05:22:01.205351400 -0800
   159 +++ openssl-1.0.0e_patched/crypto/err/err_all.c    2011-12-13 05:22:01.205351400 -0800
   116 @@ -148,7 +148,9 @@
   160 @@ -148,7 +148,9 @@
   117      ERR_load_X509V3_strings();
   161      ERR_load_X509V3_strings();
   118      ERR_load_PKCS12_strings();
   162      ERR_load_PKCS12_strings();
   119      ERR_load_RAND_strings();
   163      ERR_load_RAND_strings();
   120 +#ifndef _BOOT
   164 +#ifndef _BOOT
   121      ERR_load_DSO_strings();
   165      ERR_load_DSO_strings();
   122 +#endif /* _BOOT */
   166 +#endif /* _BOOT */
   123      ERR_load_TS_strings();
   167      ERR_load_TS_strings();
   124  # ifndef OPENSSL_NO_ENGINE
   168  # ifndef OPENSSL_NO_ENGINE
   125      ERR_load_ENGINE_strings();
   169      ERR_load_ENGINE_strings();
   126 --- openssl-1.0.0e/crypto/evp/evp_key.c	2010-03-27 12:27:50.000000000 -0700
   170 --- openssl-1.0.0e/crypto/evp/evp_key.c    2010-03-27 12:27:50.000000000 -0700
   127 +++ openssl-1.0.0e_patched/crypto/evp/evp_key.c	2011-12-13 05:19:32.956908600 -0800
   171 +++ openssl-1.0.0e_patched/crypto/evp/evp_key.c    2011-12-13 05:19:32.956908600 -0800
   128 @@ -83,7 +83,7 @@
   172 @@ -83,7 +83,7 @@
   129      else
   173      else
   130          return (prompt_string);
   174          return (prompt_string);
   131  }
   175  }
   132 -
   176 -
   133 +#ifndef	_BOOT
   177 +#ifndef    _BOOT
   134  /*
   178  /*
   135   * For historical reasons, the standard function for reading passwords is in
   179   * For historical reasons, the standard function for reading passwords is in
   136   * the DES library -- if someone ever wants to disable DES, this function
   180   * the DES library -- if someone ever wants to disable DES, this function
   137 @@ -115,6 +115,7 @@
   181 @@ -115,6 +115,7 @@
   138      OPENSSL_cleanse(buff, BUFSIZ);
   182      OPENSSL_cleanse(buff, BUFSIZ);
   139      return ret;
   183      return ret;
   140  }
   184  }
   141 +#endif	/* !_BOOT */
   185 +#endif    /* !_BOOT */
   142  
   186  
   143  int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
   187  int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
   144                     const unsigned char *salt, const unsigned char *data,
   188                     const unsigned char *salt, const unsigned char *data,
   145 --- openssl-1.0.0e/crypto/rand/rand_unix.c	2009-04-06 07:31:36.000000000 -0700
   189 --- openssl-1.0.0e/crypto/rand/rand_unix.c    2009-04-06 07:31:36.000000000 -0700
   146 +++ openssl-1.0.0e_patched/crypto/rand/rand_unix.c	2011-12-19 07:28:39.988944800 -0800
   190 +++ openssl-1.0.0e_patched/crypto/rand/rand_unix.c    2011-12-19 07:28:39.988944800 -0800
   147 @@ -122,7 +122,11 @@
   191 @@ -122,7 +122,11 @@
   148  # include <sys/time.h>
   192  # include <sys/time.h>
   149  # include <sys/times.h>
   193  # include <sys/times.h>
   150  # include <sys/stat.h>
   194  # include <sys/stat.h>
   151 +#ifdef	_BOOT
   195 +#ifdef    _BOOT
   152 +# include <sys/fcntl.h>
   196 +# include <sys/fcntl.h>
   153 +#else
   197 +#else
   154  # include <fcntl.h>
   198  # include <fcntl.h>
   155 +#endif
   199 +#endif
   156  # include <unistd.h>
   200  # include <unistd.h>
   214       * collecting daemon.
   258       * collecting daemon.
   215 @@ -407,6 +424,7 @@
   259 @@ -407,6 +424,7 @@
   216      }
   260      }
   217  #  endif
   261  #  endif
   218  
   262  
   219 +#ifndef	_BOOT
   263 +#ifndef    _BOOT
   220      /* put in some default random data, we need more than just this */
   264      /* put in some default random data, we need more than just this */
   221      l = curr_pid;
   265      l = curr_pid;
   222      RAND_add(&l, sizeof(l), 0.0);
   266      RAND_add(&l, sizeof(l), 0.0);
   223 @@ -415,6 +433,7 @@
   267 @@ -415,6 +433,7 @@
   224  
   268  
   225      l = time(NULL);
   269      l = time(NULL);
   226      RAND_add(&l, sizeof(l), 0.0);
   270      RAND_add(&l, sizeof(l), 0.0);
   227 +#endif /* !_BOOT */	
   271 +#endif /* !_BOOT */    
   228  
   272  
   229  #  if defined(OPENSSL_SYS_BEOS)
   273  #  if defined(OPENSSL_SYS_BEOS)
   230      {
   274      {
   231 --- openssl-1.0.0e/crypto/rand/randfile.c	2011-03-19 02:44:37.000000000 -0700
   275 --- openssl-1.0.0e/crypto/rand/randfile.c    2011-03-19 02:44:37.000000000 -0700
   232 +++ openssl-1.0.0e_patched/crypto/rand/randfile.c	2011-12-13 05:26:51.884824200 -0800
   276 +++ openssl-1.0.0e_patched/crypto/rand/randfile.c    2011-12-13 05:26:51.884824200 -0800
   233 @@ -57,9 +57,11 @@
   277 @@ -57,9 +57,11 @@
   234   */
   278   */
   235  
   279  
   236  /* We need to define this to get macros like S_IFBLK and S_IFCHR */
   280  /* We need to define this to get macros like S_IFBLK and S_IFCHR */
   237 +#ifndef	_BOOT
   281 +#ifndef    _BOOT
   238  #if !defined(OPENSSL_SYS_VXWORKS)
   282  #if !defined(OPENSSL_SYS_VXWORKS)
   239  # define _XOPEN_SOURCE 500
   283  # define _XOPEN_SOURCE 500
   240  #endif
   284  #endif
   241 +#endif	/* _BOOT */
   285 +#endif    /* _BOOT */
   242  
   286  
   243  #include <errno.h>
   287  #include <errno.h>
   244  #include <stdio.h>
   288  #include <stdio.h>
   245 @@ -191,6 +193,7 @@
   289 @@ -191,6 +193,7 @@
   246      return (ret);
   290      return (ret);
   247  }
   291  }
   248  
   292  
   249 +#ifndef	_BOOT
   293 +#ifndef    _BOOT
   250  int RAND_write_file(const char *file)
   294  int RAND_write_file(const char *file)
   251  {
   295  {
   252      unsigned char buf[BUFSIZE];
   296      unsigned char buf[BUFSIZE];
   253 @@ -335,3 +338,5 @@
   297 @@ -335,3 +338,5 @@
   254  #endif
   298  #endif
   255      return (buf);
   299      return (buf);
   256  }
   300  }
   257 +
   301 +
   258 +#endif /* _BOOT */
   302 +#endif /* _BOOT */
   259 --- openssl-1.0.0e/crypto/x509v3/v3_utl.c	2009-07-27 14:08:53.000000000 -0700
   303 --- openssl-1.0.0e/crypto/x509v3/v3_utl.c    2009-07-27 14:08:53.000000000 -0700
   260 +++ openssl-1.0.0e_patched/crypto/x509v3/v3_utl.c	2011-12-13 05:10:08.844191400 -0800
   304 +++ openssl-1.0.0e_patched/crypto/x509v3/v3_utl.c    2011-12-13 05:10:08.844191400 -0800
   261 @@ -715,9 +715,50 @@
   305 @@ -715,9 +715,50 @@
   262      }
   306      }
   263  }
   307  }
   264  
   308  
   265 +#if	defined(_BOOT)
   309 +#if    defined(_BOOT)
   266 +/* This function was copied from bio/b_sock.c */
   310 +/* This function was copied from bio/b_sock.c */
   267 +static int get_ip(const char *str, unsigned char ip[4])
   311 +static int get_ip(const char *str, unsigned char ip[4])
   268 +{
   312 +{
   269 +    unsigned int tmp[4];
   313 +    unsigned int tmp[4];
   270 +    int num = 0, c, ok = 0;
   314 +    int num = 0, c, ok = 0;
   300 +
   344 +
   301  static int ipv4_from_asc(unsigned char *v4, const char *in)
   345  static int ipv4_from_asc(unsigned char *v4, const char *in)
   302  {
   346  {
   303      int a0, a1, a2, a3;
   347      int a0, a1, a2, a3;
   304 +
   348 +
   305 +#if	defined(_BOOT)
   349 +#if    defined(_BOOT)
   306 +	if (get_ip(in, v4) != 1)
   350 +    if (get_ip(in, v4) != 1)
   307 +		return 0;
   351 +        return 0;
   308 +#else	/* _BOOT */
   352 +#else    /* _BOOT */
   309      if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4)
   353      if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4)
   310          return 0;
   354          return 0;
   311      if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255)
   355      if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255)
   312 @@ -727,6 +768,7 @@
   356 @@ -727,6 +768,7 @@
   313      v4[1] = a1;
   357      v4[1] = a1;
   314      v4[2] = a2;
   358      v4[2] = a2;
   315      v4[3] = a3;
   359      v4[3] = a3;
   316 +#endif	/* _BOOT */
   360 +#endif    /* _BOOT */
   317      return 1;
   361      return 1;
   318  }
   362  }
   319 
   363 
   320 --- openssl-1.0.0e/e_os.h	2011-12-19 04:17:51.631087400 -0800
   364 --- openssl-1.0.0e/e_os.h    2011-12-19 04:17:51.631087400 -0800
   321 +++ openssl-1.0.0e_patched/e_os.h	2011-12-19 04:15:15.776668900 -0800
   365 +++ openssl-1.0.0e_patched/e_os.h    2011-12-19 04:15:15.776668900 -0800
   322 @@ -213,10 +213,19 @@
   366 @@ -213,10 +213,19 @@
   323  #  define get_last_socket_error() errno
   367  #  define get_last_socket_error() errno
   324  #  define clear_socket_error()    errno=0
   368  #  define clear_socket_error()    errno=0
   325  #  define ioctlsocket(a,b,c)      ioctl(a,b,c)
   369  #  define ioctlsocket(a,b,c)      ioctl(a,b,c)
   326 +#ifdef	_BOOT
   370 +#ifdef    _BOOT
   327 +#include <netinet/in.h>
   371 +#include <netinet/in.h>
   328 +extern int socket_read(int, void *, size_t, int);
   372 +extern int socket_read(int, void *, size_t, int);
   329 +extern int socket_close(int);
   373 +extern int socket_close(int);
   330 +#  define closesocket(s)          socket_close(s)
   374 +#  define closesocket(s)          socket_close(s)
   331 +#  define readsocket(s,b,n)       socket_read((s),(b),(n), 200)
   375 +#  define readsocket(s,b,n)       socket_read((s),(b),(n), 200)
   340  # ifdef WIN16                   /* never the case */
   384  # ifdef WIN16                   /* never the case */
   341  #  define MS_CALLBACK   _far _loadds
   385  #  define MS_CALLBACK   _far _loadds
   342 --- openssl-1.0.0e/crypto/sparcv9cap.c	2010-09-05 12:48:01.000000000 -0700
   386 --- openssl-1.0.0e/crypto/sparcv9cap.c	2010-09-05 12:48:01.000000000 -0700
   343 +++ openssl-1.0.0e_patched/crypto/sparcv9cap.c	2011-12-23 05:24:02.011607700 -0800
   387 +++ openssl-1.0.0e_patched/crypto/sparcv9cap.c	2011-12-23 05:24:02.011607700 -0800
   344 @@ -12,7 +12,11 @@
   388 @@ -12,7 +12,11 @@
   345  #define SPARCV9_VIS2            (1<<3) /* reserved */
   389  #define SPARCV9_VIS2            (1<<3) /* reserved */		
   346  #define SPARCV9_FMADD           (1<<4) /* reserved for SPARC64 V */
   390  #define SPARCV9_FMADD           (1<<4) /* reserved for SPARC64 V */
   347 
   391 
   348 +#ifndef        _BOOT
   392 +#ifndef        _BOOT
   349  static int OPENSSL_sparcv9cap_P = SPARCV9_TICK_PRIVILEGED;
   393  static int OPENSSL_sparcv9cap_P = SPARCV9_TICK_PRIVILEGED;
   350 +#else
   394 +#else
   390  
   434  
   391 +#ifndef _BOOT
   435 +#ifndef _BOOT
   392  .section	".init",#alloc,#execinstr
   436  .section	".init",#alloc,#execinstr
   393  	call	solaris_locking_setup
   437  	call	solaris_locking_setup
   394  	nop
   438  	nop
   395 	call	OPENSSL_cpuid_setup
   439  	call	OPENSSL_cpuid_setup
   396 	nop
   440  	nop
   397 +#else
   441 +#else
   398 +	nop
   442 +	nop
   399 +	nop
   443 +	nop
   400 +#endif
   444 +#endif
   401 --- openssl-1.0.1c/crypto/Makefile      Thu Aug  2 12:56:38 2012
   445 --- openssl-1.0.1c/crypto/Makefile      Thu Aug  2 12:56:38 2012
   416 +++ openssl-1.0.1f/ssl/s3_clnt.c.new   Thu Jan 30 02:57:51 2014
   460 +++ openssl-1.0.1f/ssl/s3_clnt.c.new   Thu Jan 30 02:57:51 2014
   417 @@ -668,7 +668,11 @@
   461 @@ -668,7 +668,11 @@
   418  
   462  
   419          p = s->s3->client_random;
   463          p = s->s3->client_random;
   420 
   464 
   421 +#ifndef	_BOOT
   465 +#ifndef    _BOOT
   422          if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0)
   466          if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0)
   423 +#else
   467 +#else
   424 +        if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE) <= 0)
   468 +        if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE) <= 0)
   425 +#endif
   469 +#endif
   426              goto err;
   470              goto err;
   430 +++ openssl-1.0.1f/ssl/s3_lib.c.new    Wed Oct 15 11:20:07 2014
   474 +++ openssl-1.0.1f/ssl/s3_lib.c.new    Wed Oct 15 11:20:07 2014
   431 @@ -3343,7 +3343,11 @@
   475 @@ -3343,7 +3343,11 @@
   432           * Apparently we're using a version-flexible SSL_METHOD (not at its
   476           * Apparently we're using a version-flexible SSL_METHOD (not at its
   433           * highest protocol version).
   477           * highest protocol version).
   434           */
   478           */
   435 +#ifndef	_BOOT
   479 +#ifndef    _BOOT
   436          if (s->ctx->method->version == SSLv23_method()->version) {
   480          if (s->ctx->method->version == SSLv23_method()->version) {
   437 +#else
   481 +#else
   438 +        if (s->ctx->method->version == TLS1_2_VERSION) {
   482 +        if (s->ctx->method->version == TLS1_2_VERSION) {
   439 +#endif
   483 +#endif
   440  #if TLS_MAX_VERSION != TLS1_2_VERSION
   484  #if TLS_MAX_VERSION != TLS1_2_VERSION