Add Error state
Reusing an SSL object when it has encountered a fatal error can have bad consequences. This is a bug in application code not libssl but libssl should be more forgiving and not crash. Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
@@ -847,6 +847,7 @@ int ssl3_accept(SSL *s)
|
||||
goto end;
|
||||
/* break; */
|
||||
|
||||
case SSL_ST_ERR:
|
||||
default:
|
||||
SSLerr(SSL_F_SSL3_ACCEPT, SSL_R_UNKNOWN_STATE);
|
||||
ret = -1;
|
||||
@@ -1444,8 +1445,10 @@ int ssl3_get_client_hello(SSL *s)
|
||||
if (0) {
|
||||
f_err:
|
||||
ssl3_send_alert(s, SSL3_AL_FATAL, al);
|
||||
}
|
||||
err:
|
||||
s->state = SSL_ST_ERR;
|
||||
}
|
||||
|
||||
sk_SSL_CIPHER_free(ciphers);
|
||||
return ret < 0 ? -1 : ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user