Don't call ERR_clear_system_error in so many places.

We've got it in entry points. That should be sufficient. (Do we even need it
there?)

Change-Id: I39b245a08fcde7b57e61b0bfc595c6ff4ce2a07a
Reviewed-on: https://boringssl-review.googlesource.com/8127
Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
David Benjamin 2016-06-01 20:19:34 -04:00
parent 4bea8509da
commit 0d275bdb32
6 changed files with 2 additions and 11 deletions

View File

@ -141,8 +141,6 @@ int dtls1_connect(SSL *ssl) {
assert(!ssl->server);
assert(SSL_IS_DTLS(ssl));
ERR_clear_system_error();
if (ssl->info_callback != NULL) {
cb = ssl->info_callback;
} else if (ssl->ctx->info_callback != NULL) {

View File

@ -139,8 +139,6 @@ int dtls1_accept(SSL *ssl) {
assert(ssl->server);
assert(SSL_IS_DTLS(ssl));
ERR_clear_system_error();
if (ssl->info_callback != NULL) {
cb = ssl->info_callback;
} else if (ssl->ctx->info_callback != NULL) {

View File

@ -180,8 +180,6 @@ int ssl3_connect(SSL *ssl) {
assert(!ssl->server);
assert(!SSL_IS_DTLS(ssl));
ERR_clear_system_error();
if (ssl->info_callback != NULL) {
cb = ssl->info_callback;
} else if (ssl->ctx->info_callback != NULL) {

View File

@ -184,8 +184,6 @@ int ssl3_accept(SSL *ssl) {
assert(ssl->server);
assert(!SSL_IS_DTLS(ssl));
ERR_clear_system_error();
if (ssl->info_callback != NULL) {
cb = ssl->info_callback;
} else if (ssl->ctx->info_callback != NULL) {

View File

@ -162,8 +162,6 @@ int ssl_read_buffer_extend_to(SSL *ssl, size_t len) {
return -1;
}
ERR_clear_system_error();
int ret;
if (SSL_IS_DTLS(ssl)) {
/* |len| is ignored for a datagram transport. */
@ -301,7 +299,6 @@ int ssl_write_buffer_flush(SSL *ssl) {
OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET);
return -1;
}
ERR_clear_system_error();
if (SSL_IS_DTLS(ssl)) {
return dtls_write_buffer_flush(ssl);

View File

@ -559,6 +559,7 @@ int SSL_do_handshake(SSL *ssl) {
ssl->rwstate = SSL_NOTHING;
/* Functions which use SSL_get_error must clear the error queue on entry. */
ERR_clear_error();
ERR_clear_system_error();
if (ssl->handshake_func == NULL) {
OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_TYPE_NOT_SET);
@ -665,6 +666,7 @@ int SSL_shutdown(SSL *ssl) {
ssl->rwstate = SSL_NOTHING;
/* Functions which use SSL_get_error must clear the error queue on entry. */
ERR_clear_error();
ERR_clear_system_error();
if (ssl->handshake_func == NULL) {
OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED);