Just ignore the alg parameter

Right now, this must be Dir in order to not crash, but after [1] gets
merged, it will have to be A256GCM.
Since we know the algorithm, let's just ignore it.

[1]: https://github.com/hidekatsu-izuno/josekit-rs/pull/12
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
Patrick Uiterwijk 2021-12-08 15:28:17 +01:00
parent cf65a6e208
commit 27ef7e77c0
No known key found for this signature in database
GPG key ID: A0A847B80FBBFF4A

View file

@ -216,7 +216,8 @@ fn perform_decrypt(input: Vec<u8>) -> Result<()> {
let unsealed = ctx.execute_with_session(policy_session, |ctx| ctx.unseal(key.into()))?;
let unsealed = &unsealed.value();
let mut jwk = josekit::jwk::Jwk::from_bytes(unsealed).context("Error unmarshaling JWK")?;
jwk.set_algorithm(Dir.name());
jwk.set_parameter("alg", None)
.context("Error removing the alg parameter")?;
let decrypter = Dir
.decrypter_from_jwk(&jwk)
.context("Error creating decrypter")?;