Skip to content

Commit b82780f

Browse files
committedJul 16, 2021
handle unpadded protected header
Signed-off-by: Andrew Whitehead <[email protected]>
1 parent a58d7ba commit b82780f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎aries_cloudagent/transport/pack_format.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Standard packed message format classes."""
22

3-
from base64 import b64decode
43
import json
54
import logging
65
from typing import List, Sequence, Tuple, Union
@@ -13,6 +12,7 @@
1312
from ..utils.task_queue import TaskQueue
1413
from ..wallet.base import BaseWallet
1514
from ..wallet.error import WalletError
15+
from ..wallet.util import b64_to_str
1616

1717
from .error import WireFormatParseError, WireFormatEncodeError, RecipientKeysError
1818
from .inbound.receipt import MessageReceipt
@@ -211,7 +211,7 @@ def get_recipient_keys(self, message_body: Union[str, bytes]) -> List[str]:
211211

212212
try:
213213
message_dict = json.loads(message_body)
214-
protected = json.loads(b64decode(message_dict["protected"]))
214+
protected = json.loads(b64_to_str(message_dict["protected"], urlsafe=True))
215215
recipients = protected["recipients"]
216216

217217
recipient_keys = [recipient["header"]["kid"] for recipient in recipients]

0 commit comments

Comments
 (0)