diff --git a/CHANGELOG.md b/CHANGELOG.md index 84a1913..137d5a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,6 @@ Inital Release. Support for Enroll, Sync, and Revocation. 1.0.1 Bugfix - sync records with null serial Bugfix - Fix for custom fields in enrollment + +1.0.2 +Handle change to Sectigo API Revocation call diff --git a/integration-manifest.json b/integration-manifest.json index a1c1f3a..aba2711 100644 --- a/integration-manifest.json +++ b/integration-manifest.json @@ -8,7 +8,8 @@ "update_catalog": true, "description": "Sectigo Certificate Manager plugin for the AnyCA REST Gateway framework", "gateway_framework": "24.2.0", - "release_dir": "sectigo-scm-caplugin/bin/Release/net6.0", + "release_dir": "sectigo-scm-caplugin/bin/Release", + "release_project": "sectigo-scm-caplugin/sectigo-scm-caplugin.csproj", "about": { "carest": { "ca_plugin_config": [ diff --git a/sectigo-scm-caplugin/Client/SectigoClient.cs b/sectigo-scm-caplugin/Client/SectigoClient.cs index b1be02c..da9463c 100644 --- a/sectigo-scm-caplugin/Client/SectigoClient.cs +++ b/sectigo-scm-caplugin/Client/SectigoClient.cs @@ -140,10 +140,11 @@ public async Task> PageCertificates(int position = 0, int size return await ProcessResponse>(response); } - public async Task RevokeSslCertificateById(int sslId, string revreason) + public async Task RevokeSslCertificateById(int sslId, int revcode, string revreason) { JObject o = JObject.FromObject(new { + reasonCode = revcode, reason = revreason }); var response = await RestClient.PostAsJsonAsync($"api/ssl/v1/revoke/{sslId}", o); diff --git a/sectigo-scm-caplugin/SectigoCAPlugin.cs b/sectigo-scm-caplugin/SectigoCAPlugin.cs index 7ab9724..9976a1a 100644 --- a/sectigo-scm-caplugin/SectigoCAPlugin.cs +++ b/sectigo-scm-caplugin/SectigoCAPlugin.cs @@ -463,7 +463,7 @@ public async Task Revoke(string caRequestID, string hexSerialNumber, uint r try { var client = SectigoClient.InitializeClient(_config); - var response = Task.Run(async () => await client.RevokeSslCertificateById(int.Parse(caRequestID), RevokeReasonToString(revocationReason))).Result; + var response = Task.Run(async () => await client.RevokeSslCertificateById(int.Parse(caRequestID), (int)revocationReason, RevokeReasonToString(revocationReason))).Result; _logger.MethodExit(LogLevel.Debug); if (response)//will throw an exception if false @@ -875,26 +875,18 @@ public static string RevokeReasonToString(UInt32 revokeType) { switch (revokeType) { + case 0: + return "Unspecified"; case 1: return "Compromised Key"; - - case 2: - return "CA Compromised"; - case 3: return "Affiliation Changed"; - case 4: return "Superseded"; - case 5: return "Cessation of Operation"; - - case 6: - return "Certificate Hold"; - default: - return "Unspecified"; + throw new Exception($"Invalid revocation code: {revokeType.ToString()}. Valid values are 0,1,3-5"); } } }