Skip to content

Commit

Permalink
Consolidate slot buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
qpernil committed Mar 4, 2022
1 parent 8757742 commit a41b34d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit a41b34d

Please sign in to comment.