summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/ssl/s3_pkt.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2015-06-11 19:00:55 +0000
committerjkim <jkim@FreeBSD.org>2015-06-11 19:00:55 +0000
commitd675e841ef78a78bab5972d63fa3d8d15ecdbb19 (patch)
treeaf421c8f5f156e1b4b26149d5c4964d037dd0454 /crypto/openssl/ssl/s3_pkt.c
parentaec7d82113b7de83f7ac3f9470fde49813358dec (diff)
downloadFreeBSD-src-d675e841ef78a78bab5972d63fa3d8d15ecdbb19.zip
FreeBSD-src-d675e841ef78a78bab5972d63fa3d8d15ecdbb19.tar.gz
Merge OpenSSL 1.0.1n.
Diffstat (limited to 'crypto/openssl/ssl/s3_pkt.c')
-rw-r--r--crypto/openssl/ssl/s3_pkt.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/crypto/openssl/ssl/s3_pkt.c b/crypto/openssl/ssl/s3_pkt.c
index 7c9f20c..25cf929 100644
--- a/crypto/openssl/ssl/s3_pkt.c
+++ b/crypto/openssl/ssl/s3_pkt.c
@@ -347,11 +347,22 @@ static int ssl3_get_record(SSL *s)
if (version != s->version) {
SSLerr(SSL_F_SSL3_GET_RECORD, SSL_R_WRONG_VERSION_NUMBER);
if ((s->version & 0xFF00) == (version & 0xFF00)
- && !s->enc_write_ctx && !s->write_hash)
+ && !s->enc_write_ctx && !s->write_hash) {
+ if (rr->type == SSL3_RT_ALERT) {
+ /*
+ * The record is using an incorrect version number, but
+ * what we've got appears to be an alert. We haven't
+ * read the body yet to check whether its a fatal or
+ * not - but chances are it is. We probably shouldn't
+ * send a fatal alert back. We'll just end.
+ */
+ goto err;
+ }
/*
* Send back error using their minor version number :-)
*/
s->version = (unsigned short)version;
+ }
al = SSL_AD_PROTOCOL_VERSION;
goto f_err;
}
OpenPOWER on IntegriCloud