From owner-freebsd-current Sun Jan 20 12:26:35 2002 Delivered-To: freebsd-current@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id 196EF37B477; Sun, 20 Jan 2002 12:26:25 -0800 (PST) Received: (from ache@localhost) by nagual.pp.ru (8.11.6/8.11.6) id g0KKQJj24918; Sun, 20 Jan 2002 23:26:19 +0300 (MSK) (envelope-from ache) Date: Sun, 20 Jan 2002 23:26:17 +0300 From: "Andrey A. Chernov" To: Mark Murray Cc: des@freebsd.org, current@freebsd.org Subject: Re: Step1, pam_unix srandomdev fix for review Message-ID: <20020120202615.GF24138@nagual.pp.ru> References: <20020120200455.GC24138@nagual.pp.ru> <200201202017.g0KKHLt33050@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200201202017.g0KKHLt33050@grimreaper.grondar.org> User-Agent: Mutt/1.3.24i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Jan 20, 2002 at 20:17:21 +0000, Mark Murray wrote: > > Hmm. OK. Do you understand, though, why the salt does not need > cryptographic randomness? Yes. > Another patch of yours replaced sprintf with a faster strlcpy, > but this uses the _much_ slower arc4random() which is not > necessary IMO. How about just using pid's or something? 1) arc4random() is not slower than random(), so it not _increase_ existent PAM slowness. 2) I care here not about PAM, but about user application which RNG state current code damages. 3) I treat arc4random() replacement as bugfix for _application_ which not makes PAM code worse than it already is. > The original crypt(3) salt quantised the time-of-day into > 4096 pieces for the salt - how about doing something like > that? UUEncode time()|pid()|getuid() might work just fine. I agree. But I don't plan to improve PAM in this my fix, I just want to unbreak application first. Someone else can do what you suggest afterwards. -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message