Skip to content

Commit 7644755

Browse files
committed
Fix test
1 parent 967727a commit 7644755

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_07_jwe.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,12 @@ def test_ecdh_encrypt_decrypt_direct_key():
446446
def test_ecdh_encrypt_decrypt_direct_key_wo_apu_apv():
447447
# Alice starts of
448448
jwenc = JWE_EC(plain, alg="ECDH-ES", enc="A128GCM")
449-
cek, encrypted_key, iv, params, ret_epk = jwenc.enc_setup(plain, key=eck_bob, apu=b"", apv=b"")
450449

451-
# Remove agreement information about sending and receiving parties
452-
del params["apv"]
453-
del params["apu"]
450+
# Don't supply agreement party information.
451+
cek, encrypted_key, iv, params, ret_epk = jwenc.enc_setup(plain, key=eck_bob, apu=b"", apv=b"")
452+
# Assert they are not randomized
453+
assert params["apv"] == b""
454+
assert params["apu"] == b""
454455

455456
kwargs = {"params": params, "cek": cek, "iv": iv, "encrypted_key": encrypted_key}
456457
jwt = jwenc.encrypt(**kwargs)

0 commit comments

Comments
 (0)