Skip to content

X.509/Certificate: Add tbs_precertificate_bytes property - #7279

Merged
alex merged 21 commits into
pyca:mainfrom
trail-of-forks:alex/tbs-precert
May 31, 2022
Merged

alex merged 21 commits into
pyca:mainfrom
trail-of-forks:alex/tbs-precert

Conversation

@woodruffw

Copy link
Copy Markdown
Member

This supersedes #7267, which I can't push to.

This is required for verifying embedded SCTs in sigstore-python. According to IETF's RFC 6962, this data is part of the digitally signed payload that forms the SCT's signature. This still needs unit tests.

Comment thread tests/x509/test_x509_ext.py Resolved
Comment thread src/rust/src/x509/certificate.rs Resolved
@woodruffw

Copy link
Copy Markdown
Member Author

I don't believe this is correct. This OID is for use in EKUs, isn't it?

Whoops, you're absolutely right. I'll move this under the right class.

@alex alex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You'll also need to add docs for the test vector.

Comment thread src/rust/src/x509/oid.rs Resolved
Comment thread src/rust/src/x509/certificate.rs Resolved
Comment thread tests/x509/test_x509.py Resolved
Comment thread tests/x509/test_x509_ext.py Resolved
Comment thread docs/x509/reference.rst Resolved
Comment thread src/cryptography/hazmat/_oid.py Resolved
Comment thread src/rust/src/x509/certificate.rs Resolved
Comment thread tests/x509/test_x509_ext.py Resolved
@alex

alex commented May 31, 2022

Copy link
Copy Markdown
Member

You'll need to rebase to fix the alpine issue.

tetsuo-cpp and others added 18 commits May 31, 2022 17:52
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
@woodruffw
woodruffw requested review from alex and reaperhulk May 31, 2022 21:56
@alex

alex commented May 31, 2022

Copy link
Copy Markdown
Member

Spell check doesn't like "Precertificate", see docs/spelling_list.txt

Signed-off-by: William Woodruff <[email protected]>
@woodruffw

Copy link
Copy Markdown
Member Author

Spell check doesn't like "Precertificate", see docs/spelling_list.txt

I went ahead and reworded to "pre-certificate," since that's used elsewhere in the docs.

alex
alex previously approved these changes May 31, 2022
@alex
alex enabled auto-merge (squash) May 31, 2022 22:06
@alex
alex disabled auto-merge May 31, 2022 22:09
Comment thread tests/x509/test_x509.py Resolved
reaperhulk
reaperhulk previously approved these changes May 31, 2022
@reaperhulk
reaperhulk enabled auto-merge (squash) May 31, 2022 22:14
Comment on lines +246 to +248
None => Err(PyAsn1Error::from(pyo3::exceptions::PyValueError::new_err(
"Could not find any extensions in TBS certificate",
))),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this branch is untested, sorry.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Grr. Okay, time to see if there's already a vector with no extensions and reuse it...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is! I dont' remember which one it is though. Check test-vectors.rst

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤞

auto-merge was automatically disabled May 31, 2022 22:38

Head branch was pushed to by a user without write access

@alex
alex enabled auto-merge (squash) May 31, 2022 22:42
@alex
alex merged commit c1b7307 into pyca:main May 31, 2022
@woodruffw
woodruffw deleted the alex/tbs-precert branch June 1, 2022 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants