2
0

200-Partially-revert-Detect-EOF-while-reading-in-libssl.patch 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From 30d190caf311d534867df97e26b552e628cb7d85 Mon Sep 17 00:00:00 2001
  2. From: Tomas Mraz <tmraz@fedoraproject.org>
  3. Date: Wed, 25 Mar 2020 14:15:31 +0100
  4. Subject: [PATCH] Partially revert "Detect EOF while reading in libssl"
  5. This partially reverts commit db943f43a60d1b5b1277e4b5317e8f288e7a0a3a.
  6. Reviewed-by: Matt Caswell <matt@openssl.org>
  7. (Merged from https://github.com/openssl/openssl/pull/11400)
  8. diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt
  9. index f5324c6819..35512f9caf 100644
  10. --- a/crypto/err/openssl.txt
  11. +++ b/crypto/err/openssl.txt
  12. @@ -2852,7 +2852,6 @@ SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES:242:unable to load ssl3 md5 routines
  13. SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES:243:unable to load ssl3 sha1 routines
  14. SSL_R_UNEXPECTED_CCS_MESSAGE:262:unexpected ccs message
  15. SSL_R_UNEXPECTED_END_OF_EARLY_DATA:178:unexpected end of early data
  16. -SSL_R_UNEXPECTED_EOF_WHILE_READING:294:unexpected eof while reading
  17. SSL_R_UNEXPECTED_MESSAGE:244:unexpected message
  18. SSL_R_UNEXPECTED_RECORD:245:unexpected record
  19. SSL_R_UNINITIALIZED:276:uninitialized
  20. diff --git a/include/openssl/sslerr.h b/include/openssl/sslerr.h
  21. index 0ef684f3c1..ba4c4ae5fb 100644
  22. --- a/include/openssl/sslerr.h
  23. +++ b/include/openssl/sslerr.h
  24. @@ -1,6 +1,6 @@
  25. /*
  26. * Generated by util/mkerr.pl DO NOT EDIT
  27. - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
  28. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
  29. *
  30. * Licensed under the OpenSSL license (the "License"). You may not use
  31. * this file except in compliance with the License. You can obtain a copy
  32. @@ -734,7 +734,6 @@ int ERR_load_SSL_strings(void);
  33. # define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
  34. # define SSL_R_UNEXPECTED_CCS_MESSAGE 262
  35. # define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178
  36. -# define SSL_R_UNEXPECTED_EOF_WHILE_READING 294
  37. # define SSL_R_UNEXPECTED_MESSAGE 244
  38. # define SSL_R_UNEXPECTED_RECORD 245
  39. # define SSL_R_UNINITIALIZED 276
  40. diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
  41. index 1c885a664f..b2a7a47eb0 100644
  42. --- a/ssl/record/rec_layer_s3.c
  43. +++ b/ssl/record/rec_layer_s3.c
  44. @@ -296,12 +296,6 @@ int ssl3_read_n(SSL *s, size_t n, size_t max, int extend, int clearold,
  45. ret = BIO_read(s->rbio, pkt + len + left, max - left);
  46. if (ret >= 0)
  47. bioread = ret;
  48. - if (ret <= 0
  49. - && !BIO_should_retry(s->rbio)
  50. - && BIO_eof(s->rbio)) {
  51. - SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_F_SSL3_READ_N,
  52. - SSL_R_UNEXPECTED_EOF_WHILE_READING);
  53. - }
  54. } else {
  55. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_READ_N,
  56. SSL_R_READ_BIO_NOT_SET);
  57. diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c
  58. index a0c7b79659..4b12ed1485 100644
  59. --- a/ssl/ssl_err.c
  60. +++ b/ssl/ssl_err.c
  61. @@ -1,6 +1,6 @@
  62. /*
  63. * Generated by util/mkerr.pl DO NOT EDIT
  64. - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
  65. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
  66. *
  67. * Licensed under the OpenSSL license (the "License"). You may not use
  68. * this file except in compliance with the License. You can obtain a copy
  69. @@ -1205,8 +1205,6 @@ static const ERR_STRING_DATA SSL_str_reasons[] = {
  70. "unexpected ccs message"},
  71. {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_END_OF_EARLY_DATA),
  72. "unexpected end of early data"},
  73. - {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_EOF_WHILE_READING),
  74. - "unexpected eof while reading"},
  75. {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_MESSAGE), "unexpected message"},
  76. {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_RECORD), "unexpected record"},
  77. {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNINITIALIZED), "uninitialized"},