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