Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-2.1: security: relax checks on certificate fields. #29223

Merged
merged 1 commit into from Aug 29, 2018

Conversation

mberhault
Copy link
Contributor

Backport 1/1 commits from #29193.

/cc @cockroachdb/release


Fixes #29185.

Remove all checks on certificate KeyUsage and ExtendedKeyUsage.

These have historically been so badly misused that Go does not even
check them. Per the blurb in
x509/verify.go:

  // KeyUsage status flags are ignored. From Engineering Security, Peter
  // Gutmann: A European government CA marked its signing certificates
as
  // being valid for encryption only, but no-one noticed. Another
  // European CA marked its signature keys as not being valid for
  // signatures. A different CA marked its own trusted root certificate
  // as being invalid for certificate signing. Another national CA
  // distributed a certificate to be used to encrypt data for the
  // country’s tax authority that was marked as only being usable for
  // digital signatures but not for encryption. Yet another CA reversed
  // the order of the bit flags in the keyUsage due to confusion over
  // encoding endianness, essentially setting a random keyUsage in
  // certificates that it issued. Another CA created a self-invalidating
  // certificate by adding a certificate policy statement stipulating
  // that the certificate had to be used strictly as specified in the
  // keyUsage, and a keyUsage containing a flag indicating that the RSA
  // encryption key could only be used for Diffie-Hellman key agreement.

Running cockroach (client/server) with absolutely no Key Usages works
just fine.

Release note (general change): remove checks on certificate key usages.

Fixes cockroachdb#29185.

Remove all checks on certificate KeyUsage and ExtendedKeyUsage.

These have historically been so badly misused that Go does not even
check them. Per the blurb in
[x509/verify.go](https://github.com/golang/go/blob/master/src/crypto/x509/verify.go#L676):

```
  // KeyUsage status flags are ignored. From Engineering Security, Peter
  // Gutmann: A European government CA marked its signing certificates
as
  // being valid for encryption only, but no-one noticed. Another
  // European CA marked its signature keys as not being valid for
  // signatures. A different CA marked its own trusted root certificate
  // as being invalid for certificate signing. Another national CA
  // distributed a certificate to be used to encrypt data for the
  // country’s tax authority that was marked as only being usable for
  // digital signatures but not for encryption. Yet another CA reversed
  // the order of the bit flags in the keyUsage due to confusion over
  // encoding endianness, essentially setting a random keyUsage in
  // certificates that it issued. Another CA created a self-invalidating
  // certificate by adding a certificate policy statement stipulating
  // that the certificate had to be used strictly as specified in the
  // keyUsage, and a keyUsage containing a flag indicating that the RSA
  // encryption key could only be used for Diffie-Hellman key agreement.
```

Running cockroach (client/server) with absolutely no Key Usages works
just fine.

Release note (general change): remove checks on certificate key usages.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@a-robinson a-robinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mberhault
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 29, 2018

Build failed

@mberhault
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Aug 29, 2018
29223: release-2.1: security: relax checks on certificate fields. r=mberhault a=mberhault

Backport 1/1 commits from #29193.

/cc @cockroachdb/release

---

Fixes #29185.

Remove all checks on certificate KeyUsage and ExtendedKeyUsage.

These have historically been so badly misused that Go does not even
check them. Per the blurb in
[x509/verify.go](https://github.com/golang/go/blob/master/src/crypto/x509/verify.go#L676):

```
  // KeyUsage status flags are ignored. From Engineering Security, Peter
  // Gutmann: A European government CA marked its signing certificates
as
  // being valid for encryption only, but no-one noticed. Another
  // European CA marked its signature keys as not being valid for
  // signatures. A different CA marked its own trusted root certificate
  // as being invalid for certificate signing. Another national CA
  // distributed a certificate to be used to encrypt data for the
  // country’s tax authority that was marked as only being usable for
  // digital signatures but not for encryption. Yet another CA reversed
  // the order of the bit flags in the keyUsage due to confusion over
  // encoding endianness, essentially setting a random keyUsage in
  // certificates that it issued. Another CA created a self-invalidating
  // certificate by adding a certificate policy statement stipulating
  // that the certificate had to be used strictly as specified in the
  // keyUsage, and a keyUsage containing a flag indicating that the RSA
  // encryption key could only be used for Diffie-Hellman key agreement.
```

Running cockroach (client/server) with absolutely no Key Usages works
just fine.

Release note (general change): remove checks on certificate key usages.


Co-authored-by: marc <marc@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Aug 29, 2018

Build succeeded

@craig craig bot merged commit 01f6580 into cockroachdb:release-2.1 Aug 29, 2018
@mberhault mberhault deleted the backport2.1-29193 branch August 29, 2018 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants