From 3660cdf79f3c8367553ddb481e76181584965840 Mon Sep 17 00:00:00 2001 From: Kshitiz Varshney Date: Thu, 10 Oct 2024 12:18:33 +0200 Subject: [PATCH] Passing CK_P11PROV_IMPORTED_HANDLE while creating mock public key This commit adds CK_P11PROV_IMPORTED_HANDLE argument while creating mock public key session object. Before this patch, when we run TLS1.3 connection, below issue was reported by openssl:- tls_parse_ctos_key_share:unable to find ecdh parameters:ssl/statem/extensions_srvr.c:684 It is because of returning CK_INVALID_HANDLE instead of obj->handle. Signed-off-by: Kshitiz Varshney --- src/objects.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/objects.c b/src/objects.c index 0ee7fe61..8a00c542 100644 --- a/src/objects.c +++ b/src/objects.c @@ -3927,7 +3927,8 @@ P11PROV_OBJ *mock_pub_ec_key(P11PROV_CTX *ctx, CK_ATTRIBUTE_TYPE type, P11PROV_OBJ *key; CK_RV ret; - key = p11prov_obj_new(ctx, CK_UNAVAILABLE_INFORMATION, CK_INVALID_HANDLE, + key = p11prov_obj_new(ctx, CK_UNAVAILABLE_INFORMATION, + CK_P11PROV_IMPORTED_HANDLE, CK_UNAVAILABLE_INFORMATION); if (!key) { return NULL;