Skip to content

Commit

Permalink
tpm2-provider: remove unnecessary condition
Browse files Browse the repository at this point in the history
Fixes: #90
  • Loading branch information
gotthardp committed Oct 9, 2023
1 parent de9ed8e commit 8f1a285
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tpm2-provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ typedef struct {

static const OSSL_ALGORITHM *
tpm2_operation(const TPM2_CAPABILITY *caps,
const TPM2_ALGORITHM *algs, size_t count)
const TPM2_ALGORITHM *algs, size_t algs_size)
{
OSSL_ALGORITHM *res;
int i, j = 0;

if ((res = OPENSSL_malloc(count * sizeof(OSSL_ALGORITHM))) == NULL)
if ((res = OPENSSL_malloc(algs_size * sizeof(OSSL_ALGORITHM))) == NULL)
return NULL;

for (i = 0; i < count && algs[i].algs != NULL; i++) {
for (i = 0; algs[i].algs != NULL; i++) {
/* retrieve the implementation,
* or NULL when the current TPM does not support this algorithm */
if ((res[j].implementation = algs[i].dispatch(caps)) == NULL)
Expand Down

0 comments on commit 8f1a285

Please sign in to comment.