Skip to content

Commit

Permalink
Revert "chore: disable sig verification"
Browse files Browse the repository at this point in the history
This reverts commit 97b91bc.
  • Loading branch information
lklimek committed Sep 2, 2024
1 parent 6e2d36f commit 743a62e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions crypto/bls12381/bls12381.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ func (pubKey PubKey) Bytes() []byte {
}

func (pubKey PubKey) VerifySignatureDigest(hash []byte, sig []byte) bool {
return true
// make sure we use the same algorithm to sign
if len(sig) == 0 {
// fmt.Printf("bls verifying error (signature empty) from message %X with key %X\n", msg, pubKey.Bytes())
Expand All @@ -314,7 +313,6 @@ func (pubKey PubKey) VerifySignatureDigest(hash []byte, sig []byte) bool {
}

func (pubKey PubKey) VerifySignature(msg []byte, sig []byte) bool {
return true
// make sure we use the same algorithm to sign
if len(sig) == 0 {
// fmt.Printf("bls verifying error (signature empty) from message %X with key %X\n", msg, pubKey.Bytes())
Expand Down
16 changes: 8 additions & 8 deletions privval/dash_core_signer_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,14 @@ func (sc *DashCoreSignerClient) quorumSignAndVerify(
"raw", hex.EncodeToString(signItem.Msg),
"hash", hex.EncodeToString(signItem.MsgHash),
"quorum_sign_result", *qs.QuorumSignResult)
// pubKey, err := sc.GetPubKey(ctx, quorumHash)
// if err != nil {
// return nil, &RemoteSignerError{Code: 500, Description: err.Error()}
// }
// verified := pubKey.VerifySignatureDigest(signItem.SignHash, qs.sign)
// if !verified {
// return nil, fmt.Errorf("unable to verify signature with pubkey %s", pubKey.String())
// }
pubKey, err := sc.GetPubKey(ctx, quorumHash)
if err != nil {
return nil, &RemoteSignerError{Code: 500, Description: err.Error()}
}
verified := pubKey.VerifySignatureDigest(signItem.SignHash, qs.sign)
if !verified {
return nil, fmt.Errorf("unable to verify signature with pubkey %s", pubKey.String())
}
return qs, nil
}

Expand Down

0 comments on commit 743a62e

Please sign in to comment.