diff --git a/lib/Command/Crl/Revoke.php b/lib/Command/Crl/Revoke.php index faa99824d..6ae374646 100644 --- a/lib/Command/Crl/Revoke.php +++ b/lib/Command/Crl/Revoke.php @@ -88,6 +88,7 @@ class Revoke extends Command { } $reason = CRLReason::from($reasonCode); + assert($reason instanceof CRLReason); $reasonDescription = $reason->getDescription(); $io->section('Revocation Details'); @@ -145,7 +146,7 @@ class Revoke extends Command { try { $success = $this->crlService->revokeCertificate( $serialNumber, - $reason->value, + $reason, $reasonText, 'cli-admin' ); diff --git a/lib/Controller/CrlApiController.php b/lib/Controller/CrlApiController.php index 8f0921cbe..555badcd5 100644 --- a/lib/Controller/CrlApiController.php +++ b/lib/Controller/CrlApiController.php @@ -111,6 +111,7 @@ class CrlApiController extends AEnvironmentAwareController { 'message' => "Invalid reason code: {$reasonCode}. Must be between 0-10 (excluding 7).", ], Http::STATUS_BAD_REQUEST); } + assert($reason instanceof CRLReason); $user = $this->userSession->getUser(); $revokedBy = $user ? $user->getUID() : 'system'; @@ -118,7 +119,7 @@ class CrlApiController extends AEnvironmentAwareController { try { $success = $this->crlService->revokeCertificate( $serialNumber, - $reason->value, + $reason, $reasonText, $revokedBy );