Bug 784616 - Patch to allow certificate verification against a chain of CAs and a stack of CRLs
Summary: Patch to allow certificate verification against a chain of CAs and a stack of...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: m2crypto
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-25 15:09 UTC by John Matthews
Modified: 2019-08-26 14:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-26 14:26:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
one version of the patch (46.58 KB, patch)
2017-09-22 10:35 UTC, Matěj Cepl
no flags Details | Diff
another version of the patch (45.68 KB, patch)
2017-09-22 10:39 UTC, Matěj Cepl
no flags Details | Diff

Description John Matthews 2012-01-25 15:09:47 UTC
Description of problem:
Please apply the below patch to M2Crypto 0.21.1 to allow a certificate to be verified against a chain of CAs and a stack of CRLs.  

Patch submitted to upstream:
  https://bugzilla.osafoundation.org/attachment.cgi?id=5746
Upstream Bug: 
  https://bugzilla.osafoundation.org/show_bug.cgi?id=12954#c2

This patch adds a "verify_cert()" method on X509_Store_Context to allow openssl to do the full certificate verification.  Additionally more functionality is added for working with CRLs.

We have a built RPM with the patch applied below:
http://repos.fedorapeople.org/repos/pulp/pulp/testing/fedora-16/x86_64/

This patched version of M2Crypto is being used by Pulp (https://fedorahosted.org/pulp/).  It allows us to do full X509 certificate verification through M2Crypto/OpenSSL.  


Version-Release number of selected component (if applicable):
M2Crypto 0.21.1
Patch has been tested on Fedora 15, 16, and el6.  (el5 needs more work)

Actual results:
 Without this patch M2Crypto is not able to verify a certificate against a chain of CAs or against a CRL.  

Expected results:
 Certificate verification against a chain of CAs and/or against multiple CRLs will be possible.


For those interested, this wiki page has some more info on how Pulp is using this patch for CA Chain verification:
 - https://fedorahosted.org/pulp/wiki/CertChainVerification

Here is a sample of what the code looks like for chain verification:
http://git.fedorahosted.org/git/?p=pulp.git;a=blob;f=playpen/certs/chain_example/test_chain_verify.py;hb=HEAD

Comment 3 Fedora End Of Life 2013-01-16 15:52:07 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Fedora End Of Life 2013-12-21 08:32:24 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Matěj Cepl 2017-09-20 22:14:26 UTC
Unfortunately, the upstream bugzilla is dead and so the patch got lost. If you you want to have this patch reviewed it is always a better idea to attach it directly to this bug as well (Red Hat Bugzilla tend to be one of the most stable issue trackers around).

As the bug stands now, it is probably ready to be closed as CANTFIX.

Comment 8 Matěj Cepl 2017-09-22 10:35:30 UTC
Created attachment 1329506 [details]
one version of the patch

Version from https://raw.githubusercontent.com/pulp/pulp/d97fe613b450eec3e53ad833bfa8dda4953176c4/deps/m2crypto/m2crypto-0.21.1-x509_crl.patch

dated 2012-01-19 12:52:16.062243001 -0500

Comment 9 Matěj Cepl 2017-09-22 10:39:03 UTC
Created attachment 1329507 [details]
another version of the patch

Version from https://raw.githubusercontent.com/pulp/pulp/91a1e28c9e7d3dee418d5c7680dbf25c3e7adc63/playpen/certs/m2/m2crypto_changes_jwm.patch

Dated 2012-01-19 09:42:48.708732504 -0500

This is confusing: this version seems to be more sophisticated (more tests against unforeseen circumstances), but there seem to be more tests. On the one hand, it has exactly the same number of lines (1105), on the other hand interdiff has 2239 lines, so it seems like these are quite different.

Comment 10 Miloslav Trmač 2017-09-23 04:05:03 UTC
Matěj, I can’t see any “more tests against unforeseen circumstances”; the two patches are exactly identical apart from the top-level names.

> interdiff -p1 m2crypto-0.21.1-x509_crl.patch m2crypto_changes_jwm.patch 
is empty.

Comment 11 Matěj Cepl 2017-09-23 08:13:38 UTC
(In reply to Miloslav Trmač from comment #10)
> Matěj, I can’t see any “more tests against unforeseen circumstances”; the
> two patches are exactly identical apart from the top-level names.
> 
> > interdiff -p1 m2crypto-0.21.1-x509_crl.patch m2crypto_changes_jwm.patch 
> is empty.

You are right ... missing -p1 for interdiff.

Comment 12 John Matthews 2017-09-24 14:33:34 UTC
Miloslav/Matej,

FYI, I'm no longer on the Pulp development team, unsure if they still require this patch.  I would guess not since they've been through ~2 rewrites now and I think they dropped CRL support.

For background, the issue I found was that CRL verification was not supported in m2crypto, at the time the certificate verification was weak, it didn't defer to openssl and do a full certificate chain check.  The patch I added was a combination of exposing certification verification from openssl as well as expanding on the CRL support offered.

Comment 13 Matěj Cepl 2019-08-26 14:26:10 UTC
Patched upstream.


Note You need to log in before you can comment on or make changes to this bug.