wasi-crypto: forgot to erase ctx indirection

This commit is contained in:
Pat Hickey
2021-01-29 19:52:26 -08:00
parent 6ed8638559
commit b5f3a4a6db
6 changed files with 36 additions and 102 deletions

View File

@@ -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())
}