ds-guard icon indicating copy to clipboard operation
ds-guard copied to clipboard

sig collision?

Open nmushegian opened this issue 7 years ago • 2 comments

Looks like ANY trick is fine for src/dest, but is there some fuckery that could happen with a malicious function signature bytes4(uint32(-1))? @dbrock

nmushegian avatar Mar 07 '17 17:03 nmushegian

I think not because I use bytes32 for precisely this reason, such that in case of a would-be collision we would be still comparing these distinct values:

0xffffffff00000000000000000000000000000000000000000000000000000000 # sig 
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff # ANY

dbrock avatar Mar 08 '17 14:03 dbrock

Nice, I think that works as long as the previous bug where it wouldn't zero your bytes <32 args (because args are word aligned) isn't accidentally reverted with the loosey goosey solidity reference implentation

nmushegian avatar Mar 08 '17 20:03 nmushegian