diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2017-06-15 16:12:45 +0000 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2017-06-15 16:12:45 +0000 |
commit | a81a73102ab59e959ce4a5ea3ddf6cd098c53828 (patch) | |
tree | efac148d3224c5e82f809e39a6c242a5c99518a2 /contrib/smbfs/lib | |
parent | 77641924a740e3c9972c59f316b2ff5647a9f6b3 (diff) | |
download | FreeBSD-src-a81a73102ab59e959ce4a5ea3ddf6cd098c53828.zip FreeBSD-src-a81a73102ab59e959ce4a5ea3ddf6cd098c53828.tar.gz |
MFC 319670
Fix SMBFS when saved passwords are greater than 18 character
PR: 132302
Submitted by: dhorn2000@gmail.com guru@unixarea.de
Approved by: re (gjb)
Diffstat (limited to 'contrib/smbfs/lib')
-rw-r--r-- | contrib/smbfs/lib/smb/subr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/smbfs/lib/smb/subr.c b/contrib/smbfs/lib/smb/subr.c index cd65315..5c3e795 100644 --- a/contrib/smbfs/lib/smb/subr.c +++ b/contrib/smbfs/lib/smb/subr.c @@ -232,6 +232,8 @@ smb_simplecrypt(char *dst, const char *src) islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch); ch ^= pos; pos += 13; + if (pos > 256) + pos -= 256; sprintf(dst, "%02x", ch); dst += 2; } @@ -262,6 +264,8 @@ smb_simpledecrypt(char *dst, const char *src) return EINVAL; ch ^= pos; pos += 13; + if (pos > 256) + pos -= 256; if (isascii(ch)) ch = (isupper(ch) ? ('A' + (ch - 'A' + 13) % 26) : islower(ch) ? ('a' + (ch - 'a' + 13) % 26) : ch); |