summaryrefslogtreecommitdiff
path: root/src/lib
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
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')
-rw-r--r--src/lib/libssl/d1_pkt.c8
-rw-r--r--src/lib/libssl/ssl_pkt.c4
2 files changed, 5 insertions, 7 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);
diff --git a/src/lib/libssl/ssl_pkt.c b/src/lib/libssl/ssl_pkt.c
index c3fd4a7365..2b1a6a41a2 100644
--- a/src/lib/libssl/ssl_pkt.c
+++ b/src/lib/libssl/ssl_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_pkt.c,v 1.46 2021/07/26 03:17:38 jsing Exp $ */ 1/* $OpenBSD: ssl_pkt.c,v 1.47 2021/07/31 09:31:04 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1204,7 +1204,7 @@ int
1204ssl3_send_alert(SSL *s, int level, int desc) 1204ssl3_send_alert(SSL *s, int level, int desc)
1205{ 1205{
1206 /* If a fatal one, remove from cache */ 1206 /* If a fatal one, remove from cache */
1207 if ((level == 2) && (s->session != NULL)) 1207 if ((level == SSL3_AL_FATAL) && (s->session != NULL))
1208 SSL_CTX_remove_session(s->ctx, s->session); 1208 SSL_CTX_remove_session(s->ctx, s->session);
1209 1209
1210 S3I(s)->alert_dispatch = 1; 1210 S3I(s)->alert_dispatch = 1;