format the msg parameter to Ecrecover so it has 32 bytes

This commit is contained in:
Tim Williams 2018-06-30 16:45:03 -04:00
parent 9f2d6ee3fc
commit 0cbeb26f93

View file

@ -59,7 +59,8 @@ func handleRequest(conn net.Conn) {
// and the bytes array of the signature
var msg = []byte(dat["msg"].(string))
var sig = []byte(dat["sig"].(string))
var address, err = crypto.Ecrecover(msg, sig)
new_msg := crypto.Keccak256(msg)
var address, err = crypto.Ecrecover(new_msg, sig)
if err != nil {
fmt.Println("The error is ")
fmt.Println(err)