Skip to content

Comments

Make X509_verify() libctx aware#11507

Closed
mattcaswell wants to merge 6 commits intoopenssl:masterfrom
mattcaswell:x509_verify_ex
Closed

Make X509_verify() libctx aware#11507
mattcaswell wants to merge 6 commits intoopenssl:masterfrom
mattcaswell:x509_verify_ex

Conversation

@mattcaswell
Copy link
Member

X509_verify() validates the signature in an X509 cert. We should make sure we use a library ctx and property query string for fetching any algorithms. Therefore we introduce X509_verify_ex().

I've also included a second loosely related commit which gives us an internal version of X509_check_issued() which is library ctx aware. We don't actually need this to be public (you can achieve the same thing via other means) - but it makes our internal code a bit neater doing things this way.

This is required for alpha1.

@mattcaswell mattcaswell added the branch: master Applies to master branch label Apr 9, 2020
Copy link
Member

Choose a reason for hiding this comment

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

Nit: move it after the X509_verify.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm. I actually think X509_verify_ex should come first. That is the way it is described in the text below. So, for consistency I also moved X509_REQ_verify_ex to be before X509_REQ_verify

@mattcaswell
Copy link
Member Author

Fixups pushed. I also rebased to fix a conflict with master.

@mattcaswell
Copy link
Member Author

Travis failure is strange but unrelated to this PR.

@mattcaswell
Copy link
Member Author

Ping?

This was referenced Apr 10, 2020
Copy link
Member

Choose a reason for hiding this comment

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

Should we have a libctx reference here also?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

@slontis slontis left a comment

Choose a reason for hiding this comment

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

Apart from a nit it looks good to me.

@mattcaswell
Copy link
Member Author

Fixup pushed addressing the nit. Also rebased to resolve conflicts with master.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm... should we have also X509_CRL_verify_ex?

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps, and I did consider it. However, X509_CRL_verify is implemented differently to the other 2 I updated and it looked more complicated to change. Since I don't need to do that now for alpha1 I opted to exclude it from this PR.

@mattcaswell
Copy link
Member Author

Fixup commit pushed addressing feedback above. I also rebased (twice!) to fix conflicts with master. Please take another look.

Copy link
Member

@slontis slontis 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
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

Approved if CI passes (seems to be overwhelmed by the churn of PRs).

@mattcaswell mattcaswell added the approval: done This pull request has the required number of approvals label Apr 16, 2020
@mattcaswell
Copy link
Member Author

Pushed. Thanks!

openssl-machine pushed a commit that referenced this pull request Apr 16, 2020
This is the same as X509_verify() except that it takes a libctx and propq
parameter and signature verification is done using those.

Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #11507)
openssl-machine pushed a commit that referenced this pull request Apr 16, 2020
The internal version is library context aware.

Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #11507)
openssl-machine pushed a commit that referenced this pull request Apr 16, 2020
Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #11507)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: done This pull request has the required number of approvals branch: master Applies to master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants