mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Fix SMBFS when saved passwords are greater than 18 characters
PR: 132302 Submitted by: dhorn2000@gmail.com guru@unixarea.de MFC after: 1 week
This commit is contained in:
parent
69db934679
commit
f56de56355
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319670
|
@ -232,6 +232,8 @@ smb_simplecrypt(char *dst, const char *src)
|
||||||
islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch);
|
islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch);
|
||||||
ch ^= pos;
|
ch ^= pos;
|
||||||
pos += 13;
|
pos += 13;
|
||||||
|
if (pos > 256)
|
||||||
|
pos -= 256;
|
||||||
sprintf(dst, "%02x", ch);
|
sprintf(dst, "%02x", ch);
|
||||||
dst += 2;
|
dst += 2;
|
||||||
}
|
}
|
||||||
|
@ -262,6 +264,8 @@ smb_simpledecrypt(char *dst, const char *src)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
ch ^= pos;
|
ch ^= pos;
|
||||||
pos += 13;
|
pos += 13;
|
||||||
|
if (pos > 256)
|
||||||
|
pos -= 256;
|
||||||
if (isascii(ch))
|
if (isascii(ch))
|
||||||
ch = (isupper(ch) ? ('A' + (ch - 'A' + 13) % 26) :
|
ch = (isupper(ch) ? ('A' + (ch - 'A' + 13) % 26) :
|
||||||
islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch);
|
islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch);
|
||||||
|
|
Loading…
Reference in a new issue