НС
Size: a a a
НС
n
q
НС
q
Fix commit: 512c0c75276949f13b6373b5c04f7065af750b08Если я правильно все понял:
hash-common: fix heap overflow when writing more data after final
* tests/basic.c (check_one_md): Test writing to digest after read.
* cipher/hash-common.c (_gcry_md_block_write): Reset 'hd->count' if
greater than blocksize.
--
'_gcry_md_block_write' did not expect 'hd->count' being greater than
digest blocksize. However digest final function may set 'hd->count'
to larger value. Now, if write is called after final function and
'hd->count' gets too large value, 'copylen' parameter to buf_cpy
may have value larger than size of 'hd->buf' and cause heap overflow.
+ if (hd->count > blocksize)
+ {
+ /* This happens only when gcry_md_write is called after final.
+ * Writing after final is used for mitigating timing attacks. */
+ hd->count = 0;
+ }
q
НС
B
НС
Fix commit: 512c0c75276949f13b6373b5c04f7065af750b08Если я правильно все понял:
hash-common: fix heap overflow when writing more data after final
* tests/basic.c (check_one_md): Test writing to digest after read.
* cipher/hash-common.c (_gcry_md_block_write): Reset 'hd->count' if
greater than blocksize.
--
'_gcry_md_block_write' did not expect 'hd->count' being greater than
digest blocksize. However digest final function may set 'hd->count'
to larger value. Now, if write is called after final function and
'hd->count' gets too large value, 'copylen' parameter to buf_cpy
may have value larger than size of 'hd->buf' and cause heap overflow.
+ if (hd->count > blocksize)
+ {
+ /* This happens only when gcry_md_write is called after final.
+ * Writing after final is used for mitigating timing attacks. */
+ hd->count = 0;
+ }
q
MG
q
M
MM
MG
MG
q
S
Юd