Fix thousands of spelling typos (#10272)

This commit is contained in:
Nathan Baulch
2021-08-29 00:58:24 +10:00
committed by GitHub
parent 2d239271e5
commit 5d68bd6a03
1132 changed files with 2060 additions and 2060 deletions

View File

@@ -78,7 +78,7 @@ Base URL of the HTTP endpoints
.PARAMETER Username
Username in HTTP basic authentication
.PARAMETER Passowrd
.PARAMETER Password
Password in HTTP basic authentication
.PARAMETER ApiKey
@@ -441,7 +441,7 @@ SHOULD be included.
If no headers are specified then '(created)' sets as default.
.PARAMETER HashAlgorithm
HashAlgrithm to calculate the hash, Supported values are "sha256" and "sha512"
HashAlgorithm to calculate the hash, Supported values are "sha256" and "sha512"
.PARAMETER SigningAlgorithm
SigningAlgorithm specifies the signature algorithm, supported values are "RSASSA-PKCS1-v1_5" and "RSASSA-PSS"

View File

@@ -53,7 +53,7 @@ function Invoke-PSApiClient {
}
}
if ($CookieParameters -and $CookieParameters.Count -gt 1) {
Write-Warning "Multipe cookie parameters found. Curently only the first one is supported/used"
Write-Warning "Multiple cookie parameters found. Currently only the first one is supported/used"
}
# accept, content-type headers
@@ -73,7 +73,7 @@ function Invoke-PSApiClient {
}
# constrcut URL query string
# construct URL query string
$HttpValues = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
foreach ($Parameter in $QueryParameters.GetEnumerator()) {
if ($Parameter.Value.Count -gt 1) { // array

View File

@@ -9,7 +9,7 @@
.SYNOPSIS
Gets the headers for HTTP signature.
.DESCRIPTION
Gets the headers for the http sigature.
Gets the headers for the http signature.
.PARAMETER Method
HTTP method
.PARAMETER UriBuilder
@@ -97,13 +97,13 @@ function Get-PSHttpSignedHeader {
foreach ($item in $HttpSignatureHeader.GetEnumerator()) {
$headerValuesList += [string]::Format("{0}: {1}", $item.Name, $item.Value)
}
#Concatinate headers value separated by new line
#Concatenate headers value separated by new line
$headerValuesString = $headerValuesList -join "`n"
#Gets the hash of the headers value
$signatureHashString = Get-PSStringHash -String $headerValuesString -HashName $httpSigningConfiguration.HashAlgorithm
#Gets the Key type to select the correct signing alogorithm
#Gets the Key type to select the correct signing algorithm
$KeyType = Get-PSKeyTypeFromFile -KeyFilePath $httpSigningConfiguration.KeyFilePath
if ($keyType -eq "RSA") {
@@ -275,7 +275,7 @@ function Get-PSECDSASignature {
Specifies the string to calculate the hash
.Parameter HashName
Specifies the hash name to calculate the hash, Accepted values are "SHA1", "SHA256" and "SHA512"
It is recommneded not to use "SHA1" to calculate the Hash
It is recommended not to use "SHA1" to calculate the Hash
.Outputs
String
#>
@@ -288,8 +288,8 @@ Function Get-PSStringHash {
[ValidateSet("SHA1", "SHA256", "SHA512")]
$HashName
)
$hashAlogrithm = [System.Security.Cryptography.HashAlgorithm]::Create($HashName)
$hashAlogrithm.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String))
$hashAlgorithm = [System.Security.Cryptography.HashAlgorithm]::Create($HashName)
$hashAlgorithm.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String))
}
<#
@@ -330,9 +330,9 @@ function Get-PSCryptographicScheme {
[Parameter(Mandatory = $true)]
[string]$HashAlgorithm
)
$rsaSigntureType = @("RSASSA-PKCS1-v1_5", "RSASSA-PSS")
$rsaSignatureType = @("RSASSA-PKCS1-v1_5", "RSASSA-PSS")
$SigningAlgorithm = $null
if ($rsaSigntureType -contains $SigningAlgorithm) {
if ($rsaSignatureType -contains $SigningAlgorithm) {
switch ($HashAlgorithm) {
"sha256" { $SigningAlgorithm = "rsa-sha256" }
"sha512" { $SigningAlgorithm = "rsa-sha512" }
@@ -388,9 +388,9 @@ function Get-PSKeyTypeFromFile {
<#
.Synopsis
Converts sequence of R and S bytes to ANS1 format for ECDSASIgnature.
Converts sequence of R and S bytes to ANS1 format for ECDSASignature.
.Description
Converts sequence of R and S bytes to ANS1 format for ECDSASIgnature.
Converts sequence of R and S bytes to ANS1 format for ECDSASignature.
.Parameter RawBytes[]
Specifies the R and S bytes of ECDSA signature.
.Outputs
@@ -402,7 +402,7 @@ function ConvertTo-ECDSAANS1Format{
[byte[]]$RawBytes
)
$derLength = 68 #default lenght for ECDSA code signinged bit 0x44
$derLength = 68 #default length for ECDSA code signing bit 0x44
$rbytesLength = 32 #R length 0x20
$sbytesLength = 32 #S length 0x20
[byte[]]$rBytes = $signedBytes[0..31]
@@ -423,7 +423,7 @@ function ConvertTo-ECDSAANS1Format{
[byte[]]$derBytes = @()
$derBytes += 48 # start of the sequence 0x30
$derBytes += $derLength # total length r lenth, type and r bytes
$derBytes += $derLength # total length r length, type and r bytes
$derBytes += 2 # tag for integer
$derBytes += $rbytesLength # length of r

View File

@@ -11,7 +11,7 @@ namespace RSAEncryption
{
public class RSAEncryptionProvider
{
public static RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile,SecureString keyPassPharse = null)
public static RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile,SecureString keyPassPhrase = null)
{
const String pempubheader = "-----BEGIN PUBLIC KEY-----";
const String pempubfooter = "-----END PUBLIC KEY-----";
@@ -31,7 +31,7 @@ namespace RSAEncryption
if (isPrivateKeyFile)
{
pemkey = ConvertPrivateKeyToBytes(pemstr,keyPassPharse);
pemkey = ConvertPrivateKeyToBytes(pemstr,keyPassPhrase);
if (pemkey == null)
{
return null;
@@ -41,7 +41,7 @@ namespace RSAEncryption
return null ;
}
static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPharse = null)
static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase = null)
{
const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----";
const String pemprivfooter = "-----END RSA PRIVATE KEY-----";
@@ -88,11 +88,11 @@ namespace RSAEncryption
binkey = Convert.FromBase64String(encryptedstr);
}
catch (System.FormatException)
{ //data is not in base64 fromat
{ //data is not in base64 format
return null;
}
byte[] deskey = GetEncryptedKey(salt, keyPassPharse, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
if (deskey == null)
return null;
@@ -213,19 +213,19 @@ namespace RSAEncryption
{
IntPtr unmanagedPswd = IntPtr.Zero;
int HASHLENGTH = 16; //MD5 bytes
byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store contatenated Mi hashed results
byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results
byte[] psbytes = new byte[secpswd.Length];
unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd);
Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length);
Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd);
// --- contatenate salt and pswd bytes into fixed data array ---
// --- concatenate salt and pswd bytes into fixed data array ---
byte[] data00 = new byte[psbytes.Length + salt.Length];
Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes
Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes
// ---- do multi-hashing and contatenate results D1, D2 ... into keymaterial bytes ----
// ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ----
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = null;
byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget
@@ -244,7 +244,7 @@ namespace RSAEncryption
for (int i = 0; i < count; i++)
result = md5.ComputeHash(result);
Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //contatenate to keymaterial
Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial
}
byte[] deskey = new byte[24];
Array.Copy(keymaterial, deskey, deskey.Length);