Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1658030

Summary: Key retrieve with RequestID is getting failed with error (PKIException: Internal Server Error)
Product: Red Hat Enterprise Linux 8 Reporter: Deepak Punia <dpunia>
Component: pki-coreAssignee: RHCS Maintainers <rhcs-maint>
Status: CLOSED UPSTREAM QA Contact: Asha Akkiangady <aakkiang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: ascheel
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-15 18:51:55 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:

Description Deepak Punia 2018-12-11 05:03:27 UTC
Description of problem:
key-retrieve request should be successful with RequestID.
Issue : Key retrieve with RequestID is getting failed with error (PKIException: Internal Server Error) but retrieve with keyID working fine. RequestID option is showing under help suggestion but not on man page.

Version-Release number of selected component (if applicable):
10.5.9-7.el7_6

How reproducible:

[root@ibm-x3650m4-02-vm-02 ~]# pki -c SECret.123 -n "PKI KRA Administrator" -P https -h localhost -p 20443 key-archive --passphrase "foobar15" --clientKeyID "test_15"
------------------------
Archival request details
------------------------
  Request ID: 0x36d90da8c7486c
  Key ID: 0x5
  Type: securityDataEnrollment
  Status: begin
[root@ibm-x3650m4-02-vm-02 ~]# pki -c SECret.123 -n "PKI KRA Administrator" -P https -p 20443 key-request-review --action approve 0x5
------
Result
------
  Request ID: 0x5
  Key ID: 0x1
  Type: enrollment
  Status: complete
[root@ibm-x3650m4-02-vm-02 ~]# pki -c SECret.123 -n "PKI KRA Administrator" -P https -p 20443 key-retrieve --requestID 0x5
PKIException: Internal Server Error
[root@ibm-x3650m4-02-vm-02 ~]# pki -c SECret.123 -n "PKI KRA Administrator" -P https -p 20443 key-retrieve --keyID 0x1
------------------------
Retrieve Key Information
------------------------
  Key Algorithm: 1.2.840.113549.1.1.1
  Key Size: 1024
  Nonce data: /p83dLyii6CUgC8Z4pd0/g==
  Actual archived data: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAL1RgAEdhq5hEs8rs0dBpE8QPcaPdz8L3rOlXXIyz92OF/wqO2UNkHv57geTK1q9GlPlPovSa/w5gu+976Idw/qR3wJcgnE6ByJnxBIqm2/PnWfqIkRBGQBoS18+cfnOcpVDxTvARO87McQdOx2ndnKN2TYwhNuIe+XltxLys/zlAgMBAAECgYBN/KXDT9tsOBbcer8Ganb6DtGz2uOfeA9MZ6F/6oiQVvlwaiE/dn//Yix4uFpSrbWLu9KxHIRZSYOzqMVvPd29xDpPzIzwpSEfsv5DdD694BoExjsD0btNwhLXZfZ+nYN5jYTf+NebGgw1xz5/XWL3mgpnKDvBSU3xcQtFi/7GHQJBAN0/4OhSftuK4ODop5I6cDNNe/QZEfPTP7L2h8KgeRnFHm3a4+De4lPOukrsJ4ywf1KNuvzN9BbUunkMdyzRVjMCQQDbDbc7V4tBXeAj2a1FhzPVGDj092W1hbUz0p+ClwS7JNH7VsMMBJlTE7pkORuZgRGwf7poE+6rSSI8bAmAmliHAkEAvSXLRVKhmVdVgXHlMKI9Id7wRXLZYjYLkxgoYD+IyHs41Hn5r1lc7IEjysGx3hlWAGGiplX8gzhCYxJBIFOm+QJATNYGy53tjsQq9uhHyvedysVwVRziZEW+Ras/oELwueQ0c4D/cZu7XFSzMKyHbdTEK7Dh5df4A8TnaWJMAvwgyQJAO/B4qnrWu5nCHPGQLn6yKsV5OGj5b+qOSTZxpwFVQhtCCSH1/AnKuuN9ubPWQQqp7lqM+cEht+3KlKLDhm+kSg==
[root@ibm-x3650m4-02-vm-02 ~]#

[root@ibm-x3650m4-02-vm-02 dirsrv]# pki -c SECret.123 key-retrieve --help
usage: key-retrieve [OPTIONS...]
    --keyID <Key Identifier>                        Key Identifier for the secret to be recovered.
    --requestID <Recovery Request Identifier>       Request Identifier for  approved recovery request

Steps to Reproduce:
1.pki -c SECret.123 -n "PKI KRA Administrator" -P https -h localhost -p 20443 key-archive --passphrase "foobar15" --clientKeyID "test_15"
2.pki -c SECret.123 -n "PKI KRA Administrator" -P https -p 20443 key-request-review --action approve 0x5
3.pki -c SECret.123 -n "PKI KRA Administrator" -P https -p 20443 key-retrieve --requestID 0x5

Actual results:
PKIException: Internal Server Error

Expected results:
Success

Additional info:
requestID parameter with pki is showing in help page but not in man page