summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/ssl/s3_pkt.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-11-02 10:47:24 -0200
committerRenato Botelho <renato@netgate.com>2016-11-02 10:47:24 -0200
commitf3b07992fce8a61008ffdc893fde2b53fef7acba (patch)
tree28fbaae043c1906469d04a7ac2bca8a6fd982875 /crypto/openssl/ssl/s3_pkt.c
parentdf5338698255767af680591ff274814676493ffb (diff)
parent2f81d935658287026e614a5edf74ae47f5c54f3f (diff)
downloadFreeBSD-src-f3b07992fce8a61008ffdc893fde2b53fef7acba.zip
FreeBSD-src-f3b07992fce8a61008ffdc893fde2b53fef7acba.tar.gz
Merge remote-tracking branch 'origin/releng/10.3' into RELENG_2_3
Diffstat (limited to 'crypto/openssl/ssl/s3_pkt.c')
-rw-r--r--crypto/openssl/ssl/s3_pkt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/openssl/ssl/s3_pkt.c b/crypto/openssl/ssl/s3_pkt.c
index 25cf929..cbc348a 100644
--- a/crypto/openssl/ssl/s3_pkt.c
+++ b/crypto/openssl/ssl/s3_pkt.c
@@ -1057,6 +1057,13 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
return (ret);
}
+ /*
+ * Reset the count of consecutive warning alerts if we've got a non-empty
+ * record that isn't an alert.
+ */
+ if (rr->type != SSL3_RT_ALERT && rr->length != 0)
+ s->s3->alert_count = 0;
+
/* we now have a packet which can be read and processed */
if (s->s3->change_cipher_spec /* set when we receive ChangeCipherSpec,
@@ -1271,6 +1278,14 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
if (alert_level == SSL3_AL_WARNING) {
s->s3->warn_alert = alert_descr;
+
+ s->s3->alert_count++;
+ if (s->s3->alert_count == MAX_WARN_ALERT_COUNT) {
+ al = SSL_AD_UNEXPECTED_MESSAGE;
+ SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_TOO_MANY_WARN_ALERTS);
+ goto f_err;
+ }
+
if (alert_descr == SSL_AD_CLOSE_NOTIFY) {
s->shutdown |= SSL_RECEIVED_SHUTDOWN;
return (0);
OpenPOWER on IntegriCloud