summaryrefslogtreecommitdiffstats
path: root/Source/cm_sha2.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-11-17 16:18:08 (GMT)
committerBrad King <brad.king@kitware.com>2011-11-17 16:18:08 (GMT)
commit0599c5f546c8b3e04c0dd9fcdc19a6b3825849a7 (patch)
tree0ea44204fa41193e5de62bc7b4ad11a501436546 /Source/cm_sha2.c
parent0a6705cbda8171667c4b37872136cd102ccc328c (diff)
downloadCMake-0599c5f546c8b3e04c0dd9fcdc19a6b3825849a7.zip
CMake-0599c5f546c8b3e04c0dd9fcdc19a6b3825849a7.tar.gz
CMake-0599c5f546c8b3e04c0dd9fcdc19a6b3825849a7.tar.bz2
sha2: Zero entire SHA_CTX structure during cleanup
Convert lines of the form MEMSET_BZERO(context, sizeof(context)); to the correct form MEMSET_BZERO(context, sizeof(*context)); as suggested by Clang.
Diffstat (limited to 'Source/cm_sha2.c')
-rw-r--r--Source/cm_sha2.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/cm_sha2.c b/Source/cm_sha2.c
index b1798a8..12c39ed 100644
--- a/Source/cm_sha2.c
+++ b/Source/cm_sha2.c
@@ -704,7 +704,7 @@ void SHA1_Final(sha_byte digest[], SHA_CTX* context) {
* No digest buffer, so we can do nothing
* except clean up and go home
*/
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
return;
}
@@ -760,7 +760,7 @@ void SHA1_Final(sha_byte digest[], SHA_CTX* context) {
#endif
/* Clean up: */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
char *SHA1_End(SHA_CTX* context, char buffer[]) {
@@ -780,7 +780,7 @@ char *SHA1_End(SHA_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA1_DIGEST_LENGTH);
return buffer;
@@ -1099,7 +1099,7 @@ void SHA256_Final(sha_byte digest[], SHA_CTX* context) {
}
/* Clean up state data: */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
char *SHA256_End(SHA_CTX* context, char buffer[]) {
@@ -1119,7 +1119,7 @@ char *SHA256_End(SHA_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH);
return buffer;
@@ -1173,7 +1173,7 @@ void SHA224_Final(sha_byte digest[], SHA_CTX* context) {
}
/* Clean up state data: */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
char *SHA224_End(SHA_CTX* context, char buffer[]) {
@@ -1193,7 +1193,7 @@ char *SHA224_End(SHA_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA224_DIGEST_LENGTH);
return buffer;
@@ -1508,7 +1508,7 @@ void SHA512_Final(sha_byte digest[], SHA_CTX* context) {
}
/* Zero out state data */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
char *SHA512_End(SHA_CTX* context, char buffer[]) {
@@ -1528,7 +1528,7 @@ char *SHA512_End(SHA_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH);
return buffer;
@@ -1578,7 +1578,7 @@ void SHA384_Final(sha_byte digest[], SHA_CTX* context) {
}
/* Zero out state data */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
char *SHA384_End(SHA_CTX* context, char buffer[]) {
@@ -1598,7 +1598,7 @@ char *SHA384_End(SHA_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH);
return buffer;