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
96442252
Commit
96442252
authored
Oct 04, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid a crash in advapi32/test_sha_ctx.c test if required entry points
are missing.
parent
20546c84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
crypt_sha.c
dlls/advapi32/tests/crypt_sha.c
+11
-15
No files found.
dlls/advapi32/tests/crypt_sha.c
View file @
96442252
...
...
@@ -18,13 +18,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <std
io
.h>
#include <std
arg
.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wine/test.h"
typedef
struct
{
ULONG
Unknown
[
6
];
ULONG
State
[
5
];
...
...
@@ -32,19 +33,12 @@ typedef struct {
UCHAR
Buffer
[
64
];
}
SHA_CTX
,
*
PSHA_CTX
;
typedef
VOID
(
WINAPI
*
fnA_SHAInit
)(
PSHA_CTX
Context
);
typedef
VOID
(
WINAPI
*
fnA_SHAUpdate
)(
PSHA_CTX
Context
,
PCHAR
Buffer
,
UINT
BufferSize
);
typedef
VOID
(
WINAPI
*
fnA_SHAFinal
)(
PSHA_CTX
Context
,
PULONG
Result
);
fnA_SHAInit
pA_SHAInit
;
fnA_SHAUpdate
pA_SHAUpdate
;
fnA_SHAFinal
pA_SHAFinal
;
#define ctxcmp(a,b) memcmp((char*)a, (char*)b, FIELD_OFFSET(SHA_CTX, Buffer))
void
test_sha_ctx
(
)
static
void
test_sha_ctx
(
void
)
{
PCHAR
test_buffer
=
"In our Life there's If"
FARPROC
pA_SHAInit
,
pA_SHAUpdate
,
pA_SHAFinal
;
static
const
char
test_buffer
[]
=
"In our Life there's If"
"In our beliefs there's Lie"
"In our business there is Sin"
"In our bodies, there is Die"
;
...
...
@@ -58,9 +52,11 @@ void test_sha_ctx()
ULONG
result_correct
[
5
]
=
{
0xe014f93
,
0xe09791ec
,
0x6dcf96c8
,
0x8e9385fc
,
0x1611c1bb
};
hmod
=
LoadLibrary
(
"advapi32.dll"
);
pA_SHAInit
=
(
fnA_SHAInit
)
GetProcAddress
(
hmod
,
"A_SHAInit"
);
pA_SHAUpdate
=
(
fnA_SHAUpdate
)
GetProcAddress
(
hmod
,
"A_SHAUpdate"
);
pA_SHAFinal
=
(
fnA_SHAFinal
)
GetProcAddress
(
hmod
,
"A_SHAFinal"
);
pA_SHAInit
=
GetProcAddress
(
hmod
,
"A_SHAInit"
);
pA_SHAUpdate
=
GetProcAddress
(
hmod
,
"A_SHAUpdate"
);
pA_SHAFinal
=
GetProcAddress
(
hmod
,
"A_SHAFinal"
);
if
(
!
pA_SHAInit
||
!
pA_SHAUpdate
||
!
pA_SHAFinal
)
return
;
RtlZeroMemory
(
&
ctx
,
sizeof
(
ctx
));
pA_SHAInit
(
&
ctx
);
...
...
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