fix: strip key type prefix

This commit is contained in:
Derrick Hammer 2024-03-01 01:49:00 -05:00
parent 258031cb8f
commit 280e5b1d71
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 5 deletions

View File

@ -103,11 +103,10 @@ func (m *MediaMetadata) decodeProof(dec *msgpack.Decoder) error {
return err
}
var hashType int8
var pubkey []byte
var signature []byte
for j := 0; j < len(proofData); j++ {
var hashType int8
var pubkey []byte
var signature []byte
switch j {
case 0:
@ -134,7 +133,7 @@ func (m *MediaMetadata) decodeProof(dec *msgpack.Decoder) error {
case 3:
signature = proofData[j].([]byte)
if valid := ed25519.Verify(pubkey, b3hash[:], signature); !valid {
if valid := ed25519.Verify(pubkey[1:], b3hash[:], signature); !valid {
return errors.New("Invalid signature")
}