Fix DTLS certificate requesting code.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 15 Jul 2014 17:21:59 +0000 (18:21 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 15 Jul 2014 17:23:13 +0000 (18:23 +0100)
Use same logic when determining when to expect a client
certificate for both TLS and DTLS.

PR#3452

ssl/d1_srvr.c

index 7816bbb503483c04a505d1afc2e0a4da3e01ead7..1d2201de450849836a12f8d568f13e497daa7e40 100644 (file)
@@ -616,10 +616,11 @@ int dtls1_accept(SSL *s)
                                s->state = SSL3_ST_SR_CLNT_HELLO_C;
                                }
                        else {
-                               /* could be sent for a DH cert, even if we
-                                * have not asked for it :-) */
-                               ret=ssl3_get_client_certificate(s);
-                               if (ret <= 0) goto end;
+                               if (s->s3->tmp.cert_request)
+                                       {
+                                       ret=ssl3_get_client_certificate(s);
+                                       if (ret <= 0) goto end;
+                                       }
                                s->init_num=0;
                                s->state=SSL3_ST_SR_KEY_EXCH_A;
                        }