summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_pkt.c
diff options
context:
space:
mode:
authorjsing <>2014-06-05 15:46:24 +0000
committerjsing <>2014-06-05 15:46:24 +0000
commita1aa52709d3c53d1664e282da9d9833869ffcf47 (patch)
tree645cbc9565ca3ee2061f628e95849ce560cf786f /src/lib/libssl/s3_pkt.c
parentd874ba6e9641314de878a6d18eaefe826cbe532b (diff)
downloadopenbsd-a1aa52709d3c53d1664e282da9d9833869ffcf47.tar.gz
openbsd-a1aa52709d3c53d1664e282da9d9833869ffcf47.tar.bz2
openbsd-a1aa52709d3c53d1664e282da9d9833869ffcf47.zip
Be selective as to when ChangeCipherSpec messages will be accepted.
Without this an early ChangeCipherSpec message would result in session keys being generated, along with the Finished hash for the handshake, using an empty master secret. For a detailed analysis see: https://www.imperialviolet.org/2014/06/05/earlyccs.html This is a fix for CVE-2014-0224, from OpenSSL. This issue was reported to OpenSSL by KIKUCHI Masashi. Unfortunately the recent OpenSSL commit was the first we were made aware of the issue. ok deraadt@ sthen@
Diffstat (limited to '')
-rw-r--r--src/lib/libssl/s3_pkt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/libssl/s3_pkt.c b/src/lib/libssl/s3_pkt.c
index f8f31f2a4a..58d8221fe4 100644
--- a/src/lib/libssl/s3_pkt.c
+++ b/src/lib/libssl/s3_pkt.c
@@ -1209,6 +1209,14 @@ start:
1209 goto f_err; 1209 goto f_err;
1210 } 1210 }
1211 1211
1212 /* Check that we should be receiving a Change Cipher Spec. */
1213 if (!(s->s3->flags & SSL3_FLAGS_CCS_OK)) {
1214 al = SSL_AD_UNEXPECTED_MESSAGE;
1215 SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_CCS_RECEIVED_EARLY);
1216 goto f_err;
1217 }
1218 s->s3->flags &= ~SSL3_FLAGS_CCS_OK;
1219
1212 rr->length = 0; 1220 rr->length = 0;
1213 1221
1214 if (s->msg_callback) { 1222 if (s->msg_callback) {