提交 fd865cad 编写于 作者: K Kurt Cancemi 提交者: Matt Caswell

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: NRich Salz <rsalz@openssl.org>
上级 918bb865
......@@ -1088,7 +1088,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
......@@ -1137,7 +1137,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;
......
......@@ -1451,7 +1451,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;
......@@ -1474,7 +1474,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册