mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-17 11:58:13 +00:00
sha1: fix context zeroing
This commit is contained in:
parent
949220ac0b
commit
20bb7e9b5c
6
sha2.c
6
sha2.c
@ -592,7 +592,7 @@ void sha1_Final(SHA1_CTX* context, sha2_byte digest[]) {
|
|||||||
* No digest buffer, so we can do nothing
|
* No digest buffer, so we can do nothing
|
||||||
* except clean up and go home
|
* except clean up and go home
|
||||||
*/
|
*/
|
||||||
MEMSET_BZERO(context, sizeof(context));
|
MEMSET_BZERO(context, sizeof(SHA1_CTX));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -649,7 +649,7 @@ void sha1_Final(SHA1_CTX* context, sha2_byte digest[]) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Clean up: */
|
/* Clean up: */
|
||||||
MEMSET_BZERO(context, sizeof(context));
|
MEMSET_BZERO(context, sizeof(SHA1_CTX));
|
||||||
}
|
}
|
||||||
|
|
||||||
char *sha1_End(SHA1_CTX* context, char buffer[]) {
|
char *sha1_End(SHA1_CTX* context, char buffer[]) {
|
||||||
@ -666,7 +666,7 @@ char *sha1_End(SHA1_CTX* context, char buffer[]) {
|
|||||||
}
|
}
|
||||||
*buffer = (char)0;
|
*buffer = (char)0;
|
||||||
} else {
|
} else {
|
||||||
MEMSET_BZERO(context, sizeof(context));
|
MEMSET_BZERO(context, sizeof(SHA1_CTX));
|
||||||
}
|
}
|
||||||
MEMSET_BZERO(digest, SHA1_DIGEST_LENGTH);
|
MEMSET_BZERO(digest, SHA1_DIGEST_LENGTH);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user