forked from wolfSSL/wolfssl
fix alert size on send
This commit is contained in:
@ -2895,7 +2895,7 @@ int ReceiveData(SSL* ssl, byte* output, int sz)
|
|||||||
/* send alert message */
|
/* send alert message */
|
||||||
int SendAlert(SSL* ssl, int severity, int type)
|
int SendAlert(SSL* ssl, int severity, int type)
|
||||||
{
|
{
|
||||||
byte input[ALERT_SIZE + MAX_MSG_EXTRA];
|
byte input[ALERT_SIZE];
|
||||||
byte *output;
|
byte *output;
|
||||||
int sendSz;
|
int sendSz;
|
||||||
int ret;
|
int ret;
|
||||||
@ -2920,15 +2920,15 @@ int SendAlert(SSL* ssl, int severity, int type)
|
|||||||
input[1] = type;
|
input[1] = type;
|
||||||
|
|
||||||
if (ssl->keys.encryptionOn)
|
if (ssl->keys.encryptionOn)
|
||||||
sendSz = BuildMessage(ssl, output, input, sizeof(input), alert);
|
sendSz = BuildMessage(ssl, output, input, ALERT_SIZE, alert);
|
||||||
else {
|
else {
|
||||||
RecordLayerHeader *const rl = (RecordLayerHeader*)output;
|
RecordLayerHeader *const rl = (RecordLayerHeader*)output;
|
||||||
rl->type = alert;
|
rl->type = alert;
|
||||||
rl->version = ssl->version;
|
rl->version = ssl->version;
|
||||||
c16toa(ALERT_SIZE, rl->length);
|
c16toa(ALERT_SIZE, rl->length);
|
||||||
|
|
||||||
XMEMCPY(output + RECORD_HEADER_SZ, input, sizeof(input));
|
XMEMCPY(output + RECORD_HEADER_SZ, input, ALERT_SIZE);
|
||||||
sendSz = RECORD_HEADER_SZ + sizeof(input);
|
sendSz = RECORD_HEADER_SZ + ALERT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CYASSL_CALLBACKS
|
#ifdef CYASSL_CALLBACKS
|
||||||
|
Reference in New Issue
Block a user