diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-08-25 04:11:17 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-08-25 05:40:00 +0800 |
commit | 1932aff35c6b07093534cde66dec63c5f919fcf0 (patch) | |
tree | fa886f0d47c46ddf27b85d920a6f719ba26256ba /packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol | |
parent | 4f27991959ba6e4e15839e6195a40b0fd8a2122c (diff) | |
download | dexon-sol-tools-1932aff35c6b07093534cde66dec63c5f919fcf0.tar.gz dexon-sol-tools-1932aff35c6b07093534cde66dec63c5f919fcf0.tar.zst dexon-sol-tools-1932aff35c6b07093534cde66dec63c5f919fcf0.zip |
Remove Trezor SignatureType
Diffstat (limited to 'packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol index 401fdd377..f30adcdb8 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol @@ -211,34 +211,6 @@ contract MixinSignatureValidator is } else if (signatureType == SignatureType.PreSigned) { isValid = preSigned[hash][signerAddress]; return isValid; - - // Signature from Trezor hardware wallet. - // It differs from web3.eth_sign in the encoding of message length - // (Bitcoin varint encoding vs ascii-decimal, the latter is not - // self-terminating which leads to ambiguities). - // See also: - // https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer - // https://github.com/trezor/trezor-mcu/blob/master/firmware/ethereum.c#L602 - // https://github.com/trezor/trezor-mcu/blob/master/firmware/crypto.c#L36 - } else if (signatureType == SignatureType.Trezor) { - require( - signature.length == 65, - "LENGTH_65_REQUIRED" - ); - v = uint8(signature[0]); - r = signature.readBytes32(1); - s = signature.readBytes32(33); - recovered = ecrecover( - keccak256(abi.encodePacked( - "\x19Ethereum Signed Message:\n\x20", - hash - )), - v, - r, - s - ); - isValid = signerAddress == recovered; - return isValid; } // Anything else is illegal (We do not return false because |