News for hackers. Stuff that matters.
Re:Practical Cryptography With Go by ctz on Sunday April 13, 2014 @01:37PM (#7582039)
You're right, and it's by-the-by; I missed that decrypt() had moved on to CTR in that code.

If it had been CBC with ISO7816 or PKCS#5 padding then I do think this would be attackable. The unpadding errors from decrypt trump the MAC error thanks to the "err == nil && !match" expression.

Re:Practical Cryptography With Go by tptacek on Sunday April 13, 2014 @01:43PM (#7582063)
Fortunately, it's not giving a distinctive error, and always runs both the MAC and the decryption so timing won't distinguish, either. The big problem with this pattern is how disastrous it is in every other language (coupled with the lack of any rationale for decrypting on MAC failure).