@@ -43,7 +43,6 @@ SBO001.001 Check Secure Boot default state (firmware)
4343 [Documentation] This test aims to verify that Secure Boot state after
4444 ... flashing the platform with the Dasharo firmware is
4545 ... correct.
46- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO001.001 not supported
4746 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO001.001 not supported
4847 Power On
4948 ${setup_menu } = Enter Setup Menu Tianocore And Return Construction
@@ -60,7 +59,6 @@ SBO002.001 UEFI Secure Boot (Ubuntu)
6059 [Documentation] This test verifies that Secure Boot can be enabled from
6160 ... boot menu and, after the DUT reset, it is seen from
6261 ... the OS.
63- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO002.001 not supported
6462 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO002.001 not supported
6563
6664 # 1. Make sure that SB is enabled
@@ -97,7 +95,6 @@ SBO002.002 UEFI Secure Boot (Windows)
9795 [Documentation] This test verifies that Secure Boot can be enabled from
9896 ... boot menu and, after the DUT reset, it is seen from
9997 ... the OS.
100- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO002.002 not supported
10198 Skip If not ${TESTS_IN_WINDOWS_SUPPORT } SBO002.002 not supported
10299
103100 # 1. Make sure that SB is enabled
@@ -133,7 +130,6 @@ SBO002.002 UEFI Secure Boot (Windows)
133130SBO003.001 Attempt to boot file with the correct key from Boot Maintenance Manager (firmware)
134131 [Documentation] This test verifies that Secure Boot allows booting a
135132 ... signed file with a correct key.
136- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO004.001 not supported
137133 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO004.001 not supported
138134 Power On
139135 ${sb_menu } = Enter Secure Boot Menu And Return Construction
@@ -158,7 +154,6 @@ SBO003.001 Attempt to boot file with the correct key from Boot Maintenance Manag
158154SBO004.001 Attempt to boot file without the key from Boot Maintenance Manager (firmware)
159155 [Documentation] This test verifies that Secure Boot blocks booting a file
160156 ... without a key.
161- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO004.001 not supported
162157 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO004.001 not supported
163158 # 1. Make sure that SB is enabled
164159 Power On
@@ -176,7 +171,6 @@ SBO004.001 Attempt to boot file without the key from Boot Maintenance Manager (f
176171SBO005.001 Attempt to boot file with the wrong-signed key from Boot Maintenance Manager (firmware)
177172 [Documentation] This test verifies that Secure Boot disallows booting
178173 ... a signed file with a wrong-signed key.
179- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO005.001 not supported
180174 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO005.001 not supported
181175 # 1. Make sure that SB is enabled
182176 Power On
@@ -194,7 +188,6 @@ SBO005.001 Attempt to boot file with the wrong-signed key from Boot Maintenance
194188SBO006.001 Reset Secure Boot Keys option availability (firmware)
195189 [Documentation] This test verifies that the Reset Secure Boot Keys
196190 ... option is available
197- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO006.001 not supported
198191 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO006.001 not supported
199192 Power On
200193 ${setup_menu } = Enter Setup Menu Tianocore And Return Construction
@@ -210,7 +203,6 @@ SBO006.001 Reset Secure Boot Keys option availability (firmware)
210203SBO007.001 Attempt to boot the file after restoring keys to default (firmware)
211204 [Documentation] This test verifies that restoring the keys to default
212205 ... removes any custom added certificates.
213- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO007.001 not supported
214206 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO007.001 not supported
215207 Power On
216208 ${sb_menu } = Enter Secure Boot Menu And Return Construction
@@ -249,7 +241,6 @@ SBO007.001 Attempt to boot the file after restoring keys to default (firmware)
249241SBO008.001 Attempt to enroll the key in the incorrect format (firmware)
250242 [Documentation] This test verifies that it is impossible to load
251243 ... a certificate in the wrong file format.
252- Skip If not ${TESTS_IN_FIRMWARE_SUPPORT } SBO008.001 not supported
253244 Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO008.001 not supported
254245 # 1. Make sure that SB is enabled
255246 Power On
@@ -264,6 +255,124 @@ SBO008.001 Attempt to enroll the key in the incorrect format (firmware)
264255 Select File In File Explorer cert_fake.der
265256 Read From Terminal Until ERROR: Unsupported file type!
266257
258+ SBO009.001 Attempt to enroll and delete new PK key in OS (Ubuntu)
259+ [Documentation] This test verifies that it is impossible to load
260+ ... a certificate in the wrong file format.
261+ Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO009.001 not supported
262+ # 1. Make sure that SB is enabled and default keys enrolled.
263+ Power On
264+ ${sb_menu } = Enter Secure Boot Menu And Return Construction
265+ ${advanced_menu } = Enter Advanced Secure Boot Keys Management And Return Construction ${sb_menu }
266+ Reset To Default Secure Boot Keys ${advanced_menu }
267+ # 2. Delete PK so that we can enroll a new one in OS
268+ Enter PK Options And Delete PK ${advanced_menu }
269+ # Let the flash operation be finished before resetting
270+ Sleep 1
271+ Tianocore Reset System
272+ # Now boot to the OS
273+ Boot System Or From Connected Disk ${ENV_ID_UBUNTU }
274+ Login To Linux
275+ Switch To Root User
276+ # The magic starts here...
277+ # Check if we are in SetupMode
278+ ${out } = Read Secure Boot Variable SetupMode
279+ ${setup_mode } = Convert To Integer ${out }
280+ IF ${setup_mode } != 1 Fail Secure Boot not in setup mode
281+ # Generate a new PK key and enroll the new PK. Setup mode should be cleared
282+ Generate New PK Key Set
283+ ${status } = Enroll New PK From OS
284+ IF ${status } != 0 Fail Could not enroll new PK from OS
285+ ${out } = Read Secure Boot Variable SetupMode
286+ ${setup_mode } = Convert To Integer ${out }
287+ IF ${setup_mode } != 0 Fail Secure Boot not in user mode
288+ # Attempt to delete PK. We should get back to Setup Mode
289+ ${status } = Enroll New PK From OS noPK.auth
290+ IF ${status } != 0 Fail Could not delete PK from OS
291+ ${out } = Read Secure Boot Variable SetupMode
292+ ${setup_mode } = Convert To Integer ${out }
293+ IF ${setup_mode } != 1 Fail Secure Boot not in setup mode
294+
295+ SBO009.002 Attempt to change existing PK key in OS (Ubuntu)
296+ [Documentation] This test verifies that it is impossible to load
297+ ... a certificate in the wrong file format.
298+ Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO009.002 not supported
299+ # 1. Make sure that SB is enabled and default keys enrolled.
300+ Power On
301+ ${sb_menu } = Enter Secure Boot Menu And Return Construction
302+ ${advanced_menu } = Enter Advanced Secure Boot Keys Management And Return Construction ${sb_menu }
303+ Reset To Default Secure Boot Keys ${advanced_menu }
304+ # 2. Delete PK so that we can enroll a new one in OS
305+ Enter PK Options And Delete PK ${advanced_menu }
306+ # Let the flash operation be finished before resetting
307+ Sleep 1
308+ Tianocore Reset System
309+ # Now boot to the OS
310+ Boot System Or From Connected Disk ${ENV_ID_UBUNTU }
311+ Login To Linux
312+ Switch To Root User
313+ # The magic starts here...
314+ # Check if we are in SetupMode
315+ ${out } = Read Secure Boot Variable SetupMode
316+ ${setup_mode } = Convert To Integer ${out }
317+ IF ${setup_mode } != 1 Fail Secure Boot not in setup mode
318+ # Generate a new PK key and enroll the new PK. Setup mode should be cleared
319+ Generate New PK Key Set
320+ ${status } = Enroll New PK From OS
321+ IF ${status } != 0 Fail Could not enroll new PK from OS
322+ ${out } = Read Secure Boot Variable SetupMode
323+ ${setup_mode } = Convert To Integer ${out }
324+ IF ${setup_mode } != 0 Fail Secure Boot not in user mode
325+ # Attempt to change PK.
326+ Generate New PK Key Set newPK
327+ # Sign the new PK signature list with existing PK
328+ Execute Command In Terminal
329+ ... sign-efi-sig-list -k PK.key -c PK.crt PK newPK.esl newPK.auth
330+ ${status } = Enroll New PK From OS newPk.auth
331+ IF ${status } != 0 Fail Could not change PK from OS
332+ ${out } = Read Secure Boot Variable SetupMode
333+ ${setup_mode } = Convert To Integer ${out }
334+ IF ${setup_mode } != 0 Fail Secure Boot not in user mode
335+
336+ SBO009.003 Attempt to change PK with incorrectly signed PK in OS (Ubuntu)
337+ [Documentation] This test verifies that it is impossible to load
338+ ... a certificate in the wrong file format.
339+ Skip If not ${TESTS_IN_UBUNTU_SUPPORT } SBO009.003 not supported
340+ # 1. Make sure that SB is enabled and default keys enrolled.
341+ Power On
342+ ${sb_menu } = Enter Secure Boot Menu And Return Construction
343+ ${advanced_menu } = Enter Advanced Secure Boot Keys Management And Return Construction ${sb_menu }
344+ Reset To Default Secure Boot Keys ${advanced_menu }
345+ # 2. Delete PK so that we can enroll a new one in OS
346+ Enter PK Options And Delete PK ${advanced_menu }
347+ # Let the flash operation be finished before resetting
348+ Sleep 1
349+ Tianocore Reset System
350+ # Now boot to the OS
351+ Boot System Or From Connected Disk ${ENV_ID_UBUNTU }
352+ Login To Linux
353+ Switch To Root User
354+ # The magic starts here...
355+ # Check if we are in SetupMode
356+ ${out } = Read Secure Boot Variable SetupMode
357+ ${setup_mode } = Convert To Integer ${out }
358+ IF ${setup_mode } != 1 Fail Secure Boot not in setup mode
359+ # Generate a new PK key and enroll the new PK. Setup mode should be cleared
360+ Generate New PK Key Set
361+ ${status } = Enroll New PK From OS
362+ IF ${status } != 0 Fail Could not enroll new PK from OS
363+ ${out } = Read Secure Boot Variable SetupMode
364+ ${setup_mode } = Convert To Integer ${out }
365+ IF ${setup_mode } != 0 Fail Secure Boot not in user mode
366+ # Attempt to change PK but do not sign it with current PK.
367+ Generate New PK Key Set newPK
368+ ${status } = Enroll New PK From OS newPK.auth
369+ IF ${status } == 0
370+ Fail Unauthorized PK has been enrolled successfully
371+ END
372+ ${out } = Read Secure Boot Variable SetupMode
373+ ${setup_mode } = Convert To Integer ${out }
374+ IF ${setup_mode } != 0 Fail Secure Boot not in user mode
375+
267376
268377*** Keywords ***
269378Set Secure Boot State To Disabled
0 commit comments