From owner-svn-src-stable@freebsd.org Thu Jun 15 16:12:46 2017 Return-Path: Delivered-To: svn-src-stable@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 A943AD8D4E3; Thu, 15 Jun 2017 16:12:46 +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 693187A7B1; Thu, 15 Jun 2017 16:12:46 +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 v5FGCjVP051394; Thu, 15 Jun 2017 16:12:45 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5FGCjxV051393; Thu, 15 Jun 2017 16:12:45 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201706151612.v5FGCjxV051393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 15 Jun 2017 16:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319980 - stable/11/contrib/smbfs/lib/smb X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2017 16:12:46 -0000 Author: jpaetzel Date: Thu Jun 15 16:12:45 2017 New Revision: 319980 URL: https://svnweb.freebsd.org/changeset/base/319980 Log: 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) Modified: stable/11/contrib/smbfs/lib/smb/subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/smbfs/lib/smb/subr.c ============================================================================== --- stable/11/contrib/smbfs/lib/smb/subr.c Thu Jun 15 15:50:49 2017 (r319979) +++ stable/11/contrib/smbfs/lib/smb/subr.c Thu Jun 15 16:12:45 2017 (r319980) @@ -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);