use big endian, a more standard interpretation
parent
d175acecd6
commit
92fb1016d8
|
@ -89,7 +89,7 @@ contract CryptoCTF10 {
|
||||||
require(contests[contestID].players[msg.sender].status == PlayerStatus.Verified, "You are unverified or banned in this contest");
|
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;
|
// 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
|
// (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 != address(0), "Invalid signature");
|
||||||
require(recoveredSigner == contests[contestID].challenges[challengeID].obscuredFlag, "Wrong answer");
|
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");
|
require(!contests[contestID].solves[msg.sender][challengeID], "You have already solved this challenge of this contest");
|
||||||
|
|
Loading…
Reference in New Issue