From owner-svn-src-head@freebsd.org Thu Jun 8 00:48:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40E84B950BE; Thu, 8 Jun 2017 00:48:27 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC6B662EB; Thu, 8 Jun 2017 00:48:26 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v580mQ7d085205; Thu, 8 Jun 2017 00:48:26 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v580mQKZ085204; Thu, 8 Jun 2017 00:48:26 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201706080048.v580mQKZ085204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 8 Jun 2017 00:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319670 - head/contrib/smbfs/lib/smb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 00:48:27 -0000 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);