Skip to content

Commit

Permalink
Add additional cryptographic data to "cloneCreds" (WebOfTrust#624)
Browse files Browse the repository at this point in the history
Signed-off-by: pfeairheller <[email protected]>
  • Loading branch information
pfeairheller authored Dec 6, 2023
1 parent e44e4e6 commit f3acf6a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/keri/app/cli/common/existing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ def setupHby(name, base="", bran=None, cf=None):
retries += 1
hby = habbing.Habery(name=name, base=base, bran=bran, cf=cf, free=True)
break
except (kering.AuthError, ValueError) as e:
raise e

except (kering.AuthError, ValueError):
if retries >= 3:
raise kering.AuthError("too many attempts")
print("Valid passcode required, try again...")
Expand Down
27 changes: 27 additions & 0 deletions src/keri/vdr/viring.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ..app import signing
from ..core import coring, serdering
from ..db import dbing, basing
from ..db.dbing import snKey
from ..help import helping
from ..vc import proving
from ..vdr import eventing
Expand Down Expand Up @@ -398,6 +399,14 @@ def cloneCreds(self, saids, db):
for saider in saids:
key = saider.qb64
creder, prefixer, seqner, asaider = self.cloneCred(said=key)
atc = bytearray(signing.serialize(creder, prefixer, seqner, saider))
del atc[0:creder.size]

iss = bytearray(self.cloneTvtAt(pre=prefixer.qb64, sn=seqner.sn))
iserder = serdering.SerderKERI(raw=iss)
issatc = bytes(iss[iserder.size:])

del iss[0:iserder.size]

chainSaids = []
for k, p in creder.edge.items():
Expand All @@ -416,6 +425,9 @@ def cloneCreds(self, saids, db):

cred = dict(
sad=creder.sad,
atc=atc.decode("utf-8"),
iss=iserder.sad,
issatc=issatc.decode("utf-8"),
pre=creder.issuer,
schema=schemer.sed,
chains=chains,
Expand All @@ -427,7 +439,22 @@ def cloneCreds(self, saids, db):
)
)

ctr = coring.Counter(qb64b=iss, strip=True)
if ctr.code == coring.CtrDex.AttachedMaterialQuadlets:
ctr = coring.Counter(qb64b=iss, strip=True)

if ctr.code == coring.CtrDex.SealSourceCouples:
coring.Seqner(qb64b=iss, strip=True)
saider = coring.Saider(qb64b=iss)

anc = db.cloneEvtMsg(pre=creder.issuer, fn=0, dig=saider.qb64b)
aserder = serdering.SerderKERI(raw=anc)
ancatc = bytes(anc[aserder.size:])
cred['anc'] = aserder.sad
cred['ancatc'] = ancatc.decode("utf-8"),

creds.append(cred)

return creds

def logCred(self, creder, prefixer, seqner, saider):
Expand Down

0 comments on commit f3acf6a

Please sign in to comment.