Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecate the SecureRandom class#15879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:2.8frompierredup:deprecate_secure_random
Oct 6, 2015

Conversation

pierredup
Copy link
Contributor

QA
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

Deprecate theSymfony\Component\Security\Core\Util\SecureRandom and encourage the usage of therandom_bytes function instead

@stof
Copy link
Member

This implementation is broken: the Symfony codebase still use the deprecated function, meaning it triggers deprecation warnings for everyone (and this is why the testsuite is failing)

@pierredup
Copy link
ContributorAuthor

@stof What would be the best way to deprecate this class then? Should the dependency onparagonie/random_compat be added here already, with all the instances that use theSecureRandom class be updated to use the function instead? That way the class and interface can be deprecated with all the internal code using the new function. Or is there a better way to do the deprecation?

@stof
Copy link
Member

@pierredup yes, this is the way it should be done. A deprecated API should not be used anymore. If you cannot avoid using it, it cannot be a deprecated API.

@@ -33,7 +33,8 @@
"symfony/http-foundation": "",
"symfony/validator": "For using the user password constraint",
"symfony/expression-language": "For using the expression voter",
"ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5"
"ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5",
"paragonie/random_compat": "For secure number generation"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think, we should document that this library is only a compatibility layer for PHP 5:"For secure random number generation in PHP 5.x"

@derrabus
Copy link
Member

Status: Needs Work

@pierreduppierredupforce-pushed thedeprecate_secure_random branch 5 times, most recently fromb527c03 to5077d83CompareSeptember 25, 2015 09:05
@pierredup
Copy link
ContributorAuthor

I think this PR is ready /cc@stof@fabpot

The travis failures seems unrelated

Status: Needs Review

@stof
Copy link
Member

I would like to see our testsuite being fixed and then rerunning the builds for this PR, to ensure things work properly though.

@pierredup
Copy link
ContributorAuthor

Can the build for this be re-run? Or should I do a push to trigger new builds?

@stof
Copy link
Member

@pierredup there are conflicts preventing the merge, so this needs a rebase anyway. After pushing the rebased version, a new build with run.

@pierreduppierredupforce-pushed thedeprecate_secure_random branch 2 times, most recently from44a1d43 to0d781d4CompareSeptember 29, 2015 12:52
@@ -12,6 +12,7 @@ CHANGELOG
`Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface` instead
* deprecated `Symfony\Component\Security\Core\Util\ClassUtils`, use
`Symfony\Component\Security\Acl\Util\ClassUtils` instead
* deprecated `Symfony\Component\Security\Core\Util\SecureRandom` class in favour of the `random_bytes` function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

deprecated the [...]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

in favor of

@pierreduppierredupforce-pushed thedeprecate_secure_random branch from0c50c1f to5bb8732CompareOctober 3, 2015 17:21
@pierredup
Copy link
ContributorAuthor

Thanks for the info@stof

@pierredup
Copy link
ContributorAuthor

All comments have been addressed

@pierreduppierredupforce-pushed thedeprecate_secure_random branch from5bb8732 toee3f67aCompareOctober 3, 2015 17:23
@derrabus
Copy link
Member

Status: Reviewed

@xabbuh
Copy link
Member

@pierredup You also have to update theSecureRandomTest class. ThegetSecureRandoms() data provider tries to modify theuseOpenSsl property which no longer exists.

@xabbuh
Copy link
Member

Status: Needs work

@pierredup
Copy link
ContributorAuthor

Thanks@xabbuh. Is it still necessary for the test, since the SecureRandom class is now basically only a wrapper for therandom_bytes function? Can I remove the test, or do you prefer I just update it?

@xabbuh
Copy link
Member

Imo you can simply drop the OpenSSL related part of that test.

@pierreduppierredupforce-pushed thedeprecate_secure_random branch fromee3f67a to1afe984CompareOctober 4, 2015 17:23
@derrabus
Copy link
Member

Status: Reviewed

@fabpot
Copy link
Member

👍 ping @symfony/deciders

* each token (in bits)
* Note: The $random parameter is deprecated since version 2.8 and will be removed in 3.0.
*
* @param SecureRandomInterface|int|null $random The random value generator used for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

the deprecated parameter value should not be documented anymore

@Tobion
Copy link
Contributor

👍 apart from the above comments

@fabpot
Copy link
Member

should also be rebased to resolve conflict.

@pierreduppierredupforce-pushed thedeprecate_secure_random branch from1afe984 tof02973aCompareOctober 6, 2015 18:09
@pierredup
Copy link
ContributorAuthor

Done

@fabpot
Copy link
Member

Thank you@pierredup.

@fabpotfabpot merged commitf02973a intosymfony:2.8Oct 6, 2015
fabpot added a commit that referenced this pull requestOct 6, 2015
This PR was merged into the 2.8 branch.Discussion----------Deprecate the SecureRandom class| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |Deprecate the `Symfony\Component\Security\Core\Util\SecureRandom` and encourage the usage of the `random_bytes` function insteadCommits-------f02973a Deprecate the SecureRandom class
@fabpotfabpot mentioned this pull requestNov 16, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@pierredup@stof@derrabus@fabpot@xabbuh@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp