From owner-freebsd-bugs@freebsd.org Thu Jun 8 06:20:58 2017 Return-Path: Delivered-To: freebsd-bugs@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 A423FBF7841 for ; Thu, 8 Jun 2017 06:20:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 9287676204 for ; Thu, 8 Jun 2017 06:20:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v586KwpT042275 for ; Thu, 8 Jun 2017 06:20:58 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 132302] [patch] smbutil(1): contrib/smbfs subr.c: saved passwords >18 char fail Date: Thu, 08 Jun 2017 06:20:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: guru@unixarea.de X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 06:20:58 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D132302 --- Comment #5 from Matthias Apitz --- (In reply to Josh Paetzel from comment #3) I was thinking last night about the proposed patch and wanted to modify it,= but now it's committed already before I could put hands on the keyboard; the problem (bug) was that the value in 'pos' for the XOR operation: ch ^=3D pos; at some point exceeds, when the to be crypted password is long enough, exce= eds one byte, and so does the result in 'ch'; later the value from 'ch' is form= ated to a hex string with sprintf(dst, "%02x", ch); dst +=3D 2; which gives in 'dst' four new bytes, like 0136, but the pointer 'dst' is on= ly moved two byte further; this damages the resulting string in 'dst' for the crypted pw and later decrypt goes wrong; Said this, the test for 'pos' not exceeding one byte must be=20 if (pos >=3D 256)=20 pos -=3D256;' because a pw of 57 bytes lenth will hit the point where 'pos' is exactly 256 (0x100); 57++ bytes is a very unlikely password, but as it s stored into a file and = not typed in from time to time it's not impossible thinking in such a beast; sorry to come late with this comment; --=20 You are receiving this mail because: You are the assignee for the bug.=