Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct typos. #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Certify/Commands/Download.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Download : ICommand

public void Execute(Dictionary<string, string> arguments)
{
Console.WriteLine("[*] Action: Download a Certificates");
Console.WriteLine("[*] Action: Download a Certificate");

string CA;
var install = arguments.ContainsKey("/install");
Expand Down Expand Up @@ -42,7 +42,7 @@ public void Execute(Dictionary<string, string> arguments)
return;
}

Console.WriteLine($"[*] Certificates Authority : {CA}");
Console.WriteLine($"[*] Certificate Authority : {CA}");
Console.WriteLine($"[*] Request ID : {requestId}");

// download the certificate from the CA
Expand Down
6 changes: 3 additions & 3 deletions Certify/Commands/Find.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ private void ShowTemplatesAllowingClientAuth(IEnumerable<CertificateTemplate> te

private void ShowAllTemplates(IEnumerable<CertificateTemplate> templates, IEnumerable<EnterpriseCertificateAuthority> cas)
{
Console.WriteLine("\n[*] Available Certificates Templates :\n");
Console.WriteLine("\n[*] Available Certificate Templates :\n");

foreach (var template in templates)
{
Expand Down Expand Up @@ -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)
{
Expand Down
16 changes: 8 additions & 8 deletions Certify/Commands/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Request : ICommand

public void Execute(Dictionary<string, string> arguments)
{
Console.WriteLine("[*] Action: Request a Certificates");
Console.WriteLine("[*] Action: Request a Certificate");

var CA = "";
var subject = "";
Expand Down Expand Up @@ -49,13 +49,13 @@ public void Execute(Dictionary<string, string> 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"))
Expand All @@ -76,7 +76,7 @@ public void Execute(Dictionary<string, string> 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;
}

Expand Down
24 changes: 12 additions & 12 deletions Certify/Lib/Cert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}
Expand Down