Skip to content

[reference][configuration][security]Added key_length for pbkdf2 encoder #4369

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 5, 2014

Conversation

Guillaume-Rossignol
Copy link
Contributor

Q A
Doc fix? yes
New docs? no
Applies to >=2.2
Fixed tickets -

@wouterj
Copy link
Member

wouterj commented Oct 26, 2014

I'm not a security guy, can you maybe add some more information about this change? (in this PR)

@Guillaume-Rossignol
Copy link
Contributor Author

The pbdkf2 encoder has 4 parameters :

/**
* Constructor.
*
* @param string $algorithm The digest algorithm to use
* @param bool $encodeHashAsBase64 Whether to base64 encode the password hash
* @param int $iterations The number of iterations to use to stretch the password hash
* @param int $length Length of derived key to create
*/

but only the three first are documented in the full example.

in the event of migration (django to symfony in my case) it may be necessary to play with this last parameter to be compatible with old database.

@Nek-
Copy link
Contributor

Nek- commented Oct 26, 2014

Some options are not documented either, maybe it's an occasion to add theme : https://github.com/symfony/symfony/blob/master/src%2FSymfony%2FBundle%2FSecurityBundle%2FDependencyInjection%2FMainConfiguration.php#L421

( cost and ignore_case )

@Guillaume-Rossignol
Copy link
Contributor Author

ignore_case is used by plain_text encoder and this encoder is not documented.

cost is used by bcrypt encoder and he has his own section (https://github.com/symfony/symfony-docs/blob/2.3/reference/configuration/security.rst#using-the-bcrypt-password-encoder). Certainly because he has more prerequite (php5.5 or ircmaxell/password-compat library).

For the plain_text encoder should i :

  • Add a specific section with a caution about the securtiy
  • Add the encoder with a comment in the "full default configuration"
  • both

And for the bcrypt encoder, should i integrate its configuration in the full example ?

@wouterj
Copy link
Member

wouterj commented Oct 31, 2014

@Guillaume-Rossignol thanks for starting with this and sorry for my delay... It looks great now!

I don't think dedicated section should be created for the plaintext encoder. However, we might want to add a new section to the reference talking about all encoder types and their options. If you agree, let's do that in another PR and merge this one :)

cost: 13

# Plaintext encoder
# he does not do any encoding
Copy link
Member

Choose a reason for hiding this comment

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

"he" should be "it". ("he" is only used for men in english)

@Guillaume-Rossignol
Copy link
Contributor Author

"he" should be "it". ("he" is only used for men in english)

😢 i'm full of shame

However, we might want to add a new section to the reference talking about all encoder types and their options

I'm not sure that my english is well enough for this exercise, but i can try during the week

@wouterj
Copy link
Member

wouterj commented Nov 2, 2014

😢 i'm full of shame

Don't worry, you're doing a great job! It's just a very minor thing that I also do wrong most of the time :)

I'm not sure that my english is well enough for this exercise, but i can try during the week

As said, let's wait when this one is merged first. After that, feel free to start, we are here to help you with your english and all other things.

@weaverryan
Copy link
Member

Really great job - I love the added examples! Thanks Guillaume!

@weaverryan weaverryan merged commit 730dbb8 into symfony:2.3 Nov 5, 2014
weaverryan added a commit that referenced this pull request Nov 5, 2014
…r pbkdf2 encoder (Guillaume-Rossignol)

This PR was merged into the 2.3 branch.

Discussion
----------

[reference][configuration][security]Added key_length for pbkdf2 encoder

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | >=2.2
| Fixed tickets | -

Commits
-------

730dbb8 [Config] Complete security encoder in full default configuration
4b9a885 [reference][configuration][security]Added key_length for pbkdf2 encoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants