1
0
mirror of https://github.com/golang/go synced 2024-11-08 02:26:11 -07:00
go/src/crypto
Filippo Valsorda f81aa23cf0 crypto/x509: treat hostnames with colons as invalid
Colons are port separators, so it's risky to allow them in hostnames.
Per the CL 231377 rule, if we at least consider them invalid we will not
apply wildcard processing to them, making behavior a little more
predictable.

We were considering hostnames with colons valid (against spec) because
that meant we'd not ignore them in Common Name. (There was at least
one deployment that was putting colons in Common Name and expecting it
to verify.)

Now that Common Name is ignored by default, those clients will break
again, so it's a good time to drop the exception. Hopefully they moved
to SANs, where invalid hostnames are checked 1:1 (ignoring wildcards)
but still work. (If they didn't, this change means they can't use
GODEBUG=x509ignoreCN=0 to opt back in, but again you don't get to use a
legacy deprecated field AND invalid hostnames.)

Updates #24151

Change-Id: Id44b4fecb2d620480acdfc65fea1473f7abbca7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/231381
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2020-05-08 00:05:56 +00:00
..
aes
cipher crypto/cipher: require non-zero nonce size for AES-GCM 2020-02-24 15:45:26 +00:00
des
dsa all: fix a bunch of misspellings 2019-11-15 21:04:43 +00:00
ecdsa crypto/rsa,crypto/ecdsa,crypto/ed25519: implement PrivateKey.Equal 2020-05-05 18:05:10 +00:00
ed25519 crypto/rsa,crypto/ecdsa,crypto/ed25519: implement PrivateKey.Equal 2020-05-05 18:05:10 +00:00
elliptic crypto/elliptic: implement MarshalCompressed and UnmarshalCompressed 2020-05-07 23:41:27 +00:00
hmac crypto/hmac: speed up repeated operations with the same key 2020-05-07 15:47:09 +00:00
internal
md5 all: remove nacl (part 3, more amd64p32) 2019-10-10 22:38:38 +00:00
rand all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
rc4
rsa crypto/rsa,crypto/ecdsa,crypto/ed25519: implement PrivateKey.Equal 2020-05-05 18:05:10 +00:00
sha1 all: remove nacl (part 3, more amd64p32) 2019-10-10 22:38:38 +00:00
sha256
sha512 crypto/sha512: optimize sha512 by removing function literal 2020-04-03 18:17:13 +00:00
subtle
tls crypto/tls: rotate session keys in older TLS versions 2020-05-07 18:33:39 +00:00
x509 crypto/x509: treat hostnames with colons as invalid 2020-05-08 00:05:56 +00:00
crypto.go crypto: implement Hash.String 2020-03-24 17:24:24 +00:00
issue21104_test.go