aboutsummaryrefslogtreecommitdiff
path: root/openssl/ssl/s3_pkt.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-06-15 20:18:50 +0200
committerMike DePaulo <mikedep333@gmail.com>2015-06-22 01:16:46 -0400
commit36da4a2e0e43928a29ac2ee5c55bf681e90e2f42 (patch)
tree92633e1022d705c72d0f97315891e719648dd17e /openssl/ssl/s3_pkt.c
parentbec4be4c48239613ed1c704ae71bf08754eef711 (diff)
downloadvcxsrv-release/external-1.17.0.0-x.tar.gz
vcxsrv-release/external-1.17.0.0-x.tar.bz2
vcxsrv-release/external-1.17.0.0-x.zip
Update to openssl-1.0.2crelease/external-1.17.0.0-x
Diffstat (limited to 'openssl/ssl/s3_pkt.c')
-rw-r--r--openssl/ssl/s3_pkt.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/openssl/ssl/s3_pkt.c b/openssl/ssl/s3_pkt.c
index 221ae039e..603c285ac 100644
--- a/openssl/ssl/s3_pkt.c
+++ b/openssl/ssl/s3_pkt.c
@@ -361,11 +361,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;
}
@@ -708,7 +719,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
packlen *= 4;
wb->buf = OPENSSL_malloc(packlen);
- if(!wb->buf) {
+ if (!wb->buf) {
SSLerr(SSL_F_SSL3_WRITE_BYTES, ERR_R_MALLOC_FAILURE);
return -1;
}