Fix BAD CCS alert in DTLS
authorMatt Caswell <matt@openssl.org>
Tue, 21 Mar 2017 16:12:37 +0000 (16:12 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 21 Mar 2017 16:23:33 +0000 (16:23 +0000)
Set the correct variable, and then actually send the alert!

Found by, and fix suggested by, Raja Ashok.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3009)

ssl/d1_pkt.c

index 7a02459f2b7876bfbfbbbe91e7d29fe4b16f4c4f..10586fee5408ea12be8d6f7d697ed35d8d2653d6 100644 (file)
@@ -1323,9 +1323,9 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
         /* XDTLS: check that epoch is consistent */
         if ((rr->length != ccs_hdr_len) ||
             (rr->off != 0) || (rr->data[0] != SSL3_MT_CCS)) {
-            i = SSL_AD_ILLEGAL_PARAMETER;
+            al = SSL_AD_ILLEGAL_PARAMETER;
             SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_BAD_CHANGE_CIPHER_SPEC);
-            goto err;
+            goto f_err;
         }
 
         rr->length = 0;