summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_pkt.c
diff options
context:
space:
mode:
authorjsing <>2021-07-31 09:31:04 +0000
committerjsing <>2021-07-31 09:31:04 +0000
commit6b4cb95d17ea02c148cb13d001279ae95a192b62 (patch)
tree1f58d65a92c2d43bc101eb983e362b70b06ef12a /src/lib/libssl/d1_pkt.c
parentf9d12ac132435716ba1d1886ac306596071b29e0 (diff)
downloadopenbsd-6b4cb95d17ea02c148cb13d001279ae95a192b62.tar.gz
openbsd-6b4cb95d17ea02c148cb13d001279ae95a192b62.tar.bz2
openbsd-6b4cb95d17ea02c148cb13d001279ae95a192b62.zip
We have defines for alert levels - use them instead of magic numbers.
Diffstat (limited to 'src/lib/libssl/d1_pkt.c')
-rw-r--r--src/lib/libssl/d1_pkt.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index acd66e622c..6963e58ed3 100644
--- a/src/lib/libssl/d1_pkt.c
+++ b/src/lib/libssl/d1_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_pkt.c,v 1.104 2021/07/26 03:17:38 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.105 2021/07/31 09:31:04 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -786,15 +786,13 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
786 cb(s, SSL_CB_READ_ALERT, j); 786 cb(s, SSL_CB_READ_ALERT, j);
787 } 787 }
788 788
789 if (alert_level == 1) /* warning */ 789 if (alert_level == SSL3_AL_WARNING) {
790 {
791 S3I(s)->warn_alert = alert_descr; 790 S3I(s)->warn_alert = alert_descr;
792 if (alert_descr == SSL_AD_CLOSE_NOTIFY) { 791 if (alert_descr == SSL_AD_CLOSE_NOTIFY) {
793 s->internal->shutdown |= SSL_RECEIVED_SHUTDOWN; 792 s->internal->shutdown |= SSL_RECEIVED_SHUTDOWN;
794 return (0); 793 return (0);
795 } 794 }
796 } else if (alert_level == 2) /* fatal */ 795 } else if (alert_level == SSL3_AL_FATAL) {
797 {
798 s->internal->rwstate = SSL_NOTHING; 796 s->internal->rwstate = SSL_NOTHING;
799 S3I(s)->fatal_alert = alert_descr; 797 S3I(s)->fatal_alert = alert_descr;
800 SSLerror(s, SSL_AD_REASON_OFFSET + alert_descr); 798 SSLerror(s, SSL_AD_REASON_OFFSET + alert_descr);