Skip to content

Commit

Permalink
digest: add 'xof' and 'algid-absent' parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
gotthardp committed Oct 29, 2023
1 parent 0835fe6 commit a25545d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tpm2-provider-digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ tpm2_digest_gettable_params(void *provctx)
static const OSSL_PARAM known_gettable_params[] = {
OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, NULL),
OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
OSSL_PARAM_int(OSSL_DIGEST_PARAM_XOF, NULL),
OSSL_PARAM_int(OSSL_DIGEST_PARAM_ALGID_ABSENT, NULL),
OSSL_PARAM_END
};
return known_gettable_params;
Expand All @@ -329,6 +331,15 @@ tpm2_digest_get_params_int(OSSL_PARAM params[], size_t block, size_t size)
if (p != NULL && !OSSL_PARAM_set_size_t(p, size))
return 0;

/* OSSL_DIGEST_PARAM_XOFLEN is never supported */
p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_XOF);
if (p != NULL && !OSSL_PARAM_set_int(p, 0))
return 0;

p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_ALGID_ABSENT);
if (p != NULL && !OSSL_PARAM_set_int(p, 0))
return 0;

return 1;
}

Expand Down

0 comments on commit a25545d

Please sign in to comment.