Skip to content

Commit bc8c1f0

Browse files
vesajaaskelainenjforissier
authored andcommitted
libckteec: Add PKCS #1 v1.5 RSA signing support
Add support for performing RSA signing & verification operations for: - PKCS #1 v1.5 RSA with supplied hash value - Multi stage MD5 - Multi stage SHA-1 - Multi stage SHA-224 - Multi stage SHA-256 - Multi stage SHA-384 - Multi stage SHA-512 Specified in: PKCS OP-TEE#11 Cryptographic Token Interface Current Mechanisms Specification Version 2.40 Plus Errata 01 2.1.6 PKCS #1 v1.5 RSA Signed-off-by: Vesa Jääskeläinen <[email protected]> Reviewed-by: Etienne Carriere <[email protected]> Reviewed-by: Ruchika Gupta <[email protected]>
1 parent 453c76a commit bc8c1f0

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

libckteec/include/pkcs11.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ typedef CK_MECHANISM_TYPE *CK_MECHANISM_TYPE_PTR;
262262
#define CKM_RSA_PKCS 0x00001
263263
#define CKM_RSA_9796 0x00002
264264
#define CKM_RSA_X_509 0x00003
265+
#define CKM_MD5_RSA_PKCS 0x00005
266+
#define CKM_SHA1_RSA_PKCS 0x00006
265267
#define CKM_RSA_PKCS_OAEP 0x00009
266268
#define CKM_SHA256_RSA_PKCS 0x00040
267269
#define CKM_SHA384_RSA_PKCS 0x00041

libckteec/include/pkcs11_ta.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,8 @@ enum pkcs11_mechanism_id {
11901190
PKCS11_CKM_RSA_PKCS = 0x00001,
11911191
PKCS11_CKM_RSA_9796 = 0x00002,
11921192
PKCS11_CKM_RSA_X_509 = 0x00003,
1193+
PKCS11_CKM_MD5_RSA_PKCS = 0x00005,
1194+
PKCS11_CKM_SHA1_RSA_PKCS = 0x00006,
11931195
PKCS11_CKM_RSA_PKCS_OAEP = 0x00009,
11941196
PKCS11_CKM_SHA256_RSA_PKCS = 0x00040,
11951197
PKCS11_CKM_SHA384_RSA_PKCS = 0x00041,

libckteec/src/ck_debug.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ const char *ckm2str(CK_MECHANISM_TYPE id)
125125
CK2STR_ENTRY(CKM_RSA_PKCS);
126126
CK2STR_ENTRY(CKM_RSA_9796);
127127
CK2STR_ENTRY(CKM_RSA_X_509);
128+
CK2STR_ENTRY(CKM_MD5_RSA_PKCS);
129+
CK2STR_ENTRY(CKM_SHA1_RSA_PKCS);
128130
CK2STR_ENTRY(CKM_RSA_PKCS_OAEP);
129131
CK2STR_ENTRY(CKM_SHA256_RSA_PKCS);
130132
CK2STR_ENTRY(CKM_SHA384_RSA_PKCS);

libckteec/src/serialize_ck.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,13 @@ CK_RV serialize_ck_mecha_params(struct serializer *obj,
523523
case CKM_ECDSA_SHA384:
524524
case CKM_ECDSA_SHA512:
525525
case CKM_RSA_PKCS_KEY_PAIR_GEN:
526+
case CKM_RSA_PKCS:
527+
case CKM_MD5_RSA_PKCS:
528+
case CKM_SHA1_RSA_PKCS:
529+
case CKM_SHA224_RSA_PKCS:
530+
case CKM_SHA256_RSA_PKCS:
531+
case CKM_SHA384_RSA_PKCS:
532+
case CKM_SHA512_RSA_PKCS:
526533
/* No parameter expected, size shall be 0 */
527534
if (mechanism->ulParameterLen)
528535
return CKR_MECHANISM_PARAM_INVALID;

0 commit comments

Comments
 (0)