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: add check for unsupported subject fields #275

Merged
merged 6 commits into from Feb 16, 2023

Conversation

byronchien
Copy link
Contributor

Fails trusted identity verification if the trust policy identity or the subject of the leaf certificate contains "=#".

example logs:

DEBU[2023-02-10T16:40:51-08:00] Validating cert chain
DEBU[2023-02-10T16:40:51-08:00] Validating trust identity
ERRO[2023-02-10T16:40:51-08:00] authenticity validation failed. Failure reason: notation does not support x509 identities containing "=#"
WARN[2023-02-10T16:40:51-08:00] Signature sha256:075dbeb4c3b7110104c652756116797f04ec60eb4618b990f698e9692b1ebdde failed verification with error: notation does not support x509 identities containing "=#"

Signed-off-by: Byron Chien chienb@amazon.com


// identities containing "=#" can cause memory issues in the asn1-ber library used by
// pkix when parsing the DN
if strings.Contains(identityValue, "=#") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding this to pkix instead

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2023

Codecov Report

Merging #275 (876a3b1) into main (156cedd) will increase coverage by 0.30%.
The diff coverage is n/a.

📣 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     #275      +/-   ##
==========================================
+ Coverage   73.37%   73.67%   +0.30%     
==========================================
  Files          23       23              
  Lines        1994     1994              
==========================================
+ Hits         1463     1469       +6     
+ Misses        429      425       -4     
+ Partials      102      100       -2     
Impacted Files Coverage Δ
verifier/verifier.go 78.22% <0.00%> (+1.26%) ⬆️

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

internal/pkix/pkix.go Outdated Show resolved Hide resolved
internal/pkix/pkix.go Outdated Show resolved Hide resolved
verifier/verifier.go Outdated Show resolved Hide resolved
@shizhMSFT shizhMSFT changed the title Add check for unsupported subject fields fix: add check for unsupported subject fields Feb 13, 2023
priteshbandi
priteshbandi previously approved these changes Feb 15, 2023
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

internal/pkix/pkix.go Outdated Show resolved Hide resolved
priteshbandi
priteshbandi previously approved these changes Feb 15, 2023
shizhMSFT
shizhMSFT previously approved these changes Feb 15, 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

priteshbandi
priteshbandi previously approved these changes Feb 15, 2023
gokarnm
gokarnm previously approved these changes Feb 15, 2023
Signed-off-by: Byron Chien <byronc@ucla.edu>
Signed-off-by: Byron Chien <byronc@ucla.edu>
Signed-off-by: Byron Chien <byronc@ucla.edu>
Signed-off-by: Byron Chien <byronc@ucla.edu>
Signed-off-by: Byron Chien <byronc@ucla.edu>
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

Copy link

@gokarnm gokarnm left a comment

Choose a reason for hiding this comment

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

LGTM

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

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

6 participants