Skip to content

Commit

Permalink
modified clientSpec check to do JSON-singing only for BabyJubJubSigna…
Browse files Browse the repository at this point in the history
…ture2023 signed document
  • Loading branch information
arnabghose997 committed Nov 13, 2023
1 parent 0c4abb1 commit d10e2ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/ssi/verification/client_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func getPersonalSignSpecDocBytes(ssiMsg types.SsiMsg) ([]byte, error) {
func getDocBytesByClientSpec(ssiMsg types.SsiMsg, extendedVm *types.ExtendedVerificationMethod) ([]byte, error) {
switch extendedVm.Proof.ClientSpecType {
case types.CLIENT_SPEC_TYPE_NONE:
if didDoc, ok := ssiMsg.(*types.DidDocument); ok && len(didDoc.Context) == 0 {
if extendedVm.Proof.Type == types.BabyJubJubSignature2023 {
return ssiMsg.GetSignBytes(), nil
}

Expand All @@ -67,7 +67,7 @@ func getDocBytesByClientSpec(ssiMsg types.SsiMsg, extendedVm *types.ExtendedVeri
return nil, err
}

if didDoc, ok := ssiMsg.(*types.DidDocument); ok && len(didDoc.Context) == 0 {
if extendedVm.Proof.Type == types.BabyJubJubSignature2023 {
return getCosmosADR036SignDocBytes(ssiMsg.GetSignBytes(), signerAddress)
}

Expand All @@ -79,7 +79,7 @@ func getDocBytesByClientSpec(ssiMsg types.SsiMsg, extendedVm *types.ExtendedVeri
return getCosmosADR036SignDocBytes(canonizedDidDocHash, signerAddress)

case types.CLIENT_SPEC_TYPE_ETH_PERSONAL_SIGN:
if didDoc, ok := ssiMsg.(*types.DidDocument); ok && len(didDoc.Context) == 0 {
if extendedVm.Proof.Type == types.BabyJubJubSignature2023 {
return getPersonalSignSpecDocBytes(ssiMsg)
}

Expand Down

0 comments on commit d10e2ae

Please sign in to comment.