Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4c2c7af0
Commit
4c2c7af0
authored
Oct 24, 2000
by
James Hatheway
Committed by
Alexandre Julliard
Oct 24, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added stubs for CryptGenRandom(), CryptReleaseContext().
parent
a4251bbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
3 deletions
+54
-3
advapi32.spec
dlls/advapi32/advapi32.spec
+2
-2
crypt.c
dlls/advapi32/crypt.c
+52
-1
No files found.
dlls/advapi32/advapi32.spec
View file @
4c2c7af0
...
...
@@ -54,14 +54,14 @@ import ntdll.dll
@ stub CryptGetKeyParam
@ stub CryptGetHashParam
@ stub CryptGetProvParam
@ st
ub
CryptGenRandom
@ st
dcall CryptGenRandom(long long ptr)
CryptGenRandom
@ stub CryptGetDefaultProviderA
@ stub CryptGetDefaultProviderW
@ stub CryptGetUserKey
@ stub CryptHashData
@ stub CryptHashSessionKey
@ stub CryptImportKey
@ st
ub
CryptReleaseContext
@ st
dcall CryptReleaseContext(long long)
CryptReleaseContext
@ stub CryptSetHashParam
@ stdcall CryptSetKeyParam(long long ptr long) CryptSetKeyParam
@ stub CryptSetProvParam
...
...
dlls/advapi32/crypt.c
View file @
4c2c7af0
/*
* dlls/advapi32/crypt.c
*/
#include <time.h>
#include <stdlib.h>
#include "windef.h"
#include "winerror.h"
#include "wincrypt.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
advapi
)
DEFAULT_DEBUG_CHANNEL
(
advapi
)
;
/******************************************************************************
* CryptAcquireContextA
...
...
@@ -41,3 +44,51 @@ CryptSetKeyParam( HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, DWORD dwFlags)
return
FALSE
;
}
/******************************************************************************
* CryptGenRandom
*/
BOOL
WINAPI
CryptGenRandom
(
HCRYPTPROV
hProv
,
DWORD
dwLen
,
BYTE
*
pbBuffer
)
{
DWORD
i
;
FIXME
(
"(0x%lx, %ld, %p): stub!
\n
"
,
hProv
,
dwLen
,
pbBuffer
);
/*
FIXME: Currently this function is just a stub, it is missing functionality in
the following (major) ways:
(1) It makes no use of the passed in HCRYPTPROV handle. (ie. it doesn't
use a cryptographic service provider (CSP)
(2) It doesn't use the values in the passed in pbBuffer to further randomize
its internal seed.
(3) MSDN mentions that this function produces "cryptographically random"
data, which is "... far more random than the data generated by the typical
random number generator such as the one shipped with your C compiler".
We are currently using the C runtime rand() function. ^_^
See MSDN documentation for CryptGenRandom for more information.
*/
if
(
dwLen
<=
0
)
return
FALSE
;
srand
(
time
(
NULL
));
for
(
i
=
0
;
i
<
dwLen
;
i
++
)
{
*
pbBuffer
=
(
BYTE
)(
rand
()
%
256
);
pbBuffer
++
;
}
return
TRUE
;
}
/******************************************************************************
* CryptReleaseContext
*/
BOOL
WINAPI
CryptReleaseContext
(
HCRYPTPROV
hProv
,
DWORD
dwFlags
)
{
FIXME
(
"(0x%lx, 0x%lx): stub!
\n
"
,
hProv
,
dwFlags
);
return
FALSE
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment