On the Bitcoin Wiki's OP_CHECKSIG documentation:
Firstly always this (the default) procedure is applied:
- the public key and the signature are popped from the stack, in that order. If the hash-type value is 0, then it is replaced by the last_byte of the signature. Then the last byte of the signature is always deleted.
The signature format is:
0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]
In case if hash type is 0 then we should get last byte from [S] and remove it I think it will corrupt signature!
Maybe I don't correctly understand this documentation. Could anybody explain the correct behavior in this case?