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:
parent
cf65a6e208
commit
27ef7e77c0
1 changed files with 2 additions and 1 deletions
|
@ -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")?;
|
||||
|
|
Loading…
Reference in a new issue