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

fix: change OCSP hash and encoding #141

Merged
merged 5 commits into from
Apr 21, 2023

Conversation

kody-kimberl
Copy link
Contributor

This is a followup fix to #134

After testing with real certificates, there are some discrepancies with what hashes are supported and the correct URL encoding.


The following do not support SHA256 hashes:

  • Microsoft
  • Entrust
  • Let's Encrypt
  • Digicert (sometimes)

As this represents a large percentage of public CAs, we should change the hashing algorithm to SHA1, which has been confirmed to be supported by all that were tested.


Additionally, the base64 URL encoding was not actually escaping URL characters, resulting in malformed requests. We need to change it to StdEncoding and query escape it.

Signed-off-by: Kody Kimberl kody.kimberl.work@gmail.com

Signed-off-by: Kody Kimberl <kody.kimberl.work@gmail.com>
Copy link

@patrickzheng200 patrickzheng200 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Apr 21, 2023

Codecov Report

Merging #141 (a81a325) into main (cefe2ef) will decrease coverage by 0.20%.
The diff coverage is 61.53%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   89.32%   89.13%   -0.20%     
==========================================
  Files          21       21              
  Lines        1677     1693      +16     
==========================================
+ Hits         1498     1509      +11     
- Misses        142      149       +7     
+ Partials       37       35       -2     
Impacted Files Coverage Δ
revocation/ocsp/ocsp.go 81.39% <61.53%> (-1.30%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

revocation/ocsp/ocsp.go Show resolved Hide resolved
Signed-off-by: Kody Kimberl <kody.kimberl.work@gmail.com>
revocation/ocsp/ocsp.go Outdated Show resolved Hide resolved
Signed-off-by: Kody Kimberl <kody.kimberl.work@gmail.com>
shizhMSFT
shizhMSFT previously approved these changes Apr 21, 2023
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Kody Kimberl <kody.kimberl.work@gmail.com>
Co-authored-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Kody Kimberl <59657721+kody-kimberl@users.noreply.github.com>
Copy link

@patrickzheng200 patrickzheng200 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @kody-kimberl! The logic looks much cleaner now.

Copy link
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

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

LGTM

@kody-kimberl kody-kimberl requested a review from shizhMSFT April 21, 2023 04:32
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@patrickzheng200 patrickzheng200 merged commit 4d6ef22 into notaryproject:main Apr 21, 2023
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.

5 participants