From 92fb1016d8a319dca64409f8376e23ca6faea6f4 Mon Sep 17 00:00:00 2001 From: SI Date: Sun, 20 Aug 2023 01:16:10 +0000 Subject: [PATCH] use big endian, a more standard interpretation --- cryptoctf.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptoctf.sol b/cryptoctf.sol index 2aaa33b..00f4717 100644 --- a/cryptoctf.sol +++ b/cryptoctf.sol @@ -89,7 +89,7 @@ contract CryptoCTF10 { require(contests[contestID].players[msg.sender].status == PlayerStatus.Verified, "You are unverified or banned in this contest"); // the correct signature is an ECDSA signature where (1) the message (hash) is the sender address and (2) the private key is the flag; // (2) is checked by testing against the public key, which can then be public information - address recoveredSigner = recoverSigner(bytes32(abi.encodePacked(msg.sender)), signature); + address recoveredSigner = recoverSigner(bytes32(uint256(uint160(msg.sender))), signature); require(recoveredSigner != address(0), "Invalid signature"); require(recoveredSigner == contests[contestID].challenges[challengeID].obscuredFlag, "Wrong answer"); require(!contests[contestID].solves[msg.sender][challengeID], "You have already solved this challenge of this contest");