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 <rsalz@openssl.org>
(cherry picked from commit fd865cadcb603918bdcfcf44e487721c657a1117)
This commit is contained in:
Kurt Cancemi 2015-03-04 10:57:45 +00:00 committed by Matt Caswell
parent 9f11421950
commit 183db9af80
2 changed files with 4 additions and 4 deletions

View File

@ -1138,7 +1138,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
cb(s, SSL_CB_READ_ALERT, j); cb(s, SSL_CB_READ_ALERT, j);
} }
if (alert_level == 1) { /* warning */ if (alert_level == SSL3_AL_WARNING) {
s->s3->warn_alert = alert_descr; s->s3->warn_alert = alert_descr;
if (alert_descr == SSL_AD_CLOSE_NOTIFY) { if (alert_descr == SSL_AD_CLOSE_NOTIFY) {
#ifndef OPENSSL_NO_SCTP #ifndef OPENSSL_NO_SCTP
@ -1187,7 +1187,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
} }
} }
#endif #endif
} else if (alert_level == 2) { /* fatal */ } else if (alert_level == SSL3_AL_FATAL) {
char tmp[16]; char tmp[16];
s->rwstate = SSL_NOTHING; s->rwstate = SSL_NOTHING;

View File

@ -1258,7 +1258,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
cb(s, SSL_CB_READ_ALERT, j); cb(s, SSL_CB_READ_ALERT, j);
} }
if (alert_level == 1) { /* warning */ if (alert_level == SSL3_AL_WARNING) {
s->s3->warn_alert = alert_descr; s->s3->warn_alert = alert_descr;
if (alert_descr == SSL_AD_CLOSE_NOTIFY) { if (alert_descr == SSL_AD_CLOSE_NOTIFY) {
s->shutdown |= SSL_RECEIVED_SHUTDOWN; s->shutdown |= SSL_RECEIVED_SHUTDOWN;
@ -1281,7 +1281,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) else if (alert_descr == SSL_AD_MISSING_SRP_USERNAME)
return (0); return (0);
#endif #endif
} else if (alert_level == 2) { /* fatal */ } else if (alert_level == SSL3_AL_FATAL) {
char tmp[16]; char tmp[16];
s->rwstate = SSL_NOTHING; s->rwstate = SSL_NOTHING;