]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: explicitly require ExtKeyUsageClientAuth for client certs
authorMikkel Krautz <mikkel@krautz.dk>
Sat, 18 Aug 2012 22:50:33 +0000 (15:50 -0700)
committerAdam Langley <agl@golang.org>
Sat, 18 Aug 2012 22:50:33 +0000 (15:50 -0700)
If we aren't explicit about the KeyUsages, the verifier
will treat the certificate as a server certificate and require
it to have a ExtKeyUsageServerAuth key usage.

R=golang-dev
CC=golang-dev
https://golang.org/cl/6453148

src/pkg/crypto/tls/handshake_server.go

index 76adc540c7126e1a0009e475fcd8ad4211f6f075..e5049a2f0db9fde1b966bb873299d5d99ac96f34 100644 (file)
@@ -211,6 +211,7 @@ FindCipherSuite:
                                Roots:         c.config.ClientCAs,
                                CurrentTime:   c.config.time(),
                                Intermediates: x509.NewCertPool(),
+                               KeyUsages:     []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
                        }
 
                        for i, cert := range certs {