From acaa2c02bf39b7d1f50e2937fef568e9c0df8b41 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 21 May 2013 18:21:22 -0700 Subject: [PATCH] Fixed unencrypted TLS alerts having extra data, ssn12 --- src/internal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 173c89612..0c225ab67 100644 --- a/src/internal.c +++ b/src/internal.c @@ -5503,13 +5503,15 @@ int SendAlert(CYASSL* ssl, int severity, int type) AddRecordHeader(output, ALERT_SIZE, alert, ssl); output += RECORD_HEADER_SZ; #ifdef CYASSL_DTLS - output += DTLS_RECORD_EXTRA; + if (ssl->options.dtls) + output += DTLS_RECORD_EXTRA; #endif XMEMCPY(output, input, ALERT_SIZE); sendSz = RECORD_HEADER_SZ + ALERT_SIZE; #ifdef CYASSL_DTLS - sendSz += DTLS_RECORD_EXTRA; + if (ssl->options.dtls) + sendSz += DTLS_RECORD_EXTRA; #endif }