php_hash_hmac_round((unsigned char *) digest->val, ops, context, K, (unsigned char *) digest->val, ops->digest_size);
/* Zero the key */
- memset(K, 0, ops->block_size);
+ ZEND_SECURE_ZERO(K, ops->block_size);
efree(K);
efree(context);
hash->ops->hash_final((unsigned char *) digest->val, hash->context);
/* Zero the key */
- memset(hash->key, 0, hash->ops->block_size);
+ ZEND_SECURE_ZERO(hash->key, hash->ops->block_size);
efree(hash->key);
hash->key = NULL;
}
memcpy(result + ((i - 1) * ops->digest_size), temp, ops->digest_size);
}
/* Zero potentially sensitive variables */
- memset(K1, 0, ops->block_size);
- memset(K2, 0, ops->block_size);
- memset(computed_salt, 0, salt_len + 4);
+ ZEND_SECURE_ZERO(K1, ops->block_size);
+ ZEND_SECURE_ZERO(K2, ops->block_size);
+ ZEND_SECURE_ZERO(computed_salt, salt_len + 4);
efree(K1);
efree(K2);
efree(computed_salt);
}
RETVAL_STRINGL(key, bytes);
- memset(key, 0, bytes);
+ ZEND_SECURE_ZERO(key, bytes);
efree(digest);
efree(context);
efree(key);
}
memcpy(context->buffer, input + i, r);
- memset(&context->buffer[r], 0, 32 - r);
+ ZEND_SECURE_ZERO(&context->buffer[r], 32 - r);
context->length = r;
}
}
digest[j + 3] = (unsigned char) ((context->state[i] >> 24) & 0xff);
}
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
const php_hash_ops php_hash_gost_ops = {
}
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
}
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
}
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
state[3] += d;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
state[4] += e;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
state[7] += h;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
state[7] += h;
/* Zeroize sensitive information. */
- memset((unsigned char*) x, 0, sizeof(x));
+ ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
/* Zeroize sensitive information.
*/
- memset((unsigned char*) context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */
}
memcpy(context->buffer, input + i, r);
- memset(&context->buffer[r], 0, 32 - r);
+ ZEND_SECURE_ZERO(&context->buffer[r], 32 - r);
context->length = r;
}
}
digest[j + 3] = (unsigned char) (context->state[i] & 0xff);
}
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
const php_hash_ops php_hash_snefru_ops = {
i = 64 - context->length;
memcpy(&context->buffer[context->length], input, i);
tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state);
- memset(context->buffer, 0, 64);
+ ZEND_SECURE_ZERO(context->buffer, 64);
context->passed += 512;
}
tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state);
context->passed += 512;
}
- memset(&context->buffer[r], 0, 64-r);
+ ZEND_SECURE_ZERO(&context->buffer[r], 64-r);
memcpy(context->buffer, &input[i], r);
context->length = r;
}
{
TigerFinalize(context);
TigerDigest(digest, 16, context);
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX *context)
{
TigerFinalize(context);
TigerDigest(digest, 20, context);
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *context)
{
TigerFinalize(context);
TigerDigest(digest, 24, context);
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
#define PHP_HASH_TIGER_OPS(p, b) \
digest += 8;
}
- memset(context, 0, sizeof(*context));
+ ZEND_SECURE_ZERO(context, sizeof(*context));
}
const php_hash_ops php_hash_whirlpool_ops = {