libressl.patch 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. Patch from OpenBSD
  2. --- a/sslcls.c Sat Jan 24 03:15:22 2015
  3. +++ b/sslcls.c Sat Jul 18 20:01:59 2015
  4. @@ -55,6 +55,7 @@ const SSL_METHOD *sycSSLv2_server_method(void) {
  5. }
  6. #endif
  7. +#ifdef HAVE_SSLv3_client_method
  8. const SSL_METHOD *sycSSLv3_client_method(void) {
  9. const SSL_METHOD *result;
  10. Debug("SSLv3_client_method()");
  11. @@ -62,7 +63,9 @@ const SSL_METHOD *sycSSLv3_client_method(void) {
  12. Debug1("SSLv3_client_method() -> %p", result);
  13. return result;
  14. }
  15. +#endif
  16. +#ifdef HAVE_SSLv3_server_method
  17. const SSL_METHOD *sycSSLv3_server_method(void) {
  18. const SSL_METHOD *result;
  19. Debug("SSLv3_server_method()");
  20. @@ -70,6 +73,7 @@ const SSL_METHOD *sycSSLv3_server_method(void) {
  21. Debug1("SSLv3_server_method() -> %p", result);
  22. return result;
  23. }
  24. +#endif
  25. const SSL_METHOD *sycSSLv23_client_method(void) {
  26. const SSL_METHOD *result;
  27. @@ -331,14 +335,6 @@ void sycSSL_free(SSL *ssl) {
  28. return;
  29. }
  30. -int sycRAND_egd(const char *path) {
  31. - int result;
  32. - Debug1("RAND_egd(\"%s\")", path);
  33. - result = RAND_egd(path);
  34. - Debug1("RAND_egd() -> %d", result);
  35. - return result;
  36. -}
  37. -
  38. DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) {
  39. DH *result;
  40. Debug4("PEM_read_bio_DHparams(%p, %p, %p, %p)",
  41. @@ -375,7 +371,7 @@ int sycFIPS_mode_set(int onoff) {
  42. }
  43. #endif /* WITH_FIPS */
  44. -#if OPENSSL_VERSION_NUMBER >= 0x00908000L
  45. +#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
  46. const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl) {
  47. const COMP_METHOD *result;
  48. Debug1("SSL_get_current_compression(%p)", ssl);
  49. --- a/sslcls.h Sat Jan 24 11:15:22 2015
  50. +++ b/sslcls.h Mon Apr 13 15:06:25 2015
  51. @@ -47,7 +47,6 @@ X509 *sycSSL_get_peer_certificate(SSL *ssl);
  52. int sycSSL_shutdown(SSL *ssl);
  53. void sycSSL_CTX_free(SSL_CTX *ctx);
  54. void sycSSL_free(SSL *ssl);
  55. -int sycRAND_egd(const char *path);
  56. DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u);
  57. @@ -55,7 +54,7 @@ BIO *sycBIO_new_file(const char *filename, const char
  58. int sycFIPS_mode_set(int onoff);
  59. -#if OPENSSL_VERSION_NUMBER >= 0x00908000L
  60. +#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
  61. const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl);
  62. const COMP_METHOD *sycSSL_get_current_expansion(SSL *ssl);
  63. const char *sycSSL_COMP_get_name(const COMP_METHOD *comp);
  64. @@ -98,7 +97,6 @@ const char *sycSSL_COMP_get_name(const COMP_METHOD *co
  65. #define sycSSL_shutdown(s) SSL_shutdown(s)
  66. #define sycSSL_CTX_free(c) SSL_CTX_free(c)
  67. #define sycSSL_free(s) SSL_free(s)
  68. -#define sycRAND_egd(p) RAND_egd(p)
  69. #define sycPEM_read_bio_DHparams(b,x,p,u) PEM_read_bio_DHparams(b,x,p,u)
  70. --- a/xio-openssl.c Sat Jan 24 15:33:42 2015
  71. +++ b/xio-openssl.c Mon Apr 13 14:59:12 2015
  72. @@ -108,7 +108,6 @@ const struct optdesc opt_openssl_key = { "open
  73. const struct optdesc opt_openssl_dhparam = { "openssl-dhparam", "dh", OPT_OPENSSL_DHPARAM, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
  74. const struct optdesc opt_openssl_cafile = { "openssl-cafile", "cafile", OPT_OPENSSL_CAFILE, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
  75. const struct optdesc opt_openssl_capath = { "openssl-capath", "capath", OPT_OPENSSL_CAPATH, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
  76. -const struct optdesc opt_openssl_egd = { "openssl-egd", "egd", OPT_OPENSSL_EGD, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
  77. const struct optdesc opt_openssl_pseudo = { "openssl-pseudo", "pseudo", OPT_OPENSSL_PSEUDO, GROUP_OPENSSL, PH_SPEC, TYPE_BOOL, OFUNC_SPEC };
  78. #if OPENSSL_VERSION_NUMBER >= 0x00908000L
  79. const struct optdesc opt_openssl_compress = { "openssl-compress", "compress", OPT_OPENSSL_COMPRESS, GROUP_OPENSSL, PH_SPEC, TYPE_STRING, OFUNC_SPEC };
  80. @@ -147,7 +146,7 @@ int xio_reset_fips_mode(void) {
  81. static void openssl_conn_loginfo(SSL *ssl) {
  82. Notice1("SSL connection using %s", SSL_get_cipher(ssl));
  83. -#if OPENSSL_VERSION_NUMBER >= 0x00908000L
  84. +#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
  85. {
  86. const COMP_METHOD *comp, *expansion;
  87. @@ -722,7 +721,6 @@ int
  88. char *opt_dhparam = NULL; /* file name of DH params */
  89. char *opt_cafile = NULL; /* certificate authority file */
  90. char *opt_capath = NULL; /* certificate authority directory */
  91. - char *opt_egd = NULL; /* entropy gathering daemon socket path */
  92. #if OPENSSL_VERSION_NUMBER >= 0x00908000L
  93. char *opt_compress = NULL; /* compression method */
  94. #endif
  95. @@ -741,7 +739,6 @@ int
  96. retropt_string(opts, OPT_OPENSSL_CAPATH, &opt_capath);
  97. retropt_string(opts, OPT_OPENSSL_KEY, &opt_key);
  98. retropt_string(opts, OPT_OPENSSL_DHPARAM, &opt_dhparam);
  99. - retropt_string(opts, OPT_OPENSSL_EGD, &opt_egd);
  100. retropt_bool(opts,OPT_OPENSSL_PSEUDO, &opt_pseudo);
  101. #if OPENSSL_VERSION_NUMBER >= 0x00908000L
  102. retropt_string(opts, OPT_OPENSSL_COMPRESS, &opt_compress);
  103. @@ -877,10 +874,6 @@ int
  104. }
  105. }
  106. - if (opt_egd) {
  107. - sycRAND_egd(opt_egd);
  108. - }
  109. -
  110. if (opt_pseudo) {
  111. long int randdata;
  112. /* initialize libc random from actual microseconds */
  113. @@ -1098,7 +1091,7 @@ static int openssl_SSL_ERROR_SSL(int level, const char
  114. if (e == ((ERR_LIB_RAND<<24)|
  115. (RAND_F_SSLEAY_RAND_BYTES<<12)|
  116. (RAND_R_PRNG_NOT_SEEDED)) /*0x24064064*/) {
  117. - Error("too few entropy; use options \"egd\" or \"pseudo\"");
  118. + Error("too few entropy; use option \"pseudo\"");
  119. stat = STAT_NORETRY;
  120. } else {
  121. Msg2(level, "%s(): %s", funcname, ERR_error_string(e, buf));
  122. --- a/xio-openssl.h Sun Jun 23 07:16:48 2013
  123. +++ b/xio-openssl.h Sat Apr 19 15:58:21 2014
  124. @@ -21,7 +21,6 @@ extern const struct optdesc opt_openssl_key;
  125. extern const struct optdesc opt_openssl_dhparam;
  126. extern const struct optdesc opt_openssl_cafile;
  127. extern const struct optdesc opt_openssl_capath;
  128. -extern const struct optdesc opt_openssl_egd;
  129. extern const struct optdesc opt_openssl_pseudo;
  130. #if OPENSSL_VERSION_NUMBER >= 0x00908000L
  131. extern const struct optdesc opt_openssl_compress;
  132. --- a/xioopts.c Sat Jan 24 11:15:22 2015
  133. +++ b/xioopts.c Mon Apr 13 15:06:25 2015
  134. @@ -412,7 +412,6 @@ const struct optname optionnames[] = {
  135. #ifdef ECHOPRT
  136. IF_TERMIOS("echoprt", &opt_echoprt)
  137. #endif
  138. - IF_OPENSSL("egd", &opt_openssl_egd)
  139. IF_ANY ("end-close", &opt_end_close)
  140. IF_TERMIOS("eof", &opt_veof)
  141. IF_TERMIOS("eol", &opt_veol)
  142. @@ -1102,7 +1101,6 @@ const struct optname optionnames[] = {
  143. IF_OPENSSL("openssl-compress", &opt_openssl_compress)
  144. #endif
  145. IF_OPENSSL("openssl-dhparam", &opt_openssl_dhparam)
  146. - IF_OPENSSL("openssl-egd", &opt_openssl_egd)
  147. #if WITH_FIPS
  148. IF_OPENSSL("openssl-fips", &opt_openssl_fips)
  149. #endif
  150. --- a/xioopts.h Sat Jan 24 11:15:22 2015
  151. +++ b/xioopts.h Mon Apr 13 15:06:25 2015
  152. @@ -478,7 +478,6 @@ enum e_optcode {
  153. OPT_OPENSSL_COMPRESS,
  154. #endif
  155. OPT_OPENSSL_DHPARAM,
  156. - OPT_OPENSSL_EGD,
  157. OPT_OPENSSL_FIPS,
  158. OPT_OPENSSL_KEY,
  159. OPT_OPENSSL_METHOD,