summaryrefslogtreecommitdiff
path: root/test/dm/hash.c
AgeCommit message (Collapse)Author
9 daystest: dm: hash: check digest size before memsetJames Hilliard
hash_algo_digest_size() returns -EINVAL for an invalid algorithm. The test success provider passes that result directly to memset(), where it is converted to a large size_t. Return the error before touching the output buffer, and exercise the invalid-algorithm path in the provider-selection test. This addresses Coverity CIDs 652907 and 652908. Fixes: 94b349bd902d ("crypto: hash: use DM providers from hash command") Signed-off-by: James Hilliard <[email protected]>
2026-07-29crypto: hash: use DM providers from hash commandJames Hilliard
The hash command currently always uses the software implementation for the selected algorithm, even when driver-model hash providers are available. Add a hash_digest_wd_lookup() helper which probes UCLASS_HASH devices in order and uses the first provider supporting the requested algorithm. Continue past unavailable providers and unsupported operations, but propagate a hard digest failure once a provider accepts the operation. Remember probe failures so they are not silently hidden by software fallback when no later provider succeeds. Use the helper from the hash command and retain its software fallback when no usable provider is present. Add sandbox tests covering provider fallback and hard-error propagation. Signed-off-by: James Hilliard <[email protected]>