Skip to content

Commit 446b1e0

Browse files
xnoxherbertx
authored andcommitted
module: enable automatic module signing with FIPS 202 SHA-3
Add Kconfig options to use SHA-3 for kernel module signing. 256 size for RSA only, and higher sizes for RSA and NIST P-384. Signed-off-by: Dimitri John Ledkov <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent fdb4f66 commit 446b1e0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

certs/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ config MODULE_SIG_KEY_TYPE_RSA
3030
config MODULE_SIG_KEY_TYPE_ECDSA
3131
bool "ECDSA"
3232
select CRYPTO_ECDSA
33-
depends on MODULE_SIG_SHA384 || MODULE_SIG_SHA512
33+
depends on !(MODULE_SIG_SHA256 || MODULE_SIG_SHA3_256)
3434
help
3535
Use an elliptic curve key (NIST P384) for module signing. Use
3636
a strong hash of same or higher bit length, i.e. sha384 or

kernel/module/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ config MODULE_SIG_SHA512
248248
bool "Sign modules with SHA-512"
249249
select CRYPTO_SHA512
250250

251+
config MODULE_SIG_SHA3_256
252+
bool "Sign modules with SHA3-256"
253+
select CRYPTO_SHA3
254+
255+
config MODULE_SIG_SHA3_384
256+
bool "Sign modules with SHA3-384"
257+
select CRYPTO_SHA3
258+
259+
config MODULE_SIG_SHA3_512
260+
bool "Sign modules with SHA3-512"
261+
select CRYPTO_SHA3
262+
251263
endchoice
252264

253265
config MODULE_SIG_HASH
@@ -256,6 +268,9 @@ config MODULE_SIG_HASH
256268
default "sha256" if MODULE_SIG_SHA256
257269
default "sha384" if MODULE_SIG_SHA384
258270
default "sha512" if MODULE_SIG_SHA512
271+
default "sha3-256" if MODULE_SIG_SHA3_256
272+
default "sha3-384" if MODULE_SIG_SHA3_384
273+
default "sha3-512" if MODULE_SIG_SHA3_512
259274

260275
choice
261276
prompt "Module compression mode"

0 commit comments

Comments
 (0)