cert: fix wrong assumption of cert-show result type

cert-show returns a base64 encoded certificate yet the assumption
here was for a PEM bytes instance.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Felipe Volpone <fbarreto@redhat.com>
This commit is contained in:
Stanislav Laznicka 2017-08-28 10:54:11 +02:00
parent e09b6c2602
commit 1b78f79283

View File

@ -1270,8 +1270,8 @@ class cert_revoke(PKQuery, CertMethod, VirtualCommand):
logger.debug("Not granted by ACI to revoke certificate, "
"looking at principal")
try:
cert = x509.load_pem_x509_certificate(
resp['result']['certificate'])
cert = x509.load_der_x509_certificate(
base64.b64decode(resp['result']['certificate']))
if not bind_principal_can_manage_cert(cert):
raise acierr
except errors.NotImplementedError: