torture-samr: Try breaking the NT hash first, as the LM hash may not be being checked
authorAndrew Bartlett <abartlet@samba.org>
Thu, 7 Nov 2013 04:04:14 +0000 (17:04 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 2 Apr 2014 15:12:46 +0000 (17:12 +0200)
Change-Id: Iea9040bc7130f8b779c35bd367a9915633cd494d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/torture/rpc/samr.c

index a916d9f955e1984128f301d0bf855debf17371bc..00da5fe24387b23aeb727992040b6af7f7ad5edc 100644 (file)
@@ -1741,8 +1741,8 @@ static bool test_ChangePasswordUser(struct dcerpc_binding_handle *b,
 
        r.in.user_handle = &user_handle;
        r.in.lm_present = 1;
-       /* Break the LM hash */
-       hash1.hash[0]++;
+       /* Break the NT hash */
+       hash3.hash[0]++;
        r.in.old_lm_crypted = &hash1;
        r.in.new_lm_crypted = &hash2;
        r.in.nt_present = 1;
@@ -1769,15 +1769,15 @@ static bool test_ChangePasswordUser(struct dcerpc_binding_handle *b,
                        "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD because we broke the LM hash");
        }
 
-       /* Unbreak the LM hash */
-       hash1.hash[0]--;
+       /* Unbreak the NT hash */
+       hash3.hash[0]--;
 
        r.in.user_handle = &user_handle;
        r.in.lm_present = 1;
        r.in.old_lm_crypted = &hash1;
        r.in.new_lm_crypted = &hash2;
-       /* Break the NT hash */
-       hash3.hash[0]--;
+       /* Break the LM hash */
+       hash1.hash[0]--;
        r.in.nt_present = 1;
        r.in.old_nt_crypted = &hash3;
        r.in.new_nt_crypted = &hash4;