mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-25 16:15:17 +00:00
fix: openssl-specific verification of digest
This commit is contained in:
parent
048b6459c3
commit
22e9398dd6
@ -102,6 +102,7 @@ type Signature struct {
|
||||
PublicKeyHex string `json:"publicKeyHex"`
|
||||
SignatureHex string `json:"signatureHex"`
|
||||
}
|
||||
|
||||
type SignedGenesisUnlock struct {
|
||||
GenesisSeedHex string `json:"genesisSeedHex"`
|
||||
Signatures []Signature `json:"signatures"`
|
||||
@ -167,7 +168,7 @@ func DownloadAndVerifyGenesis() (*SignedGenesisUnlock, error) {
|
||||
checksig := ""
|
||||
for _, sig := range checkUnlock.Signatures {
|
||||
if sig.PublicKeyHex == Signatories[i-1] {
|
||||
checksig = sig.PublicKeyHex
|
||||
checksig = sig.SignatureHex
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -176,12 +177,13 @@ func DownloadAndVerifyGenesis() (*SignedGenesisUnlock, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
sig, err := hex.DecodeString(Signatories[i-1])
|
||||
sig, err := hex.DecodeString(checksig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !ed448.Verify(pubkey, digest[:], sig, "") {
|
||||
opensslMsg := "SHA3-256(genesis)= " + hex.EncodeToString(digest[:])
|
||||
if !ed448.Verify(pubkey, append([]byte(opensslMsg), 0x0a), sig, "") {
|
||||
fmt.Printf("Failed signature check for signatory #%d\n", i)
|
||||
return nil, err
|
||||
}
|
||||
|
@ -36,5 +36,5 @@ func FormatVersion(version []byte) string {
|
||||
}
|
||||
|
||||
func GetPatchNumber() byte {
|
||||
return 0x03
|
||||
return 0x04
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user