Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2002 21:40:59 +0300
From:      "Andrey A. Chernov" <ache@nagual.pp.ru>
To:        Mark Murray <markm@FreeBSD.org>, des@FreeBSD.org
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libpam/modules/pam_unix pam_unix.c
Message-ID:  <20020205184059.GA6785@nagual.pp.ru>
In-Reply-To: <20020205122043.GA3192@nagual.pp.ru>
References:  <200202040028.g140SsC86408@freefall.freebsd.org> <20020205122043.GA3192@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 05, 2002 at 15:20:44 +0300, Andrey A. Chernov wrote:
> 
> 1) You break applications which expect the same sequence from random()  
> (when initializing srandom() to some fixed value) since insert random()  
> calls in the middle of application ones.

In case my description is unclear, here is example:

App:
srandom(33);
random();
random();
call PAM library
	PAM calls random();
	PAM calls random()
	return;
random(); <--- expected sequence is broken here.


> 2) Since you not use srandom(), the code producing the same sequence from
> random() in case application do use random().

I see you try to compensate it by "* time", but why you even need random()  
in that case? Use some fixed numbers array.

> What is wrong with my arc4random() patch? arc4random() is not slower then 
> random() incorrectly used now.

BTW, arc4random() is not something "cryptographical", it is just RNG for
libraries and it is already commonly used in many places in many
libraries.

-- 
Andrey A. Chernov
http://ache.pp.ru/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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