Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
96442252
Commit
96442252
authored
20 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
20 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Avoid a crash in advapi32/test_sha_ctx.c test if required entry points
are missing.
parent
20546c84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/advapi32/tests/crypt_sha.c
+11
-15
11 additions, 15 deletions
dlls/advapi32/tests/crypt_sha.c
with
11 additions
and
15 deletions
dlls/advapi32/tests/crypt_sha.c
+
11
−
15
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment