]> git.saurik.com Git - apple/security.git/blobdiff - ntlm/NtlmGenerator.c
Security-59754.80.3.tar.gz
[apple/security.git] / ntlm / NtlmGenerator.c
index 90762e166b0caf82356b0c57813abffc2a6f3f87..f8fb24e27501a783f88a08bd558dcdd64ec8504f 100644 (file)
@@ -38,7 +38,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <assert.h>
+#include <security_utilities/simulatecrash_assert.h>
 #include <strings.h>
 
 /* 
@@ -662,13 +662,15 @@ OSStatus _NtlmGeneratePasswordHashes(
        unsigned char hash[NTLM_DIGEST_LENGTH];
        
        result = ntlmPasswordHash(password, hash);
-    if (result)
+    if (result) {
         return result;
-       
-       *ntlmHash = CFDataCreate(alloc, hash, sizeof(hash));
+    }
+
+    *ntlmHash = CFDataCreate(alloc, hash, sizeof(hash));
     memset(hash, 0, sizeof(hash));
-    if (*ntlmHash == NULL)
+    if (*ntlmHash == NULL) {
         result = errSecAllocate;
+    }
 
     static const UInt8 zero[NTLM_DIGEST_LENGTH] = { 0 };
     *lmHash = CFDataCreate(NULL, zero, sizeof(zero));