1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-01 03:47:23 +03:00

Fixed closure alerts.

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@208 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich
2011-05-07 00:10:20 +00:00
parent 70a8f79fa6
commit 42cd25fa9d
2 changed files with 9 additions and 5 deletions

View File

@ -247,8 +247,8 @@ EXP_FUNC void STDCALL ssl_free(SSL *ssl)
return;
/* only notify if we weren't notified first */
if (!IS_SET_SSL_FLAG(SSL_RECEIVED_CLOSE_NOTIFY))
/* spec says we must notify when we are dying */
/* spec says we must notify when we are dying */
if (!IS_SET_SSL_FLAG(SSL_SENT_CLOSE_NOTIFY))
send_alert(ssl, SSL_ALERT_CLOSE_NOTIFY);
ssl_ctx = ssl->ssl_ctx;
@ -1021,6 +1021,7 @@ int send_packet(SSL *ssl, uint8_t protocol, const uint8_t *in, int length)
}
msg_length += length;
if (IS_SET_SSL_FLAG(SSL_TX_ENCRYPTED))
{
int mode = IS_SET_SSL_FLAG(SSL_IS_CLIENT) ?
@ -1360,12 +1361,15 @@ int basic_read(SSL *ssl, uint8_t **in_data)
buf[1] == SSL_ALERT_CLOSE_NOTIFY)
{
ret = SSL_CLOSE_NOTIFY;
SET_SSL_FLAG(SSL_RECEIVED_CLOSE_NOTIFY);
send_alert(ssl, SSL_ALERT_CLOSE_NOTIFY);
SET_SSL_FLAG(SSL_SENT_CLOSE_NOTIFY);
}
else
{
ret = -buf[1];
DISPLAY_ALERT(ssl, buf[1]);
}
DISPLAY_ALERT(ssl, buf[1]);
break;
default:

View File

@ -65,7 +65,7 @@ extern "C" {
#define SSL_SESSION_RESUME 0x0008
#define SSL_IS_CLIENT 0x0010
#define SSL_HAS_CERT_REQ 0x0020
#define SSL_RECEIVED_CLOSE_NOTIFY 0x0040
#define SSL_SENT_CLOSE_NOTIFY 0x0040
/* some macros to muck around with flag bits */
#define SET_SSL_FLAG(A) (ssl->flag |= A)