Skip to content

Commit

Permalink
Revert "Forbid calling SSL_read, SSL_peek, and SSL_do_handshake post-…
Browse files Browse the repository at this point in the history
…shutdown."

This reverts commit c7eae5a. pyOpenSSL
expects to be able to call |SSL_read| after a shutdown and get EOF.

Change-Id: Icc5faa09d644ec29aac99b181dac0db197f283e3
Reviewed-on: https://boringssl-review.googlesource.com/8060
Reviewed-by: Adam Langley <[email protected]>
  • Loading branch information
Adam Langley authored and agl committed May 25, 2016
1 parent 494650c commit 1cb405d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 1 addition & 2 deletions ssl/s3_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,7 @@ int ssl3_read_bytes(SSL *ssl, int type, uint8_t *buf, int len, int peek) {
/* Begin a new handshake. */
ssl->s3->total_renegotiations++;
ssl->state = SSL_ST_CONNECT;
/* TODO(davidben): Lift this call up to SSL_read. */
i = SSL_do_handshake(ssl);
i = ssl->handshake_func(ssl);
if (i < 0) {
return i;
}
Expand Down
10 changes: 0 additions & 10 deletions ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,6 @@ int SSL_do_handshake(SSL *ssl) {
return -1;
}

if (ssl->s3->send_shutdown != ssl_shutdown_none) {
OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN);
return -1;
}

if (!SSL_in_init(ssl)) {
return 1;
}
Expand Down Expand Up @@ -610,11 +605,6 @@ static int ssl_read_impl(SSL *ssl, void *buf, int num, int peek) {
return -1;
}

if (ssl->s3->send_shutdown != ssl_shutdown_none) {
OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN);
return -1;
}

/* This may require multiple iterations. False Start will cause
* |ssl->handshake_func| to signal success one step early, but the handshake
* must be completely finished before other modes are accepted. */
Expand Down

0 comments on commit 1cb405d

Please sign in to comment.