Skip to content

Commit 805a330

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Always use ZEND_SECURE_ZERO() when cleaning up data bump versions after release
2 parents 0c6a68f + d1d692a commit 805a330

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ext/hash/hash_sha3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static void PHP_SHA3_Final(unsigned char* digest,
194194
}
195195

196196
// Zero out context
197-
memset(ctx, 0, sizeof(PHP_SHA3_CTX));
197+
ZEND_SECURE_ZERO(ctx, sizeof(PHP_SHA3_CTX));
198198
}
199199

200200
// ==========================================================================

ext/hash/hash_snefru.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static inline void SnefruTransform(PHP_SNEFRU_CTX *context, const unsigned char
127127
((input[i+2] & 0xff) << 8) | (input[i+3] & 0xff);
128128
}
129129
Snefru(context->state);
130-
memset(&context->state[8], 0, sizeof(uint32_t) * 8);
130+
ZEND_SECURE_ZERO(&context->state[8], sizeof(uint32_t) * 8);
131131
}
132132

133133
PHP_HASH_API void PHP_SNEFRUInit(PHP_SNEFRU_CTX *context)

ext/standard/sha1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ PHPAPI void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context)
244244

245245
/* Zeroize sensitive information.
246246
*/
247-
memset((unsigned char*) context, 0, sizeof(*context));
247+
ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
248248
}
249249
/* }}} */
250250

@@ -355,7 +355,7 @@ const unsigned char block[64];
355355
state[4] += e;
356356

357357
/* Zeroize sensitive information. */
358-
memset((unsigned char*) x, 0, sizeof(x));
358+
ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
359359
}
360360
/* }}} */
361361

0 commit comments

Comments
 (0)