Follow us on Twitter or via RSS feeds with tweets or complete announcement texts or excerpts
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 29 Sep 2010 23:03:58 +0200
From: "Magnum, P.I." <rawsmooth@...dband.net>
To: john-users@...ts.openwall.com
Subject: Re: NT/unicode issue in current version

2010-09-29 16:08, Alain Espinosa skrev:
> On 9/28/10, Magnum, P.I.<rawsmooth@...dband.net>  wrote:
>> ...and it turns out more of the same is needed. If the plaintext is üü,
>> the temp variable assignment need similar casting. I'll not be posting
>> more patches in this matter, it's probably better if Alex or Alain have
>> a look at it instead.
>
> Try to replace "set_key(char *key, int index)" by "set_key(unsigned
> char *key, int index)". It works for me.

That works fine here too, thanks. Note that in mscash_fmt.c you need to 
do the same to get_salt() too.

I enclose what I believe is a complete fix for this issue, including 
added self-tests that should flag for any remaining or future problems.

magnum

diff --git a/src/NT_fmt.c b/src/NT_fmt.c
index 4c6d1fa..31b32be 100644
--- a/src/NT_fmt.c
+++ b/src/NT_fmt.c
@@ -45,6 +45,8 @@ static struct fmt_tests tests[] = {
 	{"$NT$b7e4b9022cd45f275334bbdb83bb5be5", "John the Ripper"},
 	{"$NT$8846f7eaee8fb117ad06bdd830b7586c", "password"},
 	{"$NT$0cb6948805f797bf2a82807973b89537", "test"},
+	{"$NT$8bd6e4fb88e01009818749c5443ea712", "\xFC"},         // German u-diaeresis in ISO-8859-1
+	{"$NT$cc1260adb6985ca749f150c7e0b22063", "\xFC\xFC"},     // Two of the above
 	{"$NT$31d6cfe0d16ae931b73c59d7e0c089c0", ""},
 	{NULL}
 };
@@ -431,7 +433,7 @@ static void set_salt(void *salt)
 {
 }
 
-static void set_key(char *key, int index)
+static void set_key(unsigned char *key, int index)
 {
 	unsigned int i=0;
 	unsigned int md4_size=0;
diff --git a/src/mscash_fmt.c b/src/mscash_fmt.c
index 89b16de..40d709f 100644
--- a/src/mscash_fmt.c
+++ b/src/mscash_fmt.c
@@ -37,6 +37,8 @@ static struct fmt_tests tests[] = {
 	{"M$test2#ab60bdb4493822b175486810ac2abe63", "test2" },
 	{"M$test3#14dd041848e12fc48c0aa7a416a4a00c", "test3" },
 	{"M$test4#b945d24866af4b01a6d89b9d932a153c", "test4" },
+	{"M$\xFC#48f84e6f73d6d5305f6558a33fa2c9bb", "\xFC" },         // German u-diaeresis in ISO-8859-1
+	{"M$\xFC\xFC#593246a8335cf0261799bda2a2a9c623", "\xFC\xFC" }, // Two of the above
 	{NULL}
 };
 
@@ -131,7 +133,7 @@ static void set_salt(void *salt) {
 	salt_buffer=salt;
 }
 
-static void * get_salt(char * ciphertext)
+static void * get_salt(unsigned char * ciphertext)
 {
 	//lenght=11 for save memory
 	//last position = 0
@@ -461,7 +463,7 @@ static int cmp_exact(char *source, int index)
 	return 1;
 }
 
-static void set_key(char *key, int index)
+static void set_key(unsigned char *key, int index)
 {
 	unsigned int md4_size=0;
 	unsigned int i=0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux - Powered by OpenVZ