Skip to content

Commit

Permalink
Minor changes to language including punctuation.
Browse files Browse the repository at this point in the history
Note: will add command feedback later when testing applets...
  • Loading branch information
JMarkstrom committed Dec 22, 2024
1 parent 49b9446 commit bf219a4
Show file tree
Hide file tree
Showing 34 changed files with 102 additions and 102 deletions.
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/ConnectYubikeyOATH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}
protected override void ProcessRecord()
Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/GetYubikeyOATH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/GetYubikeyOATHAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/NewYubikeyOATHAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/ProtectYubikeyOATH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/RemoveYubikeyOATHAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/RenameYubikeyOATHAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
};
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/RequestYubikeyOATHCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/ResetYubikeyOATH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OATH/UnprotectYubikeyOATH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OTP/GetYubikeyOTP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OTP/RemoveYubikeyOTP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OTP/RequestYubikeyOTPChallange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OTP/SetYubikeyOTP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/OTP/SwitchYubikeyOTP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down
12 changes: 6 additions & 6 deletions Module/Cmdlets/Other/ConfirmYubikeyAttestion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ protected override void ProcessRecord()
}
else
{
throw new Exception("Intermediate Certificate is missing");
throw new Exception("Intermediate Certificate is missing!");
}

}

if (_AttestionCertificate is null || _IntermediateCertificate is null)
{
// Is this still needed??
throw new Exception("Attestion Certificate or Intermediate Certificate is missing");
throw new Exception("Attestion Certificate or Intermediate Certificate is missing!");
}

// Check the entire chain up to Yubico's root CA
Expand Down Expand Up @@ -188,22 +188,22 @@ protected override void ProcessRecord()
switch (extension.Oid!.Value)
{
case "1.3.6.1.4.1.41482.3.3": // Firmware version
WriteDebug("Extracting Firmware version");
WriteDebug("Extracting Firmware version...");
_out_FirmwareVersion = new FirmwareVersion(extension.RawData[0], extension.RawData[1], extension.RawData[2]);
break;
case "1.3.6.1.4.1.41482.3.7": // Serial number
WriteDebug("Extracting Serial number");
WriteDebug("Extracting Serial number...");
byte[] tempSerialBytes = extension.RawData;
Array.Reverse(tempSerialBytes);
_out_SerialNumber = BitConverter.ToUInt32(tempSerialBytes, 0);
break;
case "1.3.6.1.4.1.41482.3.8": // Pin / Touch Policies
WriteDebug("Extracting Pin / Touch Policies");
WriteDebug("Extracting Pin / Touch Policies...");
_out_PinPolicy = (PivPinPolicy)extension.RawData[0];
_out_TouchPolicy = (PivTouchPolicy)extension.RawData[1];
break;
case "1.3.6.1.4.1.41482.3.9": // Form factor
WriteDebug("Extracting Form factor");
WriteDebug("Extracting Form factor...");
_out_FormFactor = (FormFactor)(extension.RawData[0] & (byte)0x7F);
break;
}
Expand Down
14 changes: 7 additions & 7 deletions Module/Cmdlets/Other/ConvertToAltSecurity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ protected override void ProcessRecord()
if (_certificate is not null)
{
string sshkey = "";
WriteDebug("Certificate successfully loaded");
WriteDebug("Certificate successfully loaded.");
if (_certificate.PublicKey.Oid.FriendlyName == "RSA")
{
WriteDebug("Certificate public key is of type RSA");
WriteDebug("Certificate public key is of type RSA.");
sshkey = GenerateIdentifier.SSHIdentifier(_certificate.PublicKey.GetRSAPublicKey()!, _certificate.Subject);
}
else if (_certificate.PublicKey.Oid.FriendlyName == "ECC")
{
WriteDebug("Certificate public key is of type ECC");
WriteDebug("Certificate public key is of type ECC.");
sshkey = GenerateIdentifier.SSHIdentifier(_certificate.PublicKey.GetECDsaPublicKey()!, _certificate.Subject);
}
else
{
throw new Exception("Unknown publickey format");
throw new Exception("Unknown public key format!");
}

//Extract the Subject Key Identifier / 2.5.29.14
Expand Down Expand Up @@ -103,17 +103,17 @@ protected override void ProcessRecord()
string sshkey = "";
if (_certificateRequest.PublicKey.Oid.FriendlyName == "RSA")
{
WriteDebug("Certificate public key is of type RSA");
WriteDebug("Certificate public key is of type RSA.");
sshkey = GenerateIdentifier.SSHIdentifier(_certificateRequest.PublicKey.GetRSAPublicKey()!, "");
}
else if (_certificateRequest.PublicKey.Oid.FriendlyName == "ECC")
{
WriteDebug("Certificate public key is of type ECC");
WriteDebug("Certificate public key is of type ECC.");
sshkey = GenerateIdentifier.SSHIdentifier(_certificateRequest.PublicKey.GetECDsaPublicKey()!, "");
}
else
{
throw new Exception("Unknown public key format");
throw new Exception("Unknown public key format!");
}

X509Extension stringSKI = new X509SubjectKeyIdentifierExtension(_certificateRequest.PublicKey, false);
Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/PIV/AssertYubiKeyPIV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down
8 changes: 4 additions & 4 deletions Module/Cmdlets/PIV/BlockYubikeyPIV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down Expand Up @@ -58,7 +58,7 @@ protected override void ProcessRecord()
{
if (e.Message != "There are no retries remaining for a PIN, PUK, or other authentication element.")
{
throw new Exception("Failed to block PUK", e);
throw new Exception("Failed to block PUK!", e);
}
}
}
Expand All @@ -80,7 +80,7 @@ protected override void ProcessRecord()
{
if (e.Message != "There are no retries remaining for a PIN, PUK, or other authentication element.")
{
throw new Exception("Failed to block PUK", e);
throw new Exception("Failed to block PUK!", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand All @@ -64,7 +64,7 @@ protected override void ProcessRecord()
publicKey = pivSession.GetMetadata(Slot).PublicKey;
if (publicKey is null)
{
throw new Exception("Public key is null");
throw new Exception("Public key is null.");
}
}
catch (Exception e)
Expand All @@ -86,7 +86,7 @@ protected override void ProcessRecord()
{
PivAlgorithm.EccP256 => HashAlgorithmName.SHA256,
PivAlgorithm.EccP384 => HashAlgorithmName.SHA384,
_ => throw new Exception("Unknown PublicKey algorithm")
_ => throw new Exception("Unknown Public key algorithm")
};
WriteDebug($"Using Hash based on ECC size: {HashAlgorithm.ToString()}");
request = new CertificateRequest(Subjectname, (ECDsa)dotNetPublicKey, HashAlgorithm);
Expand Down
4 changes: 2 additions & 2 deletions Module/Cmdlets/PIV/BuildYubikeyPIVSignCertificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ protected override void BeginProcessing()
{
if (YubiKeyModule._yubikey is null)
{
WriteDebug("No YubiKey selected, calling Connect-Yubikey");
WriteDebug("No YubiKey selected, calling Connect-Yubikey...");
try
{
var myPowersShellInstance = PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Connect-Yubikey");
myPowersShellInstance.Invoke();
WriteDebug($"Successfully connected");
WriteDebug($"Successfully connected.");
}
catch (Exception e)
{
Expand Down
Loading

0 comments on commit bf219a4

Please sign in to comment.