Skip to content

Commit 5725e4e

Browse files
committed
Add call ERR_clear_error() before SSL_* calls bumptech#100
Merge remote-tracking branch 'source/pr/100'
2 parents addbdc6 + f6dfcf8 commit 5725e4e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stud.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,7 @@ static void client_handshake(struct ev_loop *loop, ev_io *w, int revents) {
13591359
int t;
13601360
proxystate *ps = (proxystate *)w->data;
13611361

1362+
ERR_clear_error();
13621363
t = SSL_do_handshake(ps->ssl);
13631364
if (t == 1) {
13641365
end_handshake(ps);
@@ -1415,6 +1416,7 @@ static void ssl_read(struct ev_loop *loop, ev_io *w, int revents) {
14151416
return;
14161417
}
14171418
char * buf = ringbuffer_write_ptr(&ps->ring_ssl2clear);
1419+
ERR_clear_error();
14181420
t = SSL_read(ps->ssl, buf, RING_DATA_LEN);
14191421

14201422
/* Fix CVE-2009-3555. Disable reneg if started by client. */
@@ -1450,6 +1452,7 @@ static void ssl_write(struct ev_loop *loop, ev_io *w, int revents) {
14501452
proxystate *ps = (proxystate *)w->data;
14511453
assert(!ringbuffer_is_empty(&ps->ring_clear2ssl));
14521454
char * next = ringbuffer_read_next(&ps->ring_clear2ssl, &sz);
1455+
ERR_clear_error();
14531456
t = SSL_write(ps->ssl, next, sz);
14541457
if (t > 0) {
14551458
if (t == sz) {

0 commit comments

Comments
 (0)