Exemplo n.º 1
0
func Fuzz(data []byte) int {
	skey, _, err := saltpack.Verify(data, keyring{key})
	if err != nil {
		// errors are ok
		return 0
	}
	// if no error, check that the returned key matches
	if !saltpack.KIDEqual(key, skey) {
		panic("verifier key doesn't match signer key")
	}

	return 1
}
Exemplo n.º 2
0
func Fuzz(data []byte) int {
	smsg, err := saltpack.Sign(data, &key)
	if err != nil {
		panic(err)
	}
	skey, vmsg, err := saltpack.Verify(smsg, keyring{&key})
	if err != nil {
		panic(err)
	}
	if !bytes.Equal(vmsg, data) {
		panic("message mismatch")
	}
	if !saltpack.KIDEqual(key.PublicKey(), skey) {
		panic("verifier key doesn't match signer key")
	}

	return 0
}