Skip to content

Commit 8a4472b

Browse files
authored
Merge pull request #21 from Indicio-tech/fix/didcomm-fixes
Fix communication problems with the Indicio mediator
2 parents 0c25e9a + cb7b848 commit 8a4472b

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

didcomm_messaging/crypto/backend/askar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ async def ecdh_1pu_encrypt(
306306
builder.set_protected(
307307
OrderedDict(
308308
[
309+
("typ", "application/didcomm+encrypted"),
309310
("alg", alg_id),
310311
("enc", enc_id),
311312
("apu", b64url(apu)),

didcomm_messaging/routing.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ async def prepare_forward(
105105

106106
# Grab our target to pack the initial message to, then pack the message
107107
# for the DID target
108-
next_target = chain.pop(0)["did"]
108+
final_destination = chain.pop(0)
109+
next_target = final_destination["did"]
109110
packed_message = encoded_message
110111

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

131132
# Return the forward-packed message as well as the last service in the
132133
# chain, which is the destination of the top-level forward message.
133-
return (packed_message, chain[-1]["service"])
134+
service = final_destination["service"]
135+
if len(chain):
136+
service = chain[-1]["service"]
137+
return (packed_message, service)

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ ignore = [
4747

4848
line-length = 90
4949

50+
extend-exclude = ["example*.py"]
51+
5052
[tool.ruff.per-file-ignores]
5153
"**/{tests}/*" = ["F841", "D", "E501"]
5254

0 commit comments

Comments
 (0)