mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-09-03 02:16:09 +02:00

Secure keys are derieved using CAAM crypto block.
Secure keys derieved are the random number symmetric keys from CAAM.
Blobs corresponding to the key are formed using CAAM. User space
will only be able to view the blob of the key.
Signed-off-by: Udit Agarwal <udit.agarwal@nxp.com>
Reviewed-by: Sahil Malhotra <sahil.malhotra@nxp.com>
[ Aisheng: fix minior conflicts due to
47f9c27968
("KEYS: trusted: Create trusted keys subsystem") ]
Sign-off-by: Dong Aisheng <aisheng.dong@nxp.com>
34 lines
765 B
C
34 lines
765 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2018 NXP.
|
|
*
|
|
*/
|
|
|
|
#ifndef _KEYS_SECURE_TYPE_H
|
|
#define _KEYS_SECURE_TYPE_H
|
|
|
|
#include <linux/key.h>
|
|
#include <linux/rcupdate.h>
|
|
|
|
/* Minimum key size to be used is 32 bytes and maximum key size fixed
|
|
* is 128 bytes.
|
|
* Blob size to be kept is Maximum key size + blob header added by CAAM.
|
|
*/
|
|
|
|
#define MIN_KEY_SIZE 32
|
|
#define MAX_KEY_SIZE 128
|
|
#define BLOB_HEADER_SIZE 48
|
|
|
|
#define MAX_BLOB_SIZE (MAX_KEY_SIZE + BLOB_HEADER_SIZE)
|
|
|
|
struct secure_key_payload {
|
|
struct rcu_head rcu;
|
|
unsigned int key_len;
|
|
unsigned int blob_len;
|
|
unsigned char key[MAX_KEY_SIZE + 1];
|
|
unsigned char blob[MAX_BLOB_SIZE];
|
|
};
|
|
|
|
extern struct key_type key_type_secure;
|
|
#endif
|