Add SRP and PSK to disallowed CertificateRequest ciphersuites
authorMatt Caswell <matt@openssl.org>
Mon, 26 Oct 2015 23:11:44 +0000 (23:11 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 30 Oct 2015 08:39:47 +0000 (08:39 +0000)
There was a discrepancy between what ciphersuites we allowed to send a
CertificateRequest, and what ciphersuites we allowed to receive one. So
add PSK and SRP to the disallowed ones.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl/statem/statem_clnt.c
ssl/statem/statem_srvr.c

index 2ad41f5276a3bbbcd6cf9a4df8fbf0b6fd25abf5..c9d760f00e0bea4fc8672c9f95f8224ec927cbf0 100644 (file)
@@ -182,8 +182,9 @@ static int ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *sk,
 static inline int cert_req_allowed(SSL *s)
 {
     /* TLS does not like anon-DH with client cert */
 static inline int cert_req_allowed(SSL *s)
 {
     /* TLS does not like anon-DH with client cert */
-    if (s->version > SSL3_VERSION
-            && (s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL))
+    if ((s->version > SSL3_VERSION
+                && (s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL))
+            || (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aSRP | SSL_aPSK)))
         return 0;
 
     return 1;
         return 0;
 
     return 1;
index a4bc0e380d4fdb5de0222e83f90d1593010413e1..6f51d5dc76f9957b4cfd9bf694e313aeceac8df6 100644 (file)
@@ -391,7 +391,7 @@ static int send_certificate_request(SSL *s)
             * With normal PSK Certificates and Certificate Requests
             * are omitted
             */
             * With normal PSK Certificates and Certificate Requests
             * are omitted
             */
-           && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK)) {
+           && !(s->s3->tmp.new_cipher->algorithm_auth & SSL_aPSK)) {
         return 1;
     }
 
         return 1;
     }