summaryrefslogtreecommitdiff
path: root/ext/hash
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-09-19 01:46:14 +0200
committerAnatol Belski <ab@php.net>2014-09-19 01:46:14 +0200
commitc45f4f546180d5d4fa83bfcdaad94ec52c9cc274 (patch)
treefa0cbcc19a6fd580cce3df5a971089bbb5bfefb4 /ext/hash
parentadf753159b534885b31586cd5b37bdf36d806df0 (diff)
downloadphp-git-c45f4f546180d5d4fa83bfcdaad94ec52c9cc274.tar.gz
generalized the case with secure memory zeroing
Diffstat (limited to 'ext/hash')
-rw-r--r--ext/hash/hash_ripemd.c8
-rw-r--r--ext/hash/hash_whirlpool.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/ext/hash/hash_ripemd.c b/ext/hash/hash_ripemd.c
index 16fbd12b18..0e0df3ac89 100644
--- a/ext/hash/hash_ripemd.c
+++ b/ext/hash/hash_ripemd.c
@@ -244,7 +244,7 @@ static void RIPEMD128Transform(php_hash_uint32 state[4], const unsigned char blo
state[0] = tmp;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
@@ -342,7 +342,7 @@ static void RIPEMD256Transform(php_hash_uint32 state[8], const unsigned char blo
state[7] += dd;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
@@ -441,7 +441,7 @@ static void RIPEMD160Transform(php_hash_uint32 state[5], const unsigned char blo
state[0] = tmp;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
@@ -549,7 +549,7 @@ static void RIPEMD320Transform(php_hash_uint32 state[10], const unsigned char bl
state[9] += ee;
tmp = 0;
- memset(x, 0, sizeof(x));
+ ZEND_SECURE_ZERO(x, sizeof(x));
}
/* }}} */
diff --git a/ext/hash/hash_whirlpool.c b/ext/hash/hash_whirlpool.c
index ca41e523d0..60087aee64 100644
--- a/ext/hash/hash_whirlpool.c
+++ b/ext/hash/hash_whirlpool.c
@@ -263,8 +263,8 @@ static void WhirlpoolTransform(PHP_WHIRLPOOL_CTX *context)
context->state[5] ^= state[5] ^ block[5];
context->state[6] ^= state[6] ^ block[6];
context->state[7] ^= state[7] ^ block[7];
-
- memset(state, 0, sizeof(state));
+
+ ZEND_SECURE_ZERO(state, sizeof(state));
}
PHP_HASH_API void PHP_WHIRLPOOLInit(PHP_WHIRLPOOL_CTX *context)