From 84b066e332d09a77c3f881746bacddb5b73ed3ae 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/objects.c b/src/objects.c index 0ee7fe61..b50d3da8 100644 --- a/src/objects.c +++ b/src/objects.c @@ -3927,8 +3927,9 @@ 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, - CK_UNAVAILABLE_INFORMATION); + key = + p11prov_obj_new(ctx, CK_UNAVAILABLE_INFORMATION, + CK_P11PROV_IMPORTED_HANDLE, CK_UNAVAILABLE_INFORMATION); if (!key) { return NULL; }