There's also a problem in the random number generator when using the Windows security provider if you still have WORKAROUND_MS_BUG_Q258000 #defined in config.h

The problem is that when this is #defined, there's only a static single security provider handle with no protection from concurrent access by multiple threads. If two threads are trying to call NonblockingRng::GenerateBlock at the same time, apparently Windows gets angry and throws an access violation.

Removing the #define WORKAROUND_MS_BUG_Q258000 fixed the problem for me. According to Microsoft, the reason for this workaround was because of a large memory leak in Microsoft's security provider, which was fixed a long time ago. In fact, you can't even find a reference to WORKAROUND_MS_BUG_Q258000 in the latest MSDN library.

I'd be interested in knowing if anyone has run into this.

Dan Sanderson
Living Software, Inc.




<-----Original Message----->
From: Voronkov Konstantin
Sent: 11/29/2004 4:28:27 AM
To: [EMAIL PROTECTED]
Subject: Re: Exception with AutoSeededRandomPool - Probably BUG in CryptoPP?




>
>
Hello, All!

>

>
I made analysis of source code of CryptoPP and came to next
>question.

>
There is a call to CryptReleaseContext() on Windows
>Platform,

>
but no call to CryptContextAddRef().
>IMHO, according to MSDN

>
the call to CryptContextAddRef() is
>missing. Is not it?

>

>
Best Regards,

>
Voronkov Konstantin

>

>

>
>style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
>
----- Original Message -----

>
> style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black">From:
> > href="">Voronkov Konstantin

>
>
Sent: Wednesday, November 17, 2004 7:00
> PM

>
Subject: Exception with
> AutoSeededRandomPool

>


>
Hello, All!

>

>
I have exception using AutoSeededRandomPool.

>
OS_Rgn:CryptGenRandom operation failed with error 0x57
> OTHER_ERROR

>

>
I'm calling AutoSeededRandomPool
> rng;

>

>
Here is the stack:
ADVAPI32! 7c2e7324()
ADVAPI32!
> 7c2ea85b()
CRYPTOPP! 42966e6a()
AfxWinMain(HINSTANCE__ * 0x00400000,
> HINSTANCE__ * 0x00000000, char *
0x00133c8e, int 1) line 39 + 11
> bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char *
> 0x00133c8e,
int 1) line 30
WinMainCRTStartup() line 330 + 54
> bytes
KERNEL32! 7c4e87f5()

>
I'm using modified version of CryptoPP 5.21

>
This happens in MFC application, and does not reproduced

>
in little sample console application.

>

>
Have anyone any idea about the reasons of this problem?

>

>
Best Regards,

>
Voronkov Konstantin

>

_______________________________________________________________
Get the FREE email that has everyone talking at http://www.mail2world.com

 

Reply via email to