From: Kurt Cancemi Date: Wed, 4 Mar 2015 10:57:45 +0000 (+0000) Subject: Use constants not numbers X-Git-Tag: OpenSSL_1_0_2a~54 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f9a21ed069846c4c18f9894bbef2fc77551a1028;p=oweals%2Fopenssl.git Use constants not numbers This patch uses warning/fatal constants instead of numbers with comments for warning/alerts in d1_pkt.c and s3_pkt.c RT#3725 Reviewed-by: Rich Salz (cherry picked from commit fd865cadcb603918bdcfcf44e487721c657a1117) --- diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c index c07be8fd3a..bf96f60911 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -1142,7 +1142,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) cb(s, SSL_CB_READ_ALERT, j); } - if (alert_level == 1) { /* warning */ + if (alert_level == SSL3_AL_WARNING) { s->s3->warn_alert = alert_descr; if (alert_descr == SSL_AD_CLOSE_NOTIFY) { #ifndef OPENSSL_NO_SCTP @@ -1191,7 +1191,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } } #endif - } else if (alert_level == 2) { /* fatal */ + } else if (alert_level == SSL3_AL_FATAL) { char tmp[16]; s->rwstate = SSL_NOTHING; diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 136d273d06..4e6a41bd58 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -1430,7 +1430,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) cb(s, SSL_CB_READ_ALERT, j); } - if (alert_level == 1) { /* warning */ + if (alert_level == SSL3_AL_WARNING) { s->s3->warn_alert = alert_descr; if (alert_descr == SSL_AD_CLOSE_NOTIFY) { s->shutdown |= SSL_RECEIVED_SHUTDOWN; @@ -1453,7 +1453,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) else if (alert_descr == SSL_AD_MISSING_SRP_USERNAME) return (0); #endif - } else if (alert_level == 2) { /* fatal */ + } else if (alert_level == SSL3_AL_FATAL) { char tmp[16]; s->rwstate = SSL_NOTHING;