Skip to content

Commit

Permalink
Merge pull request #13 from Indicio-tech/fix/apv-hashing
Browse files Browse the repository at this point in the history
fix: Hash the APV
  • Loading branch information
dbluhm authored Nov 7, 2023
2 parents 7823ed2 + b9408eb commit 7919be4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion didcomm_messaging/crypto/askar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from collections import OrderedDict
import json
from typing import Optional, Sequence, Union
import hashlib

from pydid import VerificationMethod
from didcomm_messaging.crypto import SecretsManager
Expand Down Expand Up @@ -323,7 +324,7 @@ async def ecdh_1pu_encrypt(
agree_alg = recip_key.key.algorithm
apv.append(recip_key.kid)
apv.sort()
apv = b64url(".".join(apv))
apv = b64url(hashlib.sha256((".".join(apv)).encode()).digest())

builder.set_protected(
OrderedDict(
Expand Down

0 comments on commit 7919be4

Please sign in to comment.