From ee8657df20aa0d533f65d2bbd457446fef5bd8fe Mon Sep 17 00:00:00 2001 From: Per Nilsson Date: Fri, 4 Mar 2022 10:23:14 +0100 Subject: [PATCH] Consolidate slot buffer size --- common/ecdh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/ecdh.c b/common/ecdh.c index 66ca9c9b..cab93ce7 100644 --- a/common/ecdh.c +++ b/common/ecdh.c @@ -1619,8 +1619,8 @@ int ecdh_load_module(const char *module, FILE *out) { int ecdh_list_providers(void *ctx, int (*callback)(void *ctx, const char *key)) { - CK_SLOT_ID slot[128] = {0}; - CK_ULONG slots = 128; + CK_SLOT_ID slot[64] = {0}; + CK_ULONG slots = sizeof(slot) / sizeof(slot[0]); CK_RV rv = p11->C_GetSlotList(CK_TRUE, slot, &slots); if (rv) { return 0; @@ -1645,7 +1645,7 @@ struct p11_ctx { static CK_RV p11_list_keys(int curve, struct p11_ctx *ctx, int (*callback)(void *ctx, const char *key)) { - CK_SLOT_ID slot[256] = {0}; + CK_SLOT_ID slot[64] = {0}; CK_ULONG slots = sizeof(slot) / sizeof(slot[0]); CK_RV rv = p11->C_GetSlotList(CK_TRUE, slot, &slots); if (rv) {