Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[CVS] OpenSSL: OpenSSL_0_9_7-stable: openssl/crypto/rand/ rand_win.c: msg#00014

encryption.openssl.cvs

Subject: [CVS] OpenSSL: OpenSSL_0_9_7-stable: openssl/crypto/rand/ rand_win.c

OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________________________

Server: cvs.openssl.org Name: Richard Levitte
Root: /e/openssl/cvs Email: levitte@xxxxxxxxxxx
Module: openssl Date: 07-Aug-2003 13:57:21
Branch: OpenSSL_0_9_7-stable Handle: 2003080712572100

Modified files: (Branch: OpenSSL_0_9_7-stable)
openssl/crypto/rand rand_win.c

Log:
Correct two problems, found by Martin Kochanski <cardbox@xxxxxxxxxxxxx>:

1. CreateToolhelp32Snapshot returns INVALID_HANDLE_VALUE, not NULL, on
error.
2. On Windows CE, a snapshot handle is closed with CloseToolhelp32Snapshot,
not CloseHandle.

Summary:
Revision Changes Path
1.28.2.5 +10 -4 openssl/crypto/rand/rand_win.c
____________________________________________________________________________

patch -p0 <<'@@ .'
Index: openssl/crypto/rand/rand_win.c
============================================================================
$ cvs diff -u -r1.28.2.4 -r1.28.2.5 rand_win.c
--- openssl/crypto/rand/rand_win.c 3 Dec 2002 14:21:15 -0000 1.28.2.4
+++ openssl/crypto/rand/rand_win.c 7 Aug 2003 11:57:21 -0000 1.28.2.5
@@ -162,6 +162,7 @@
typedef DWORD (WINAPI *GETQUEUESTATUS)(UINT);

typedef HANDLE (WINAPI *CREATETOOLHELP32SNAPSHOT)(DWORD, DWORD);
+typedef BOOL (WINAPI *CLOSETOOLHELP32SNAPSHOT)(HANDLE);
typedef BOOL (WINAPI *HEAP32FIRST)(LPHEAPENTRY32, DWORD, DWORD);
typedef BOOL (WINAPI *HEAP32NEXT)(LPHEAPENTRY32);
typedef BOOL (WINAPI *HEAP32LIST)(HANDLE, LPHEAPLIST32);
@@ -431,7 +432,7 @@
* This seeding method was proposed in Peter Gutmann, Software
* Generation of Practically Strong Random Numbers,
*
http://www.usenix.org/publications/library/proceedings/sec98/gutmann.html
- * revised version at http://www.cryptoengines.com/~peter/06_random.pdf
+ * revised version at http://www.cryptoengines.com/~peter/06_random.pdf
* (The assignment of entropy estimates below is arbitrary, but based
* on Peter's analysis the full poll appears to be safe. Additional
* interactive seeding is encouraged.)
@@ -440,6 +441,7 @@
if (kernel)
{
CREATETOOLHELP32SNAPSHOT snap;
+ CLOSETOOLHELP32SNAPSHOT close_snap;
HANDLE handle;

HEAP32FIRST heap_first;
@@ -457,6 +459,8 @@

snap = (CREATETOOLHELP32SNAPSHOT)
GetProcAddress(kernel,
TEXT("CreateToolhelp32Snapshot"));
+ close_snap = (CLOSETOOLHELP32SNAPSHOT)
+ GetProcAddress(kernel, TEXT("CloseToolhelp32Snapshot"));
heap_first = (HEAP32FIRST) GetProcAddress(kernel,
TEXT("Heap32First"));
heap_next = (HEAP32NEXT) GetProcAddress(kernel,
TEXT("Heap32Next"));
heaplist_first = (HEAP32LIST) GetProcAddress(kernel,
TEXT("Heap32ListFirst"));
@@ -472,7 +476,7 @@
heaplist_next && process_first && process_next &&
thread_first && thread_next && module_first &&
module_next && (handle = snap(TH32CS_SNAPALL,0))
- != NULL)
+ != INVALID_HANDLE_VALUE)
{
/* heap list and heap walking */
/* HEAPLIST32 contains 3 fields that will change with
@@ -534,8 +538,10 @@
do
RAND_add(&m, m.dwSize, 9);
while (module_next(handle, &m));
-
- CloseHandle(handle);
+ if (close_snap)
+ close_snap(handle);
+ else
+ CloseHandle(handle);
}

FreeLibrary(kernel);
@@ .
______________________________________________________________________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List openssl-cvs@xxxxxxxxxxx
Automated List Manager majordomo@xxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe