platform: cznic: Add keyctl helpers for Turris platform

Some Turris devices support signing messages with a per-device unique
asymmetric key that was created on the device at manufacture time.

Add helper module that helps to expose this ability via the keyctl()
syscall.

A device-specific driver can register a signing key by calling
devm_turris_signing_key_create().

Both the `.turris-signing-keys` keyring and the signing key are created
with only the VIEW, READ and SEARCH permissions for userspace - it is
impossible to link / unlink / move them, set their attributes, or unlink
the keyring from userspace.

Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Marek Behún 2025-02-04 14:14:12 +01:00 • committed by Arnd Bergmann
commit 0b28b7080e
No known key found for this signature in database
GPG key ID: 60AB47FFC9095227
5 changed files with 233 additions and 0 deletions