Skip to content

Commit

Permalink
Eliminate requirement to use wolfPKCS11_Store_OpenSz unless buildin…
Browse files Browse the repository at this point in the history
…g with `WOLFPKCS11_TPM_STORE`.
  • Loading branch information
dgarske committed Jan 2, 2025
1 parent aa0fd6d commit 5c46715
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ int wolfPKCS11_Store_Write(void* store, unsigned char* buffer, int len)
static int wp11_storage_open_readonly(int type, CK_ULONG id1, CK_ULONG id2,
void** storage)
{
return wolfPKCS11_Store_OpenSz(type, id1, id2, 1, 0, storage);
return wolfPKCS11_Store_Open(type, id1, id2, 1, storage);
}

/*
Expand All @@ -1096,7 +1096,12 @@ static int wp11_storage_open_readonly(int type, CK_ULONG id1, CK_ULONG id2,
static int wp11_storage_open(int type, CK_ULONG id1, CK_ULONG id2,
int variableSz, void** storage)
{
#ifdef WOLFPKCS11_TPM_STORE
return wolfPKCS11_Store_OpenSz(type, id1, id2, 0, variableSz, storage);
#else
(void)variableSz; /* not used */
return wolfPKCS11_Store_Open(type, id1, id2, 0, storage);
#endif
}

/*
Expand Down

0 comments on commit 5c46715

Please sign in to comment.