Closed
Conversation
nikic
reviewed
Jan 18, 2017
ext/hash/hash.c
Outdated
| efree(hash); | ||
| /* {{{ proto void HashContext::__construct() */ | ||
| static PHP_METHOD(HashContext, __construct) { | ||
| ZEND_ASSERT(0); |
Member
There was a problem hiding this comment.
This looks unsafe wrt reflection. Maybe throw?
Member
Author
There was a problem hiding this comment.
God damned reflection...
nikic
reviewed
Jan 18, 2017
ext/hash/hash.c
Outdated
| } | ||
|
|
||
| if (hash->key) { | ||
| memset(hash->key, 0, hash->ops->block_size); |
Member
There was a problem hiding this comment.
Not your code, but ZEND_SECURE_ZERO would be good here
Member
Author
There was a problem hiding this comment.
Indeed, I'll pile that on as a separate diff to keep the changes separate though.
This allows better type hinting as well as potentially adding methods in a followup diff. Original patch by Rouven Weßling (github.com/realityking) Heavily modified by Sara Golemon (github.com/sgolemon)
Member
|
Has been merged via b7f59be, closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains two commits.
The first is a refactor of @realityking's original PR.
The second adds the ability to call hash_final() multiple times (or update after final) and lets the object act a bit more objecty.
I don't necessarily think the second patch is necessary (or best), but I'm including it for review.
See RFC at: https://wiki.php.net/rfc/hash-context.as-resource