Skip to content

Commit 0002713

Browse files
committed
Validate key size for staging builds
1 parent 4767d2b commit 0002713

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/security/secureboot/validate_keylength.pm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ sub get_boot_image_name {
4747
die "Unsupported architecture: $arch";
4848
}
4949

50-
# on any staging builds we always expect 2048 bits keys
51-
# on release builds, for s390x and ppc64le we expect 4096 bits keys
50+
# on x86_64 and aarch64 we expect 2048 bits keys
51+
# for s390x and ppc64le we expect 4096 bits keys (except for kernel staging builds)
5252
sub get_expected_keylength {
53-
return 2048 if get_var('STAGING');
54-
return get_required_var('ARCH') =~ /s390x|ppc64le/ ? 4096 : 2048;
53+
return '2048' unless get_required_var('ARCH') =~ /s390x|ppc64le/;
54+
return '(2048|4096)' if get_var('STAGING');
55+
return '4096';
5556
}
5657

5758
sub post_fail_hook {

0 commit comments

Comments
 (0)