delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/06/05/23:02:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: Chris Polley <chris DOT polley AT ieee DOT org>
To: Volker Quetschke <quetschke AT scytek DOT de>
Cc: gnupg-devel AT gnupg DOT org, cygwin AT cygwin DOT com
Subject: Re: Patches for gnupg 1.0.7 / cygwin 1.3.10
Date: Wed, 05 Jun 2002 22:01:52 -0500
Message-ID: <s7htfukbk603me4ksuu9lsc96odrdh7nhv@4ax.com>
References: <3CFE118D DOT 2010900 AT scytek DOT de>
In-Reply-To: <3CFE118D.2010900@scytek.de>
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g5632Po03877

Hi, Volker:

On Wed, 05 Jun 2002 15:26:37 +0200, you wrote:

>I don't know how good the generated entropy is. This question goes to 
>the cygwin list. How generated? How good?

/dev/random (and /dev/urandom) is implemented in
/winsup/cygwin/fhandler_random.cc in the source code for the cygwin1
dll. (CVS version 1.18 is the current release, available at
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_random.cc?cvsroot=src
[for the gnupg-devel readers wishing to review the code]

It uses the MS-supplied CryptGenRandom call to generate the random
bytes.  According to MSDN
(http://msdn.microsoft.com/library/en-us/security/security/cryptgenrandom.asp),
this function takes a seed value supplied by the program (cygwin1.dll
passes on the contents of the read buffer) and adds it to "both the
stored seed and various system data and user data such as the process
ID and thread ID, the system clock, the system time, the system
counter, memory status, free disk clusters, the hashed user
environment block. This result is SHA-1 hashed, and the output is used
to seed an RC4 stream, which is then used as the random stream and
used to update the stored seed."

CryptGenRandom is available in NT/2k/XP/95(OSR2)/98/ME (in 95,
requires IE 3.02)

If the function isn't available for some reason, reads from
/dev/random fail (although reads from /dev/urandom will fall back to a
prng)

It seems that the windows dll attempts to check its signature before
allowing use, although I didn't see any details of that feature (other
than the error codes for bad sig, unable to verify sig, etc.)

I guess the advantage of rndw32 is that it is completely open source
(I'm assuming that the source to the winseed DLL is available... BTW,
why is the winseed DLL not dist in the gpg tarball?)

Warm Regards,
Chris

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019