mirror of
https://github.com/samba-team/samba.git
synced 2025-01-04 05:18:06 +03:00
Don't force the DOS password into a 14 char space, as this would imply null
termination - the password will not be null terminated before hashing if
len >= 14.
related to debian bug #157432
Andrew Bartlett
(This used to be commit c6535836f2
)
This commit is contained in:
parent
9742f673fd
commit
05f6c8dea1
@ -73,13 +73,14 @@ void E_md4hash(const char *passwd, uchar p16[16])
|
|||||||
|
|
||||||
void E_deshash(const char *passwd, uchar p16[16])
|
void E_deshash(const char *passwd, uchar p16[16])
|
||||||
{
|
{
|
||||||
uchar dospwd[15]; /* Password must not be > 14 chars long. */
|
fstring dospwd;
|
||||||
ZERO_STRUCT(dospwd);
|
ZERO_STRUCT(dospwd);
|
||||||
ZERO_STRUCTP(p16);
|
ZERO_STRUCTP(p16);
|
||||||
|
|
||||||
/* Password must be converted to DOS charset - null terminated, uppercase. */
|
/* Password must be converted to DOS charset - null terminated, uppercase. */
|
||||||
push_ascii(dospwd, (const char *)passwd, sizeof(dospwd), STR_UPPER|STR_TERMINATE);
|
push_ascii(dospwd, (const char *)passwd, sizeof(dospwd), STR_UPPER|STR_TERMINATE);
|
||||||
|
|
||||||
|
/* Only the fisrt 14 chars are considered, password need not be null terminated. */
|
||||||
E_P16(dospwd, p16);
|
E_P16(dospwd, p16);
|
||||||
|
|
||||||
ZERO_STRUCT(dospwd);
|
ZERO_STRUCT(dospwd);
|
||||||
|
Loading…
Reference in New Issue
Block a user