s->shutdown |= SSL_RECEIVED_SHUTDOWN;
SSL3_RECORD_set_read(rr);
SSL_CTX_remove_session(s->session_ctx, s->session);
+ ossl_statem_set_error(s);
return (0);
} else {
al = SSL_AD_ILLEGAL_PARAMETER;
s->shutdown |= SSL_RECEIVED_SHUTDOWN;
SSL3_RECORD_set_read(rr);
SSL_CTX_remove_session(s->session_ctx, s->session);
+ ossl_statem_set_error(s);
return (0);
} else {
al = SSL_AD_ILLEGAL_PARAMETER;
* protocol_version alerts */
if (desc < 0)
return -1;
- /* If a fatal one, remove from cache */
- if ((level == SSL3_AL_FATAL) && (s->session != NULL))
- SSL_CTX_remove_session(s->session_ctx, s->session);
+ /* If a fatal one, remove from cache and go into the error state */
+ if (level == SSL3_AL_FATAL) {
+ if (s->session != NULL)
+ SSL_CTX_remove_session(s->session_ctx, s->session);
+ ossl_statem_set_error(s);
+ }
s->s3->alert_dispatch = 1;
s->s3->send_alert[0] = level;