Bug 1572674 - ipa-cacert-manage cannot import PKCS#7 files
Summary: ipa-cacert-manage cannot import PKCS#7 files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks: 1692810
TreeView+ depends on / blocked
 
Reported: 2018-04-27 14:47 UTC by Rob Crittenden
Modified: 2019-08-06 13:09 UTC (History)
7 users (show)

Fixed In Version: ipa-4.6.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1692810 (view as bug list)
Environment:
Last Closed: 2019-08-06 13:09:05 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2241 0 None None None 2019-08-06 13:09:20 UTC

Description Rob Crittenden 2018-04-27 14:47:40 UTC
Description of problem:

Windows AD often provides files in PKCS#7 format (with p7b extensions) importing with ipa-cacert-manage fails:

# ipa-cacert-manage install /tmp/ca.p7b 
Installing CA certificate, please wait
Not a valid certificate: Unable to load certificate
The ipa-cacert-manage command failed.

I heard from another reported that this could also throw a padding error (which I assumed meant the entire contents of the PKCS#7 file was passed to the base64 decoder).

Version-Release number of selected component (if applicable):

ipa-server-4.5.4-10.el7

Steps to Reproduce:
1. openssl crl2pkcs7 -nocrl -certfile /etc/ipa/ca.crt -out /tmp/ca.p7b
2. ipa-cacert-manage install /tmp/ca.p7b

Comment 2 Rob Crittenden 2018-06-01 13:19:31 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7579

Comment 7 Nikhil Dehadrai 2019-06-26 08:43:08 UTC
ipa-server-4.6.5-9.el7.x86_64

Verified the bug on the basis of following observations:

REPRODUCER:
---------------------------------------------------------------
[root@vm-idm-004 ~]# rpm -q ipa-server
ipa-server-4.6.4-10.el7.x86_64

[root@vm-idm-004 ~]# openssl crl2pkcs7 -nocrl -certfile /etc/ipa/ca.crt -out /tmp/ca.p7b

[root@vm-idm-004 ~]# ls -l /tmp/ca.p7b
-rw-r--r--. 1 root root 1351 Jun 26 14:11 /tmp/ca.p7b

[root@vm-idm-004 ~]# ipa-cacert-manage install /tmp/ca.p7b
Installing CA certificate, please wait
Not a valid certificate: Unable to load certificate
The ipa-cacert-manage command failed.


VALIDATION:
---------------------------------------------------------------
[root@qe-blade-08 ~]# rpm -q ipa-server
ipa-server-4.6.5-9.el7.x86_64

[root@qe-blade-08 ~]# openssl crl2pkcs7 -nocrl -certfile /etc/ipa/ca.crt -out /tmp/ca.p7b

[root@qe-blade-08 ~]# ls -l /tmp/ca.p7b
rw-rr-. 1 root root 1351 Jun 26 03:43 /tmp/ca.p7b

[root@qe-blade-08 ~]# ipa-cacert-manage install /tmp/ca.p7b
Installing CA certificate, please wait
Verified CN=Certificate Authority,O=TESTRELM.TEST
CA certificate successfully installed
The ipa-cacert-manage command was successful

Thus on the basis of above observations, the issue mentioned in original bug is no more observed, thus marking the status to 'VERIFIED'

Comment 9 errata-xmlrpc 2019-08-06 13:09:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2241


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