Skip to content

Commit 7d91ed8

Browse files
committed
Merge branch 'main' into cira
2 parents a45b574 + 30320e8 commit 7d91ed8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2509
-84
lines changed

.github/.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ linters:
6363
# - errcheck
6464
- errorlint
6565
- exhaustive
66-
- exportloopref
6766
- forbidigo
6867
# - funlen
6968
- gci

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ jobs:
3535
- name: Check out code into the Go module directory
3636
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3737
- name: golangci-lint
38-
uses: reviewdog/action-golangci-lint@dd3fda91790ca90e75049e5c767509dc0ec7d99b # v2.7.0
38+
uses: reviewdog/action-golangci-lint@f9bba13753278f6a73b27a56a3ffb1bfda90ed71 # v2.8.0
3939
with:
4040
fail_level: error
41+
golangci_lint_version: v1.64.8 # pin golangci-lint version
4142
golangci_lint_flags: "--config=.github/.golangci.yml ./..."
4243

4344
yamllint:
@@ -50,7 +51,7 @@ jobs:
5051
egress-policy: audit
5152

5253
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
53-
- uses: reviewdog/action-yamllint@1dca3ad811867be18fbe293a9818d715a6c2cd46 # v1.20.0
54+
- uses: reviewdog/action-yamllint@f01d8a48fd8d89f89895499fca2cff09f9e9e8c0 # v1.21.0
5455
with:
5556
fail_on_error: true
5657
reporter: github-pr-review
@@ -83,7 +84,7 @@ jobs:
8384
egress-policy: audit
8485

8586
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
86-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
87+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
8788
with:
8889
go-version: ${{ matrix.go-version }}
8990
- name: Checkout code
@@ -102,7 +103,7 @@ jobs:
102103
with:
103104
token: ${{ secrets.CODECOV_TOKEN }}
104105
- name: GitHub Upload Release Artifacts
105-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
106+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
106107
with:
107108
name: JUnit Results ${{matrix.os}}-${{matrix.go-version}}-${{github.run_attempt}}
108109
path: junit-${{matrix.os}}-${{matrix.go-version}}-${{github.run_attempt}}.xml

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
# Initializes the CodeQL tools for scanning.
5757
- name: Initialize CodeQL
58-
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
58+
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
5959
with:
6060
languages: ${{ matrix.language }}
6161
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -66,7 +66,7 @@ jobs:
6666
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6767
# If this step fails, then you should remove it and run the build manually (see below)
6868
- name: Autobuild
69-
uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
69+
uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
7070

7171
# ℹ️ Command-line programs to run using the OS shell.
7272
# 📚 https://git.io/JvXDl
@@ -80,7 +80,7 @@ jobs:
8080
# make release
8181

8282
- name: Perform CodeQL Analysis
83-
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
83+
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
8484
- name: Generate Security Report
8585
uses: rsdmike/github-security-report-action@a149b24539044c92786ec39af8ba38c93496495d # v3.0.4
8686
continue-on-error: true
@@ -94,7 +94,7 @@ jobs:
9494
DATE=$(date +"%Y-%m-%d")
9595
mv "report.pdf" "go-wsman-messages-security-report-$DATE.pdf"
9696
- name: GitHub Upload Release Artifacts
97-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
97+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
9898
continue-on-error: true
9999
with:
100100
name: report

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
egress-policy: audit
3030

3131
- name: Install Go
32-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
32+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
3333
with:
3434
go-version: ${{ matrix.go-version }}
3535

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
persist-credentials: false
3737

3838
- name: Install Go
39-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
39+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
4040
with:
4141
go-version: ${{ matrix.go-version }}
4242
- name: Semantic Release
43-
uses: cycjimmy/semantic-release-action@b1b432f13acb7768e0c8efdec416d363a57546f2 # v4.1.1
43+
uses: cycjimmy/semantic-release-action@0a51e81a6baff2acad3ee88f4121c589c73d0f0e # v4.2.0
4444
with:
4545
semantic_version: 19.0.5
4646
env:

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ jobs:
6464
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6565
# format to the repository Actions tab.
6666
- name: "Upload artifact"
67-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v3.1.0
67+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v3.1.0
6868
with:
6969
name: SARIF file
7070
path: results.sarif
7171
retention-days: 5
7272

