Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
716d6dcc
Commit
716d6dcc
authored
Mar 20, 2010
by
Francois Gouget
Committed by
Alexandre Julliard
Mar 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Use NULL instead of casting 0.
parent
c61732c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
sha2.c
dlls/rsaenh/sha2.c
+17
-17
No files found.
dlls/rsaenh/sha2.c
View file @
716d6dcc
...
...
@@ -273,7 +273,7 @@ static const char sha2_hex_digits[] = "0123456789abcdef";
/*** SHA-256: *********************************************************/
void
SHA256_Init
(
SHA256_CTX
*
context
)
{
if
(
context
==
(
SHA256_CTX
*
)
0
)
{
if
(
context
==
NULL
)
{
return
;
}
MEMCPY_BCOPY
(
context
->
state
,
sha256_initial_hash_value
,
SHA256_DIGEST_LENGTH
);
...
...
@@ -465,7 +465,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
}
/* Sanity check: */
assert
(
context
!=
(
SHA256_CTX
*
)
0
&&
data
!=
(
sha2_byte
*
)
0
);
assert
(
context
!=
NULL
&&
data
!=
NULL
);
usedspace
=
(
context
->
bitcount
>>
3
)
%
SHA256_BLOCK_LENGTH
;
if
(
usedspace
>
0
)
{
...
...
@@ -509,10 +509,10 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
unsigned
int
usedspace
;
/* Sanity check: */
assert
(
context
!=
(
SHA256_CTX
*
)
0
);
assert
(
context
!=
NULL
);
/* If no digest buffer is passed, we don't bother doing this: */
if
(
digest
!=
(
sha2_byte
*
)
0
)
{
if
(
digest
!=
NULL
)
{
usedspace
=
(
context
->
bitcount
>>
3
)
%
SHA256_BLOCK_LENGTH
;
#ifndef WORDS_BIGENDIAN
/* Convert FROM host byte order */
...
...
@@ -572,9 +572,9 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) {
int
i
;
/* Sanity check: */
assert
(
context
!=
(
SHA256_CTX
*
)
0
);
assert
(
context
!=
NULL
);
if
(
buffer
!=
(
char
*
)
0
)
{
if
(
buffer
!=
NULL
)
{
SHA256_Final
(
digest
,
context
);
for
(
i
=
0
;
i
<
SHA256_DIGEST_LENGTH
;
i
++
)
{
...
...
@@ -601,7 +601,7 @@ char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_S
/*** SHA-512: *********************************************************/
void
SHA512_Init
(
SHA512_CTX
*
context
)
{
if
(
context
==
(
SHA512_CTX
*
)
0
)
{
if
(
context
==
NULL
)
{
return
;
}
MEMCPY_BCOPY
(
context
->
state
,
sha512_initial_hash_value
,
SHA512_DIGEST_LENGTH
);
...
...
@@ -787,7 +787,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
}
/* Sanity check: */
assert
(
context
!=
(
SHA512_CTX
*
)
0
&&
data
!=
(
sha2_byte
*
)
0
);
assert
(
context
!=
NULL
&&
data
!=
NULL
);
usedspace
=
(
context
->
bitcount
[
0
]
>>
3
)
%
SHA512_BLOCK_LENGTH
;
if
(
usedspace
>
0
)
{
...
...
@@ -871,10 +871,10 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
sha2_word64
*
d
=
(
sha2_word64
*
)
digest
;
/* Sanity check: */
assert
(
context
!=
(
SHA512_CTX
*
)
0
);
assert
(
context
!=
NULL
);
/* If no digest buffer is passed, we don't bother doing this: */
if
(
digest
!=
(
sha2_byte
*
)
0
)
{
if
(
digest
!=
NULL
)
{
SHA512_Last
(
context
);
/* Save the hash data for output: */
...
...
@@ -901,9 +901,9 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) {
int
i
;
/* Sanity check: */
assert
(
context
!=
(
SHA512_CTX
*
)
0
);
assert
(
context
!=
NULL
);
if
(
buffer
!=
(
char
*
)
0
)
{
if
(
buffer
!=
NULL
)
{
SHA512_Final
(
digest
,
context
);
for
(
i
=
0
;
i
<
SHA512_DIGEST_LENGTH
;
i
++
)
{
...
...
@@ -930,7 +930,7 @@ char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_S
/*** SHA-384: *********************************************************/
void
SHA384_Init
(
SHA384_CTX
*
context
)
{
if
(
context
==
(
SHA384_CTX
*
)
0
)
{
if
(
context
==
NULL
)
{
return
;
}
MEMCPY_BCOPY
(
context
->
state
,
sha384_initial_hash_value
,
SHA512_DIGEST_LENGTH
);
...
...
@@ -946,10 +946,10 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
sha2_word64
*
d
=
(
sha2_word64
*
)
digest
;
/* Sanity check: */
assert
(
context
!=
(
SHA384_CTX
*
)
0
);
assert
(
context
!=
NULL
);
/* If no digest buffer is passed, we don't bother doing this: */
if
(
digest
!=
(
sha2_byte
*
)
0
)
{
if
(
digest
!=
NULL
)
{
SHA512_Last
((
SHA512_CTX
*
)
context
);
/* Save the hash data for output: */
...
...
@@ -976,9 +976,9 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) {
int
i
;
/* Sanity check: */
assert
(
context
!=
(
SHA384_CTX
*
)
0
);
assert
(
context
!=
NULL
);
if
(
buffer
!=
(
char
*
)
0
)
{
if
(
buffer
!=
NULL
)
{
SHA384_Final
(
digest
,
context
);
for
(
i
=
0
;
i
<
SHA384_DIGEST_LENGTH
;
i
++
)
{
...
...
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