Skip to content

Commit

Permalink
Revokereasons (#42)
Browse files Browse the repository at this point in the history
* Allow use of basic auth only

* Trim all leading 0s when searching by serial number

* change revoke reason to unspecified for everything other than keyCompromise
  • Loading branch information
dgaley authored Jul 11, 2023
1 parent 8926119 commit 10324e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@

1.1.0
-Added support for basic auth (no client certificate)
-Fixed an issue with cert lookups when the serial number has leading 0s
-Fixed an issue with cert lookups when the serial number has leading 0s

1.2.0
-Change revoke to always pass 'unspecified' as the reason code for any reason other than Key Compromised, and to include the reason in the comment instead.
9 changes: 8 additions & 1 deletion src/EntrustRestCAProxy/EntrustCAConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,15 @@ public override int Revoke(string caRequestID, string hexSerialNumber, uint revo
Dictionary<string, object> connectionInfo = ConfigProvider.CAConnectionData;
EntrustClient client = CreateEntrustClient(connectionInfo);
string reason = Conversions.RevokeReasonToString(revocationReason);
string comment = "Revoked by Entrust Gateway";
string comment = $"Revoked by Entrust Gateway for the following reason: {reason}";
CAConnectorCertificate cert = GetSingleRecord(caRequestID);

if (!string.Equals(reason, "keyCompromise"))
{
// Entrust no longer accepts any reason codes other than keyCompromise and unspecified.
reason = "unspecified";
}

if (!(cert.Status == (int)RequestDisposition.ISSUED))
{
string errorMessage = String.Format("Request {0} was not found in Entrust database or is not in a valid state to perform a revocation", caRequestID);
Expand Down

0 comments on commit 10324e4

Please sign in to comment.