From 020b5483436911769323aa6990c265f653d21800 Mon Sep 17 00:00:00 2001 From: Calvin Hedler Date: Thu, 1 Jun 2023 10:14:20 -0700 Subject: [PATCH] Correct typos. --- Certify/Commands/Download.cs | 4 ++-- Certify/Commands/Find.cs | 6 +++--- Certify/Commands/Request.cs | 16 ++++++++-------- Certify/Lib/Cert.cs | 24 ++++++++++++------------ 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Certify/Commands/Download.cs b/Certify/Commands/Download.cs index f7dc6b9..d7c8531 100644 --- a/Certify/Commands/Download.cs +++ b/Certify/Commands/Download.cs @@ -10,7 +10,7 @@ public class Download : ICommand public void Execute(Dictionary arguments) { - Console.WriteLine("[*] Action: Download a Certificates"); + Console.WriteLine("[*] Action: Download a Certificate"); string CA; var install = arguments.ContainsKey("/install"); @@ -42,7 +42,7 @@ public void Execute(Dictionary arguments) return; } - Console.WriteLine($"[*] Certificates Authority : {CA}"); + Console.WriteLine($"[*] Certificate Authority : {CA}"); Console.WriteLine($"[*] Request ID : {requestId}"); // download the certificate from the CA diff --git a/Certify/Commands/Find.cs b/Certify/Commands/Find.cs index ccd74a0..66a5e67 100644 --- a/Certify/Commands/Find.cs +++ b/Certify/Commands/Find.cs @@ -533,7 +533,7 @@ private void ShowTemplatesAllowingClientAuth(IEnumerable te private void ShowAllTemplates(IEnumerable templates, IEnumerable cas) { - Console.WriteLine("\n[*] Available Certificates Templates :\n"); + Console.WriteLine("\n[*] Available Certificate Templates :\n"); foreach (var template in templates) { @@ -577,8 +577,8 @@ from t in templates } Console.WriteLine(!vulnerableTemplates.Any() - ? "\n[+] No Vulnerable Certificates Templates found!\n" - : "\n[!] Vulnerable Certificates Templates :\n"); + ? "\n[+] No Vulnerable Certificate Templates found!\n" + : "\n[!] Vulnerable Certificate Templates :\n"); foreach (var template in templates) { diff --git a/Certify/Commands/Request.cs b/Certify/Commands/Request.cs index 2b94119..388a46e 100644 --- a/Certify/Commands/Request.cs +++ b/Certify/Commands/Request.cs @@ -9,7 +9,7 @@ public class Request : ICommand public void Execute(Dictionary arguments) { - Console.WriteLine("[*] Action: Request a Certificates"); + Console.WriteLine("[*] Action: Request a Certificate"); var CA = ""; var subject = ""; @@ -49,13 +49,13 @@ public void Execute(Dictionary arguments) altName = arguments["/altname"]; } - if(arguments.ContainsKey("/sidextension")) - { - sidExtension = arguments["/sidextension"]; + if(arguments.ContainsKey("/sidextension")) + { + sidExtension = arguments["/sidextension"]; } - if (arguments.ContainsKey("/sid")) - { - sidExtension = arguments["/sid"]; + if (arguments.ContainsKey("/sid")) + { + sidExtension = arguments["/sid"]; } if (arguments.ContainsKey("/install")) @@ -76,7 +76,7 @@ public void Execute(Dictionary arguments) { if (!arguments.ContainsKey("/enrollcert") || String.IsNullOrEmpty(arguments["/enrollcert"])) { - Console.WriteLine("[X] /enrollcert parameter missing. Issued Enrollment/Certificates Request Agent certificate required!"); + Console.WriteLine("[X] /enrollcert parameter missing. Issued Enrollment/Certificate Request Agent certificate required!"); return; } diff --git a/Certify/Lib/Cert.cs b/Certify/Lib/Cert.cs index 0972df3..e7f96f6 100644 --- a/Certify/Lib/Cert.cs +++ b/Certify/Lib/Cert.cs @@ -68,7 +68,7 @@ private static CertificateRequest CreateCertRequestMessage(string templateName, if (!String.IsNullOrEmpty(altName)) { Console.WriteLine($"[*] AltName : {altName}"); - } + } if (!String.IsNullOrEmpty(sidExtension)) { Console.WriteLine($"[*] SidExtension : {sidExtension}"); @@ -119,16 +119,16 @@ private static CertificateRequest CreateCertRequestMessage(string templateName, // format 2 - required for the EDITF_ATTRIBUTESUBJECTALTNAME2 scenario var altNamePair = new CX509NameValuePair(); altNamePair.Initialize("SAN", $"upn={altName}"); - objPkcs10.NameValuePairs.Add(altNamePair); - - if(!String.IsNullOrEmpty(sidExtension)) { - var extBytes = Certify.Lib.CertSidExtension.EncodeSidExtension(new SecurityIdentifier(sidExtension)); - var oid = new CObjectId(); - oid.InitializeFromValue("1.3.6.1.4.1.311.25.2"); - var sidExt = new CX509Extension(); - sidExt.Initialize(oid, EncodingType.XCN_CRYPT_STRING_BASE64, Convert.ToBase64String(extBytes)); - objPkcs10.X509Extensions.Add(sidExt); - } + objPkcs10.NameValuePairs.Add(altNamePair); + + if(!String.IsNullOrEmpty(sidExtension)) { + var extBytes = Certify.Lib.CertSidExtension.EncodeSidExtension(new SecurityIdentifier(sidExtension)); + var oid = new CObjectId(); + oid.InitializeFromValue("1.3.6.1.4.1.311.25.2"); + var sidExt = new CX509Extension(); + sidExt.Initialize(oid, EncodingType.XCN_CRYPT_STRING_BASE64, Convert.ToBase64String(extBytes)); + objPkcs10.X509Extensions.Add(sidExt); + } } var objEnroll = new CX509Enrollment(); @@ -306,7 +306,7 @@ public static string DownloadAndInstallCert(string CA, int requestId, X509Certif cert, EncodingType.XCN_CRYPT_STRING_BASE64, null); - Console.WriteLine("[*] Certificates installed!"); + Console.WriteLine("[*] Certificate installed!"); return outputStream.ToString(); }