[openssl-commits] [openssl] OpenSSL_1_0_1-stable update

Matt Caswell matt at openssl.org
Thu Mar 5 09:32:03 UTC 2015


The branch OpenSSL_1_0_1-stable has been updated
       via  183db9af80510abfe522c97387268906fd1d31c6 (commit)
      from  9f114219508d64a5b9522006eab1ed2db918dd25 (commit)


- Log -----------------------------------------------------------------
commit 183db9af80510abfe522c97387268906fd1d31c6
Author: Kurt Cancemi <kurt at x64architecture.com>
Date:   Wed Mar 4 10:57:45 2015 +0000

    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 at openssl.org>
    (cherry picked from commit fd865cadcb603918bdcfcf44e487721c657a1117)

-----------------------------------------------------------------------

Summary of changes:
 ssl/d1_pkt.c | 4 ++--
 ssl/s3_pkt.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index 2abb7ef..0985bb0 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -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);
         }
 
-        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
@@ -1187,7 +1187,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 d422abf..7c9f20c 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -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);
         }
 
-        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;
@@ -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)
                 return (0);
 #endif
-        } else if (alert_level == 2) { /* fatal */
+        } else if (alert_level == SSL3_AL_FATAL) {
             char tmp[16];
 
             s->rwstate = SSL_NOTHING;


More information about the openssl-commits mailing list