Skip to content

Commit

Permalink
Merge branch 'PHP-7.4'
Browse files Browse the repository at this point in the history
* PHP-7.4:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
  • Loading branch information
smalyshev committed Apr 7, 2019
2 parents 2672584 + 3eae4f6 commit e1a3938
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ext/hash/hash_sha3.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static void PHP_SHA3_Final(unsigned char* digest,
}

// Zero out context
memset(ctx, 0, sizeof(PHP_SHA3_CTX));
ZEND_SECURE_ZERO(ctx, sizeof(PHP_SHA3_CTX));
}

// ==========================================================================
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/hash_snefru.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static inline void SnefruTransform(PHP_SNEFRU_CTX *context, const unsigned char
((input[i+2] & 0xff) << 8) | (input[i+3] & 0xff);
}
Snefru(context->state);
memset(&context->state[8], 0, sizeof(uint32_t) * 8);
ZEND_SECURE_ZERO(&context->state[8], sizeof(uint32_t) * 8);
}

PHP_HASH_API void PHP_SNEFRUInit(PHP_SNEFRU_CTX *context)
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ PHPAPI void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context)

/* Zeroize sensitive information.
*/
memset((unsigned char*) context, 0, sizeof(*context));
ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
}
/* }}} */

Expand Down Expand Up @@ -355,7 +355,7 @@ const unsigned char block[64];
state[4] += e;

/* Zeroize sensitive information. */
memset((unsigned char*) x, 0, sizeof(x));
ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
}
/* }}} */

Expand Down

0 comments on commit e1a3938

Please sign in to comment.