wasi-crypto: forgot to erase ctx indirection
This commit is contained in:
@@ -8,7 +8,7 @@ impl super::wasi_ephemeral_crypto_kx::WasiEphemeralCryptoKx for WasiCryptoCtx {
|
||||
pk_handle: guest_types::Publickey,
|
||||
sk_handle: guest_types::Secretkey,
|
||||
) -> Result<guest_types::ArrayOutput, guest_types::CryptoErrno> {
|
||||
Ok(self.ctx.kx_dh(pk_handle.into(), sk_handle.into())?.into())
|
||||
Ok(self.kx_dh(pk_handle.into(), sk_handle.into())?.into())
|
||||
}
|
||||
|
||||
// --- Key encapsulation
|
||||
@@ -18,8 +18,7 @@ impl super::wasi_ephemeral_crypto_kx::WasiEphemeralCryptoKx for WasiCryptoCtx {
|
||||
pk_handle: guest_types::Publickey,
|
||||
) -> Result<(guest_types::ArrayOutput, guest_types::ArrayOutput), guest_types::CryptoErrno>
|
||||
{
|
||||
let (secret_handle, encapsulated_secret_handle) =
|
||||
self.ctx.kx_encapsulate(pk_handle.into())?;
|
||||
let (secret_handle, encapsulated_secret_handle) = self.kx_encapsulate(pk_handle.into())?;
|
||||
Ok((secret_handle.into(), encapsulated_secret_handle.into()))
|
||||
}
|
||||
|
||||
@@ -33,7 +32,6 @@ impl super::wasi_ephemeral_crypto_kx::WasiEphemeralCryptoKx for WasiCryptoCtx {
|
||||
.as_array(encapsulated_secret_len)
|
||||
.as_slice()?;
|
||||
Ok(self
|
||||
.ctx
|
||||
.kx_decapsulate(sk_handle.into(), encapsulated_secret)?
|
||||
.into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user