cryptsetup - fix buffer overflow
authorAlex Hornung <ahornung@gmail.com>
Sat, 14 Aug 2010 22:01:47 +0000 (23:01 +0100)
committerAlex Hornung <ahornung@gmail.com>
Sat, 14 Aug 2010 22:05:00 +0000 (23:05 +0100)
commit9b5950612f254d98d48b91158b7648d6cc48dad1
tree7997e07db2a0e9ec0411eb7213d484ebb45f5b6a
parent7422a208aa67ba967ce1b3dcb7fb2da3df53e040
cryptsetup - fix buffer overflow

* fix a buffer overflow introduced during the porting. Linux originally
  did digest = gcry_md_read(hd, hash_id); memcpy(dst, digest, len);
  I ported that to do EVP_DigestFinal directly into dst, causing
  corruption. Avoid this by writing to some intermediate (large) buffer
  and then using memcpy like Linux does.
contrib/cryptsetup/luks/af.c