1
0
mirror of https://github.com/golang/go synced 2024-11-08 02:36:18 -07:00
go/src/crypto
Filippo Valsorda 95c5ec67ea crypto/x509: treat certificate names with trailing dots as invalid
Trailing dots are not allowed in certificate fields like CN and SANs
(while they are allowed and ignored as inputs to verification APIs).
Move to considering names with trailing dots in certificates as invalid
hostnames.

Following the rule of CL 231378, these invalid names lose wildcard
processing, but can still match if there is a 1:1 match, trailing dot
included, with the VerifyHostname input.

They also become ignored Common Name values regardless of the
GODEBUG=x509ignoreCN=X value, because we have to ignore invalid
hostnames in Common Name for #24151. The error message automatically
accounts for this, and doesn't suggest the environment variable. You
don't get to use a legacy deprecated field AND invalid hostnames.

(While at it, also consider wildcards in VerifyHostname inputs as
invalid hostnames, not that it should change any observed behavior.)

Change-Id: Iecdee8927df50c1d9daf904776b051de9f5e76ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/231380
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:42 +00:00
..
aes crypto/aes,crypto/cipher: add asm implementation for aes-gcm on ppc64le 2019-09-24 16:15:36 +00:00
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 crypto/sha*: replace putUint{32,64} helpers 2019-05-23 16:16:26 +00:00
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 certificate names with trailing dots as invalid 2020-05-08 00:05:42 +00:00
crypto.go crypto: implement Hash.String 2020-03-24 17:24:24 +00:00
issue21104_test.go