Bug 1572674

Summary: ipa-cacert-manage cannot import PKCS#7 files
Product: Red Hat Enterprise Linux 7 Reporter: Rob Crittenden <rcritten>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: cheimes, dpal, ndehadra, pasik, pvoborni, rcritten, tscherf
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.6.5-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1692810 (view as bug list) Environment:
Last Closed: 2019-08-06 13:09:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1692810    

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