7373
# Upload the results to GitHub's code scanning dashboard.
7474
- name: "Upload to code-scanning"
75-
uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
75+
uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
7676
with:
7777
sarif_file: results.sarif

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
**/*.xml
33
coverage
44
!**/wsmantesting/responses/**/*.xml
5+
.DS_Store

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ linters:
6363
# - errcheck
6464
- errorlint
6565
- exhaustive
66-
- exportloopref
6766
- forbidigo
6867
# - funlen
6968
- gci

pkg/wsman/amt/boot/settingdata.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,14 @@ func (settingData SettingData) Pull(enumerationContext string) (response Respons
8989
return
9090
}
9191

92-
// Put will change properties of the selected instance.
9392
func (settingData SettingData) Put(bootSettingData BootSettingDataRequest) (response Response, err error) {
9493
header := settingData.base.WSManMessageCreator.CreateHeader(message.BaseActionsPut, AMTBootSettingData, nil, "", "")
9594
body := fmt.Sprintf(
96-
`<Body><h:AMT_BootSettingData xmlns:h="%sAMT_BootSettingData"><h:BIOSLastStatus>%d</h:BIOSLastStatus><h:BIOSLastStatus>%d</h:BIOSLastStatus><h:BIOSPause>%t</h:BIOSPause><h:BIOSSetup>%t</h:BIOSSetup><h:BootMediaIndex>%d</h:BootMediaIndex><h:BootguardStatus>%d</h:BootguardStatus><h:ConfigurationDataReset>%t</h:ConfigurationDataReset><h:ElementName>%s</h:ElementName><h:EnforceSecureBoot>%t</h:EnforceSecureBoot><h:FirmwareVerbosity>%d</h:FirmwareVerbosity><h:ForcedProgressEvents>%t</h:ForcedProgressEvents><h:IDERBootDevice>%d</h:IDERBootDevice><h:InstanceID>%s</h:InstanceID><h:LockKeyboard>%t</h:LockKeyboard><h:LockPowerButton>%t</h:LockPowerButton><h:LockResetButton>%t</h:LockResetButton><h:LockSleepButton>%t</h:LockSleepButton><h:OptionsCleared>%t</h:OptionsCleared><h:OwningEntity>%s</h:OwningEntity><h:PlatformErase>%t</h:PlatformErase><h:RPEEnabled>%t</h:RPEEnabled><h:RSEPassword>%s</h:RSEPassword><h:ReflashBIOS>%t</h:ReflashBIOS><h:SecureBootControlEnabled>%t</h:SecureBootControlEnabled><h:SecureErase>%t</h:SecureErase><h:UEFIHTTPSBootEnabled>%t</h:UEFIHTTPSBootEnabled><h:UEFILocalPBABootEnabled>%t</h:UEFILocalPBABootEnabled><h:UefiBootNumberOfParams>%d</h:UefiBootNumberOfParams><h:UseIDER>%t</h:UseIDER><h:UseSOL>%t</h:UseSOL><h:UseSafeMode>%t</h:UseSafeMode><h:UserPasswordBypass>%t</h:UserPasswordBypass><h:WinREBootEnabled>%t</h:WinREBootEnabled></h:AMT_BootSettingData></Body>`,
95+
`<Body><h:AMT_BootSettingData xmlns:h="%sAMT_BootSettingData"><h:BIOSPause>%t</h:BIOSPause><h:BIOSSetup>%t</h:BIOSSetup><h:BootMediaIndex>%d</h:BootMediaIndex><h:ConfigurationDataReset>%t</h:ConfigurationDataReset><h:ElementName>%s</h:ElementName><h:EnforceSecureBoot>%t</h:EnforceSecureBoot><h:FirmwareVerbosity>%d</h:FirmwareVerbosity><h:ForcedProgressEvents>%t</h:ForcedProgressEvents><h:IDERBootDevice>%d</h:IDERBootDevice><h:InstanceID>%s</h:InstanceID><h:LockKeyboard>%t</h:LockKeyboard><h:LockPowerButton>%t</h:LockPowerButton><h:LockResetButton>%t</h:LockResetButton><h:LockSleepButton>%t</h:LockSleepButton><h:OwningEntity>%s</h:OwningEntity><h:PlatformErase>%t</h:PlatformErase><h:RSEPassword>%s</h:RSEPassword><h:ReflashBIOS>%t</h:ReflashBIOS><h:SecureErase>%t</h:SecureErase><h:UefiBootParametersArray>%s</h:UefiBootParametersArray><h:UefiBootNumberOfParams>%d</h:UefiBootNumberOfParams><h:UseIDER>%t</h:UseIDER><h:UseSOL>%t</h:UseSOL><h:UseSafeMode>%t</h:UseSafeMode><h:UserPasswordBypass>%t</h:UserPasswordBypass></h:AMT_BootSettingData></Body>`,
9796
settingData.base.WSManMessageCreator.ResourceURIBase,
98-
bootSettingData.BIOSLastStatus[0],
99-
bootSettingData.BIOSLastStatus[1],
10097
bootSettingData.BIOSPause,
10198
bootSettingData.BIOSSetup,
10299
bootSettingData.BootMediaIndex,
103-
bootSettingData.BootguardStatus,
104100
bootSettingData.ConfigurationDataReset,
105101
bootSettingData.ElementName,
106102
bootSettingData.EnforceSecureBoot,
@@ -112,22 +108,17 @@ func (settingData SettingData) Put(bootSettingData BootSettingDataRequest) (resp
112108
bootSettingData.LockPowerButton,
113109
bootSettingData.LockResetButton,
114110
bootSettingData.LockSleepButton,
115-
bootSettingData.OptionsCleared,
116111
bootSettingData.OwningEntity,
117112
bootSettingData.PlatformErase,
118-
bootSettingData.RPEEnabled,
119113
bootSettingData.RSEPassword,
120114
bootSettingData.ReflashBIOS,
121-
bootSettingData.SecureBootControlEnabled,
122115
bootSettingData.SecureErase,
123-
bootSettingData.UEFIHTTPSBootEnabled,
124-
bootSettingData.UEFILocalPBABootEnabled,
116+
bootSettingData.UefiBootParametersArray,
125117
bootSettingData.UefiBootNumberOfParams,
126118
bootSettingData.UseIDER,
127119
bootSettingData.UseSOL,
128120
bootSettingData.UseSafeMode,
129-
bootSettingData.UserPasswordBypass,
130-
bootSettingData.WinREBootEnabled)
121+
bootSettingData.UserPasswordBypass)
131122

132123
response = Response{
133124
Message: &client.Message{

pkg/wsman/amt/boot/settingdata_test.go

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,30 @@ import (
1818
)
1919

2020
var boot_settings = BootSettingDataRequest{
21-
BIOSLastStatus: []int{2, 0},
22-
BIOSPause: false,
23-
BIOSSetup: false,
24-
BootMediaIndex: 0,
25-
BootguardStatus: 127,
26-
ConfigurationDataReset: false,
27-
ElementName: "Intel(r) AMT Boot Configuration Settings",
28-
EnforceSecureBoot: false,
29-
FirmwareVerbosity: 0,
30-
ForcedProgressEvents: false,
31-
IDERBootDevice: 0,
32-
InstanceID: "Intel(r) AMT:BootSettingData 0",
33-
LockKeyboard: false,
34-
LockPowerButton: false,
35-
LockResetButton: false,
36-
LockSleepButton: false,
37-
OptionsCleared: true,
38-
OwningEntity: "Intel(r) AMT",
39-
PlatformErase: false,
40-
RPEEnabled: false,
41-
RSEPassword: "",
42-
ReflashBIOS: false,
43-
SecureBootControlEnabled: false,
44-
SecureErase: false,
45-
UEFIHTTPSBootEnabled: false,
46-
UEFILocalPBABootEnabled: false,
47-
UefiBootNumberOfParams: 0,
48-
UseIDER: false,
49-
UseSOL: false,
50-
UseSafeMode: false,
51-
UserPasswordBypass: false,
52-
WinREBootEnabled: false,
21+
BIOSPause: false,
22+
BIOSSetup: false,
23+
BootMediaIndex: 0,
24+
ConfigurationDataReset: false,
25+
ElementName: "Intel(r) AMT Boot Configuration Settings",
26+
EnforceSecureBoot: false,
27+
FirmwareVerbosity: 0,
28+
ForcedProgressEvents: false,
29+
IDERBootDevice: 0,
30+
InstanceID: "Intel(r) AMT:BootSettingData 0",
31+
LockKeyboard: false,
32+
LockPowerButton: false,
33+
LockResetButton: false,
34+
LockSleepButton: false,
35+
OwningEntity: "Intel(r) AMT",
36+
PlatformErase: false,
37+
RSEPassword: "",
38+
ReflashBIOS: false,
39+
SecureErase: false,
40+
UefiBootNumberOfParams: 0,
41+
UseIDER: false,
42+
UseSOL: false,
43+
UseSafeMode: false,
44+
UserPasswordBypass: false,
5345
}
5446

5547
func TestPositiveAMT_BootSettingData(t *testing.T) {
@@ -87,7 +79,7 @@ func TestPositiveAMT_BootSettingData(t *testing.T) {
8779
XMLName: xml.Name{Space: message.XMLBodySpace, Local: "Body"},
8880
BootSettingDataGetResponse: BootSettingDataResponse{
8981
XMLName: xml.Name{Space: "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData", Local: "AMT_BootSettingData"},
90-
BIOSLastStatus: []int{2, 0},
82+
BIOSLastStatus: []uint16{2, 0},
9183
BIOSSetup: false,
9284
BIOSPause: false,
9385
BootMediaIndex: 0,
@@ -158,7 +150,7 @@ func TestPositiveAMT_BootSettingData(t *testing.T) {
158150
BootSettingDataItems: []BootSettingDataResponse{
159151
{
160152
XMLName: xml.Name{Space: "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData", Local: "AMT_BootSettingData"},
161-
BIOSLastStatus: []int{2, 0},
153+
BIOSLastStatus: []uint16{2, 0},
162154
BIOSSetup: false,
163155
BIOSPause: false,
164156
BootMediaIndex: 0,
@@ -201,7 +193,7 @@ func TestPositiveAMT_BootSettingData(t *testing.T) {
201193
AMTBootSettingData,
202194
wsmantesting.Put,
203195
fmt.Sprintf(
204-
`<h:AMT_BootSettingData xmlns:h="%sAMT_BootSettingData"><h:BIOSLastStatus>2</h:BIOSLastStatus><h:BIOSLastStatus>0</h:BIOSLastStatus><h:BIOSPause>false</h:BIOSPause><h:BIOSSetup>false</h:BIOSSetup><h:BootMediaIndex>0</h:BootMediaIndex><h:BootguardStatus>127</h:BootguardStatus><h:ConfigurationDataReset>false</h:ConfigurationDataReset><h:ElementName>Intel(r) AMT Boot Configuration Settings</h:ElementName><h:EnforceSecureBoot>false</h:EnforceSecureBoot><h:FirmwareVerbosity>0</h:FirmwareVerbosity><h:ForcedProgressEvents>false</h:ForcedProgressEvents><h:IDERBootDevice>0</h:IDERBootDevice><h:InstanceID>Intel(r) AMT:BootSettingData 0</h:InstanceID><h:LockKeyboard>false</h:LockKeyboard><h:LockPowerButton>false</h:LockPowerButton><h:LockResetButton>false</h:LockResetButton><h:LockSleepButton>false</h:LockSleepButton><h:OptionsCleared>true</h:OptionsCleared><h:OwningEntity>Intel(r) AMT</h:OwningEntity><h:PlatformErase>false</h:PlatformErase><h:RPEEnabled>false</h:RPEEnabled><h:RSEPassword></h:RSEPassword><h:ReflashBIOS>false</h:ReflashBIOS><h:SecureBootControlEnabled>false</h:SecureBootControlEnabled><h:SecureErase>false</h:SecureErase><h:UEFIHTTPSBootEnabled>false</h:UEFIHTTPSBootEnabled><h:UEFILocalPBABootEnabled>false</h:UEFILocalPBABootEnabled><h:UefiBootNumberOfParams>0</h:UefiBootNumberOfParams><h:UseIDER>false</h:UseIDER><h:UseSOL>false</h:UseSOL><h:UseSafeMode>false</h:UseSafeMode><h:UserPasswordBypass>false</h:UserPasswordBypass><h:WinREBootEnabled>false</h:WinREBootEnabled></h:AMT_BootSettingData>`,
196+
`<h:AMT_BootSettingData xmlns:h="%sAMT_BootSettingData"><h:BIOSPause>false</h:BIOSPause><h:BIOSSetup>false</h:BIOSSetup><h:BootMediaIndex>0</h:BootMediaIndex><h:ConfigurationDataReset>false</h:ConfigurationDataReset><h:ElementName>Intel(r) AMT Boot Configuration Settings</h:ElementName><h:EnforceSecureBoot>false</h:EnforceSecureBoot><h:FirmwareVerbosity>0</h:FirmwareVerbosity><h:ForcedProgressEvents>false</h:ForcedProgressEvents><h:IDERBootDevice>0</h:IDERBootDevice><h:InstanceID>Intel(r) AMT:BootSettingData 0</h:InstanceID><h:LockKeyboard>false</h:LockKeyboard><h:LockPowerButton>false</h:LockPowerButton><h:LockResetButton>false</h:LockResetButton><h:LockSleepButton>false</h:LockSleepButton><h:OwningEntity>Intel(r) AMT</h:OwningEntity><h:PlatformErase>false</h:PlatformErase><h:RSEPassword></h:RSEPassword><h:ReflashBIOS>false</h:ReflashBIOS><h:SecureErase>false</h:SecureErase><h:UefiBootParametersArray></h:UefiBootParametersArray><h:UefiBootNumberOfParams>0</h:UefiBootNumberOfParams><h:UseIDER>false</h:UseIDER><h:UseSOL>false</h:UseSOL><h:UseSafeMode>false</h:UseSafeMode><h:UserPasswordBypass>false</h:UserPasswordBypass></h:AMT_BootSettingData>`,
205197
"http://intel.com/wbem/wscim/1/amt-schema/1/"),
206198
func() (Response, error) {
207199
client.CurrentMessage = wsmantesting.CurrentMessagePut
@@ -212,7 +204,7 @@ func TestPositiveAMT_BootSettingData(t *testing.T) {
212204
XMLName: xml.Name{Space: message.XMLBodySpace, Local: "Body"},
213205
BootSettingDataGetResponse: BootSettingDataResponse{
214206
XMLName: xml.Name{Space: "http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData", Local: "AMT_BootSettingData"},
215-
BIOSLastStatus: []int{2, 0},
207+
BIOSLastStatus: []uint16{2, 0},
216208
BIOSSetup: false,
217209
BIOSPause: false,
218210
BootMediaIndex: 0,
@@ -243,7 +235,6 @@ func TestPositiveAMT_BootSettingData(t *testing.T) {
243235
UseSOL: false,
244236
UseSafeMode: false,
245237
UserPasswordBypass: false,
246-
WinREBootEnabled: false,
247238
},
248239
},
249240
},
@@ -322,8 +313,8 @@ func TestNegativeAMT_BootSettingData(t *testing.T) {
322313
UEFIHTTPSBootEnabled: false,
323314
SecureBootControlEnabled: false,
324315
BootguardStatus: 127,
325-
BIOSLastStatus: []int{0, 0},
326-
UEFIBootParametersArray: []int{0},
316+
BIOSLastStatus: []uint16{0, 0},
317+
UEFIBootParametersArray: []uint8{0},
327318
UefiBootNumberOfParams: 0,
328319
RPEEnabled: false,
329320
PlatformErase: false,
@@ -394,8 +385,8 @@ func TestNegativeAMT_BootSettingData(t *testing.T) {
394385
UEFIHTTPSBootEnabled: false,
395386
SecureBootControlEnabled: false,
396387
BootguardStatus: 127,
397-
BIOSLastStatus: []int{0, 0},
398-
UEFIBootParametersArray: []int{0},
388+
BIOSLastStatus: []uint16{0, 0},
389+
UEFIBootParametersArray: []uint8{0},
399390
UefiBootNumberOfParams: 0,
400391
RPEEnabled: false,
401392
PlatformErase: false,

0 commit comments

Comments
 (0)