Skip to content

Commit

Permalink
Merge pull request #21 from Indicio-tech/fix/didcomm-fixes
Browse files Browse the repository at this point in the history
Fix communication problems with the Indicio mediator
  • Loading branch information
dbluhm authored Dec 18, 2023
2 parents 0c25e9a + cb7b848 commit 8a4472b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions didcomm_messaging/crypto/backend/askar.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ async def ecdh_1pu_encrypt(
builder.set_protected(
OrderedDict(
[
("typ", "application/didcomm+encrypted"),
("alg", alg_id),
("enc", enc_id),
("apu", b64url(apu)),
Expand Down
8 changes: 6 additions & 2 deletions didcomm_messaging/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ async def prepare_forward(

# Grab our target to pack the initial message to, then pack the message
# for the DID target
next_target = chain.pop(0)["did"]
final_destination = chain.pop(0)
next_target = final_destination["did"]
packed_message = encoded_message

# Loop through the entire services chain and pack the message for each
Expand All @@ -130,4 +131,7 @@ async def prepare_forward(

# Return the forward-packed message as well as the last service in the
# chain, which is the destination of the top-level forward message.
return (packed_message, chain[-1]["service"])
service = final_destination["service"]
if len(chain):
service = chain[-1]["service"]
return (packed_message, service)
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ ignore = [

line-length = 90

extend-exclude = ["example*.py"]

[tool.ruff.per-file-ignores]
"**/{tests}/*" = ["F841", "D", "E501"]

Expand Down

0 comments on commit 8a4472b

Please sign in to comment.