MCPcopy Create free account
hub / github.com/NextDotID/proof_server / validateBody

Method validateBody

validator/keybase/keybase.go:119–131  ·  view source on GitHub ↗
(payload *KeybasePayload)

Source from the content-addressed store, hash-verified

117}
118
119func (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}

Callers 1

ValidateMethod · 0.95

Calls 1

DecodeStringFunction · 0.92

Tested by

no test coverage detected