(payload *KeybasePayload)
| 117 | } |
| 118 | |
| 119 | func (kb *Keybase) validateBody(payload *KeybasePayload) error { |
| 120 | if payload.Persona != ("0x" + mycrypto.CompressedPubkeyHex(kb.Pubkey)) { |
| 121 | return xerrors.Errorf("Persona mismatch") |
| 122 | } |
| 123 | |
| 124 | sig_bytes, err := util.DecodeString(payload.Signature) |
| 125 | if err != nil { |
| 126 | return xerrors.Errorf("error when decoding sig: %w", err) |
| 127 | } |
| 128 | |
| 129 | kb.Signature = sig_bytes |
| 130 | return mycrypto.ValidatePersonalSignature(kb.SignaturePayload, sig_bytes, kb.Pubkey) |
| 131 | } |
no test coverage detected