support/install_command.ps1 in mixlib-install-3.3.2 vs support/install_command.ps1 in mixlib-install-3.3.3
- old
+ new
@@ -27,11 +27,11 @@
return ([System.BitConverter]::ToString($bytes)).Replace("-", "").ToLower()
} Finally { if (($c -ne $null) -and ($c.GetType().GetMethod("Dispose") -ne $null)) { $c.Dispose() }; if ($in -ne $null) { $in.Dispose() } }
}
function Get-SHA256Converter {
- if (Is-FIPS) {
+ if ($(Is-FIPS) -ge 1) {
New-Object -TypeName Security.Cryptography.SHA256Cng
} else {
if($PSVersionTable.PSEdition -eq 'Core') {
[System.Security.Cryptography.SHA256]::Create()
}
@@ -40,10 +40,13 @@
}
}
}
function Is-FIPS {
- (Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy).Enabled
+ if (!$env:fips){
+ $env:fips = (Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy).Enabled
+ }
+ return $env:fips
}
Function Download-Chef($url, $sha256, $dst) {
Log "Downloading package from $url"
Get-WebContent $url $dst