Use the new TLSv1.3 certificate_required alert where appropriate
authorMatt Caswell <matt@openssl.org>
Fri, 10 Mar 2017 15:09:24 +0000 (15:09 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 10 Mar 2017 15:33:31 +0000 (15:33 +0000)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2898)

include/openssl/ssl.h
include/openssl/tls1.h
ssl/s3_enc.c
ssl/statem/statem_srvr.c
ssl/t1_enc.c

index 9fbf3d1b1197d2bc0c2823b65611b5a86a073bed..488ce4f39c14362dab95819a20a5b75353af2d30 100644 (file)
@@ -1029,6 +1029,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
 # define SSL_AD_NO_RENEGOTIATION         TLS1_AD_NO_RENEGOTIATION
 # define SSL_AD_END_OF_EARLY_DATA        TLS13_AD_END_OF_EARLY_DATA
 # define SSL_AD_MISSING_EXTENSION        TLS13_AD_MISSING_EXTENSION
+# define SSL_AD_CERTIFICATE_REQUIRED     TLS13_AD_CERTIFICATE_REQUIRED
 # define SSL_AD_UNSUPPORTED_EXTENSION    TLS1_AD_UNSUPPORTED_EXTENSION
 # define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
 # define SSL_AD_UNRECOGNIZED_NAME        TLS1_AD_UNRECOGNIZED_NAME
index 280d131c6f2a0a25ccab67cec6bb39f54b96e3a1..cf06f72748969213a4dd65a08a2770fbefb53f8e 100644 (file)
@@ -106,6 +106,7 @@ extern "C" {
 /* TLSv1.3 alerts */
 # define TLS13_AD_END_OF_EARLY_DATA      1
 # define TLS13_AD_MISSING_EXTENSION      109 /* fatal */
+# define TLS13_AD_CERTIFICATE_REQUIRED   116 /* fatal */
 /* codes 110-114 are from RFC3546 */
 # define TLS1_AD_UNSUPPORTED_EXTENSION   110
 # define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
index 165135707acb63d2ae9144af7d4a66907abf2e67..88e74edf2beb856b99777e1d1d828be00ec2d96c 100644 (file)
@@ -591,6 +591,8 @@ int ssl3_alert_code(int code)
         return (TLS1_AD_INAPPROPRIATE_FALLBACK);
     case SSL_AD_NO_APPLICATION_PROTOCOL:
         return (TLS1_AD_NO_APPLICATION_PROTOCOL);
+    case SSL_AD_CERTIFICATE_REQUIRED:
+        return SSL_AD_HANDSHAKE_FAILURE;
     default:
         return (-1);
     }
index 6c007a130299856efe89aaef7fbc51b36ec94eb9..2e381fdd027803da5f7e8c86752ae4e91f63da12 100644 (file)
@@ -3280,7 +3280,7 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt)
                  (s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)) {
             SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,
                    SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE);
-            al = SSL_AD_HANDSHAKE_FAILURE;
+            al = SSL_AD_CERTIFICATE_REQUIRED;
             goto f_err;
         }
         /* No client certificate so digest cached records */
index 2969b88c80d4f994683bf9a44102a944f0301a1b..16db3054c69ee539350c3490368e84c58478c61c 100644 (file)
@@ -700,6 +700,8 @@ int tls1_alert_code(int code)
         return (TLS1_AD_INAPPROPRIATE_FALLBACK);
     case SSL_AD_NO_APPLICATION_PROTOCOL:
         return (TLS1_AD_NO_APPLICATION_PROTOCOL);
+    case SSL_AD_CERTIFICATE_REQUIRED:
+        return SSL_AD_HANDSHAKE_FAILURE;
     default:
         return (-1);
     }