mixlib-install 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fc991d852b256ce4a6a95d7d7263fb6189bde37
4
- data.tar.gz: 40951a053a87cbc27c3a1dbdd9aeb5cdd99ed1db
3
+ metadata.gz: a18332899c9613f49a801ec4ceb6508511b29d81
4
+ data.tar.gz: 89d42e1043cdc5ae1da07b89fbb6f501a33b9e22
5
5
  SHA512:
6
- metadata.gz: cca181d4b9a1049457ca73f1a7104d5a341918fc1540ab7b0f0cbe8bd2f9089331021813095747fe2fc6067517419d2eac5acb66140d44fe2f9d51b22bea38ea
7
- data.tar.gz: a68d2666633af91189bc34e943b210601382c7104430a77c73044fab65c9ced6643027d9a0cf3d18f77d7a05baa7255b2f0e8ca0668a060736388fbafb609ecb
6
+ metadata.gz: 2fcaa63666676a96788e7b28375d033369bba761db6223b3d365ccfd316d9903ec66f5dd247f05b2ef5a26614a7b3aa9cbfeb42fc23643d885151903197a3b00
7
+ data.tar.gz: 9b3e8c8dad6034f288888cac36cfedb51a4a368f3c46bafcff47182db6508e35fe5234c15573143dc4f180c5b43dc27e917d6bd468369f53d76686f7fc9e68eb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## [3.3.2]
4
+ - Fix bug where calling `products_available_on_downloads_site` would corrupt the product map.
5
+
3
6
  ## [3.3.1]
4
7
  - Add download_url_override and checksum options for powershell version of installer script
5
8
  - Update powershell execution due to policy changes in Windows 8, Windows Server 2012, and Windows 8.1
@@ -8,7 +8,7 @@
8
8
  # $version: The version requested. Used only for warning user if not set.
9
9
  ############
10
10
 
11
- if test "x$version" = "x"; then
11
+ if test "x$version" = "x" -a "x$CI" != "xtrue"; then
12
12
  echo
13
13
  echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
14
14
  echo
@@ -111,23 +111,10 @@ function Test-ProjectPackage {
111
111
  [cmdletbinding()]
112
112
  param ($Path, $Algorithm = 'SHA256', $Hash)
113
113
 
114
- if (-not (get-command get-filehash -ErrorAction 'SilentlyContinue')) {
115
- function disposable($o){($o -is [IDisposable]) -and (($o | get-member | foreach-object {$_.name}) -contains 'Dispose')}
116
- function use($obj, [scriptblock]$sb){try {& $sb} catch [exception]{throw $_} finally {if (disposable $obj) {$obj.Dispose()}} }
117
- function Get-FileHash ($Path, $Algorithm) {
118
- $Path = (resolve-path $path).providerpath
119
- $hash = @{Algorithm = $Algorithm; Path = $Path}
120
- use ($c = Get-SHA256Converter) {
121
- use ($in = (gi $path).OpenRead()) {
122
- $hash.Hash = ([BitConverter]::ToString($c.ComputeHash($in))).Replace("-", "").ToUpper()
123
- }
124
- }
125
- new-object PSObject -Property $hash
126
- }
127
- }
128
114
  Write-Verbose "Testing the $Algorithm hash for $path."
129
115
  $ActualHash = (Get-FileHash -Algorithm $Algorithm -Path $Path).Hash.ToLower()
130
- Write-Verbose "`tDesired Hash - '$hash'"
116
+
117
+ Write-Verbose "`tDesired Hash - '$Hash'"
131
118
  Write-Verbose "`tActual Hash - '$ActualHash'"
132
119
  $Valid = $ActualHash -eq $Hash
133
120
  if (-not $Valid) {
@@ -136,15 +123,36 @@ function Test-ProjectPackage {
136
123
  return $Valid
137
124
  }
138
125
 
139
- function Get-SHA256Converter {
140
- if($PSVersionTable.PSEdition -eq 'Core') {
141
- [System.Security.Cryptography.SHA256]::Create()
126
+ function Get-FileHash ($Path, $Algorithm) {
127
+ function disposable($o){($o -is [IDisposable]) -and (($o | get-member | foreach-object {$_.name}) -contains 'Dispose')}
128
+ function use($obj, [scriptblock]$sb){try {& $sb} catch [exception]{throw $_} finally {if (disposable $obj) {$obj.Dispose()}} }
129
+ $Path = (resolve-path $Path).providerpath
130
+ $hash = @{Algorithm = $Algorithm; Path = $Path}
131
+ use ($c = Get-SHA256Converter) {
132
+ use ($in = (gi $Path).OpenRead()) {
133
+ $hash.Hash = ([BitConverter]::ToString($c.ComputeHash($in))).Replace("-", "").ToUpper()
134
+ }
142
135
  }
143
- else {
144
- New-Object -TypeName Security.Cryptography.SHA256Managed
136
+ return $hash
137
+ }
138
+
139
+ function Get-SHA256Converter {
140
+ if (Is-FIPS) {
141
+ New-Object -TypeName Security.Cryptography.SHA256Cng
142
+ } else {
143
+ if($PSVersionTable.PSEdition -eq 'Core') {
144
+ [System.Security.Cryptography.SHA256]::Create()
145
+ }
146
+ else {
147
+ New-Object -TypeName Security.Cryptography.SHA256Managed
148
+ }
145
149
  }
146
150
  }
147
151
 
152
+ function Is-FIPS {
153
+ (Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy).Enabled
154
+ }
155
+
148
156
  function Get-WMIQuery {
149
157
  param ($class)
150
158
 
@@ -154,4 +162,4 @@ function Get-WMIQuery {
154
162
  else {
155
163
  Get-WmiObject $class
156
164
  }
157
- }
165
+ }
@@ -178,7 +178,7 @@ module Mixlib
178
178
  # :key => product_key
179
179
  # :value => Mixlib::Install::Product instance
180
180
  def products_available_on_downloads_site
181
- @product_map.delete_if do |product_key, product|
181
+ @product_map.reject do |product_key, product|
182
182
  product.downloads_product_page_url == :not_available
183
183
  end
184
184
  end
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "3.3.1"
3
+ VERSION = "3.3.2"
4
4
  end
5
5
  end
@@ -29,14 +29,22 @@ Function Get-SHA256($src) {
29
29
  }
30
30
 
31
31
  function Get-SHA256Converter {
32
- if($PSVersionTable.PSEdition -eq 'Core') {
33
- [System.Security.Cryptography.SHA256]::Create()
34
- }
35
- else {
36
- New-Object -TypeName Security.Cryptography.SHA256Managed
32
+ if (Is-FIPS) {
33
+ New-Object -TypeName Security.Cryptography.SHA256Cng
34
+ } else {
35
+ if($PSVersionTable.PSEdition -eq 'Core') {
36
+ [System.Security.Cryptography.SHA256]::Create()
37
+ }
38
+ else {
39
+ New-Object -TypeName Security.Cryptography.SHA256Managed
40
+ }
37
41
  }
38
42
  }
39
43
 
44
+ function Is-FIPS {
45
+ (Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy).Enabled
46
+ }
47
+
40
48
  Function Download-Chef($url, $sha256, $dst) {
41
49
  Log "Downloading package from $url"
42
50
  Get-WebContent $url $dst
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-install
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-29 00:00:00.000000000 Z
12
+ date: 2017-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mixlib-shellout