Skip to content

Commit 9377d90

Browse files
committed
Provide a zero lm key if the password is too long
In Windows LM and NT keys are not geneated on the fly, but usually stored in the Windows key store, therefore when LM generation fails or is disable the LM Key is usually all zeros. Do the same here. Signed-off-by: Simo Sorce <[email protected]>
1 parent 36b3a26 commit 9377d90

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ntlm_crypto.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ int LMOWFv1(const char *password, struct ntlm_key *result)
9696
if (result->length != 16) return EINVAL;
9797

9898
len = strlen(password);
99-
if (len > 14) return ERANGE;
99+
if (len > 14) {
100+
memset(result->data, 0, result->length);
101+
return 0;
102+
}
100103

101104
out = 15;
102105
retstr = (char *)u8_toupper((const uint8_t *)password, len,

0 commit comments

Comments
 (0)