mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] trusted-keys: Add support for protected keys using CAAM
@ 2025-10-06  7:17 meenakshi.aggarwal
  2025-10-06  7:17 ` [PATCH 1/3] Doc: trusted-keys as protected keys meenakshi.aggarwal
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: meenakshi.aggarwal @ 2025-10-06  7:17 UTC (permalink / raw)
  To: horia.geanta, V.sethi, pankaj.gupta, gaurav.jain, herbert
  Cc: linux-crypto, linux-kernel, Meenakshi Aggarwal

From: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>

Overview:
This patch set adds:
- Support for creating and loading protected keys via `keyctl` interface.
- Documentation updates to describe protected key usage and options.
- CAAM-specific implementation for protected key encryption algorithms.

User can create protected/encrypted key using keyctl interface:

KEYNAME=dm_trust_key_hw
KEY="$(keyctl add trusted $KEYNAME 'new 32 pk key_enc_algo=1' @s)"
keyctl pipe $KEY >~/$KEYNAME.blob
keyctl list @s

dm-crypt can load the protected key buffer from the keyring and use it to
initialize encrypted volumes, ensuring that key material is never exposed in plaintext.

The Protected key buffer is passed to the CAAM driver via the kernel crypto API.
CAAM driver will decapsulate the protected key buffer and perform cipher operation.

Protected Keys are identified by a header structure:

struct caam_pkey_info {
	u8  is_pkey;
	u8  key_enc_algo;
	u16 plain_key_sz;
	u8 key_buf[];
};

This information is populated based on the parameters provided during key creation such as 'new 32 pk key_enc_algo=1'

Internal Workflow:
::

 +------------------------+     +-------------------------------+
 |   Seal Function        |     | paes_skcipher_setkey()        |
 | - Constructs key buffer|---->| - Parses header and key_buf[] |
 | - Adds header metadata |     | - Initializes cipher context  |
 +------------------------+     +-------------------------------+

I welcome feedback and suggestions from the community.

Thank you for your time and consideration.

Best regards,
Meenakshi Aggarwal 

Meenakshi Aggarwal (3):
  Doc: trusted-keys as protected keys
  KEYS: trusted: caam based protected key
  crypto:caam: Add support of paes algorithm

 .../security/keys/trusted-encrypted.rst       |  87 +++++++++++-
 drivers/crypto/caam/blob_gen.c                |  86 +++++++++---
 drivers/crypto/caam/caamalg.c                 | 128 ++++++++++++++++--
 drivers/crypto/caam/caamalg_desc.c            |  87 +++++++++++-
 drivers/crypto/caam/caamalg_desc.h            |  13 +-
 drivers/crypto/caam/desc.h                    |   9 +-
 drivers/crypto/caam/desc_constr.h             |   8 +-
 include/soc/fsl/caam-blob.h                   |  26 ++++
 security/keys/trusted-keys/trusted_caam.c     | 108 +++++++++++++++
 9 files changed, 518 insertions(+), 34 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-17  8:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-06  7:17 [PATCH 0/3] trusted-keys: Add support for protected keys using CAAM meenakshi.aggarwal
2025-10-06  7:17 ` [PATCH 1/3] Doc: trusted-keys as protected keys meenakshi.aggarwal
2025-10-06  7:17 ` [PATCH 2/3] KEYS: trusted: caam based protected key meenakshi.aggarwal
2025-10-06  7:17 ` [PATCH 3/3] crypto:caam: Add support of paes algorithm meenakshi.aggarwal
2025-10-14  8:56 ` [PATCH 0/3] trusted-keys: Add support for protected keys using CAAM Horia Geanta
2025-10-17  8:22 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®