Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2017 00:48:26 +0000 (UTC)
From:      Josh Paetzel <jpaetzel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319670 - head/contrib/smbfs/lib/smb
Message-ID:  <201706080048.v580mQKZ085204@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jpaetzel
Date: Thu Jun  8 00:48:26 2017
New Revision: 319670
URL: https://svnweb.freebsd.org/changeset/base/319670

Log:
  Fix SMBFS when saved passwords are greater than 18 characters
  
  PR:	132302
  Submitted by:	dhorn2000@gmail.com guru@unixarea.de
  MFC after:	1 week

Modified:
  head/contrib/smbfs/lib/smb/subr.c

Modified: head/contrib/smbfs/lib/smb/subr.c
==============================================================================
--- head/contrib/smbfs/lib/smb/subr.c	Thu Jun  8 00:41:25 2017	(r319669)
+++ head/contrib/smbfs/lib/smb/subr.c	Thu Jun  8 00:48:26 2017	(r319670)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706080048.v580mQKZ085204>