浏览代码

Merge pull request #55 from philsmd/master

issue #54: fixed memory issue with some unicode algorithms
Jens Steube 10 年之前
父节点
当前提交
afc595d389
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 5 0
      docs/changes.txt
  2. 8 0
      src/engine.c

+ 5 - 0
docs/changes.txt

@@ -35,6 +35,11 @@ file.: Host
 desc.: Fixed the use of -s / -l parameters together with the attack mode -a 8 (Prince)
 issue: 40
 
+type.: Bug
+file.: Host
+desc.: Fixed a memory issue with algorithms using unicode when trying password candidates longer than 27 characters
+issue: 54
+
 type.: Bug
 file.: Host
 desc.: Fixed --help text for hash type -m 9900 = Radmin2 (was wronly displayed as -m 9800 = Radmin2)

+ 8 - 0
src/engine.c

@@ -4599,6 +4599,8 @@ void md4_final_sse2_max55 (plain_t *plains, digest_md4_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr->len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;
@@ -4617,6 +4619,8 @@ void md5_final_sse2_max55 (plain_t *plains, digest_md5_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr->len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;
@@ -4635,6 +4639,8 @@ void sha1_final_sse2_max55 (plain_t *plains, digest_sha1_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr->len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;
@@ -4655,6 +4661,8 @@ void sha256_final_sse2_max55 (plain_t *plains, digest_sha256_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr->len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;