Skip to content

Commit

Permalink
sending close_notify alert on close_notify alert
Browse files Browse the repository at this point in the history
  • Loading branch information
avbelov23 committed Aug 28, 2019
1 parent b206e75 commit 482a4ed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tls/ttls.c
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,11 @@ ttls_recv(void *tls_data, unsigned char *buf, size_t len, unsigned int *read)
if (unlikely(!ttls_xfrm_ready(tls))) {
if (!(r = ttls_handle_alert(io)))
goto skip_record;
if (io->alert[0] == TTLS_ALERT_LEVEL_WARNING
&& io->alert[1] == TTLS_ALERT_MSG_CLOSE_NOTIFY)
{
ttls_close_notify(tls);
}
return T_DROP;
}
break;
Expand Down Expand Up @@ -2296,6 +2301,11 @@ ttls_recv(void *tls_data, unsigned char *buf, size_t len, unsigned int *read)
if (io->msgtype == TTLS_MSG_ALERT) {
if (!(r = ttls_handle_alert(io)))
goto skip_record;
if (io->alert[0] == TTLS_ALERT_LEVEL_WARNING
&& io->alert[1] == TTLS_ALERT_MSG_CLOSE_NOTIFY)
{
ttls_close_notify(tls);
}
return T_DROP;
}

Expand Down

0 comments on commit 482a4ed

Please sign in to comment.