]> git.ipfire.org Git - thirdparty/libarchive.git/commit
archive_digest: Use correct providers with Windows Crypto 1724/head
authorDavid Macek <david.macek.0@gmail.com>
Sun, 17 Apr 2022 17:52:25 +0000 (19:52 +0200)
committerDavid Macek <david.macek.0@gmail.com>
Sun, 17 Apr 2022 17:52:25 +0000 (19:52 +0200)
commitb55a9d14721832ae9f03746836ca24a230c5c2f1
tree2a996b4e8d317232bffab5922d1f7c2c1b5c8ab4
parentb1aa465b21fce2e4a0108360ba9b19e1e1aff02b
archive_digest: Use correct providers with Windows Crypto

Trying to use SHA256, SHA384 or SHA512 with mtree when linked against
Windows Crypto would result in silent failure.  The call to
`CryptCreateHash` would fail with 0x80090008.  The docs[1] say that
these algorithms require a different crypto provider, so let's make
that a parameter for `win_crypto_init` and choose at the call site along
with the algorithm.

[1] https://docs.microsoft.com/en-us/windows/win32/seccrypto/alg-id

Signed-off-by: David Macek <david.macek.0@gmail.com>
libarchive/archive_digest.c