You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The EVP_PKEY_derive() derives a shared secret using ctx. If key is NULL then the maximum size of the output buffer is written to the keylen parameter. If key is not NULL then before the call the keylen parameter should contain the length of the key buffer, if the call is successful the shared secret is written to key and the amount of data written to keylen.
ensureOrReturn(KeyLen == getKeySize(), __WASI_CRYPTO_ERRNO_ALGORITHM_FAILURE); is unnecessary in this case, which KeyLen won't be updated.
Description
WasmEdge/plugins/wasi_crypto/symmetric/kdf.cpp
Lines 61 to 74 in 5332b8f
As https://www.openssl.org/docs/man1.1.1/man3/EVP_PKEY_derive.html read,
ensureOrReturn(KeyLen == getKeySize(), __WASI_CRYPTO_ERRNO_ALGORITHM_FAILURE);
is unnecessary in this case, whichKeyLen
won't be updated.Additionly, as wasi-crypto proposal read,
But
getKeySize()
will only return 32 or 64 , so it can't meet proposal.WasmEdge/plugins/wasi_crypto/symmetric/kdf.cpp
Lines 18 to 25 in 5332b8f
Current State
Expected
Environment
Steps to Reproduce
wasi binding use https://github.com/WebAssembly/wasi-crypto/blob/main/implementations/bindings/rust/src/raw.rs
It will cause
WASI_CRYPTO_ERRNO_ALGORITHM_FAILURE
on lastsymmetric_state_squeeze
.The text was updated successfully, but these errors were encountered: