Skip to content

Conversation

@kirk-baird
Copy link
Member

@kirk-baird kirk-baird commented Nov 18, 2020

Issue Addressed

Closes #1906
Closes #1907

Proposed Changes

  • Emits warnings when the KDF parameters are two low.
  • Returns errors when the KDF parameters are high enough to pose a potential DoS threat.
  • Validates AES IV length is 128 bits, errors if empty, warnings otherwise.

Additional Info

NIST advice used for PBKDF2 ranges https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf.
Scrypt ranges are based on the maximum value of the u32 (i.e 4GB of memory)

The minimum range has been set to anything below the default fields.

Signed-off-by: Kirk Baird <baird.k@outlook.com>
Signed-off-by: Kirk Baird <baird.k@outlook.com>
Signed-off-by: Kirk Baird <baird.k@outlook.com>
Signed-off-by: Kirk Baird <baird.k@outlook.com>
@kirk-baird kirk-baird added A0 ready-for-review The code is ready for review labels Nov 18, 2020
Signed-off-by: Kirk Baird <baird.k@outlook.com>
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Nice, I like the approach! Only a few small comments.

@paulhauner paulhauner added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Nov 19, 2020
kirk-baird and others added 4 commits November 19, 2020 11:42
Fix error

Co-authored-by: Paul Hauner <paul@paulhauner.com>
Signed-off-by: Kirk Baird <baird.k@outlook.com>
Signed-off-by: Kirk Baird <baird.k@outlook.com>
@kirk-baird kirk-baird added ready-for-merge This PR is ready to merge. ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Nov 19, 2020
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Perfect!

bors r+

bors bot pushed a commit that referenced this pull request Nov 19, 2020
## Issue Addressed

Closes #1906 
Closes #1907 

## Proposed Changes

- Emits warnings when the KDF parameters are two low.
- Returns errors when the KDF parameters are high enough to pose a potential DoS threat.
- Validates AES IV length is 128 bits, errors if empty, warnings otherwise.

## Additional Info

NIST advice used for PBKDF2 ranges https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf. 
Scrypt ranges are based on the maximum value of the `u32` (i.e 4GB of memory)

The minimum range has been set to anything below the default fields.
@michaelsproul
Copy link
Member

naughty bors!

bors r-
bors r+

bors bot pushed a commit that referenced this pull request Nov 19, 2020
## Issue Addressed

Closes #1906 
Closes #1907 

## Proposed Changes

- Emits warnings when the KDF parameters are two low.
- Returns errors when the KDF parameters are high enough to pose a potential DoS threat.
- Validates AES IV length is 128 bits, errors if empty, warnings otherwise.

## Additional Info

NIST advice used for PBKDF2 ranges https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf. 
Scrypt ranges are based on the maximum value of the `u32` (i.e 4GB of memory)

The minimum range has been set to anything below the default fields.
@bors
Copy link

bors bot commented Nov 19, 2020

@bors bors bot changed the title Add validation to kdf parameters [Merged by Bors] - Add validation to kdf parameters Nov 19, 2020
@bors bors bot closed this Nov 19, 2020
@kirk-baird kirk-baird deleted the kdf-parameter-verification branch November 19, 2020 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0 ready-for-merge This PR is ready to merge. ready-for-review The code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unvalidated IV length for EIP-2335 Insufficient validation of EIP-2335 KDF params

4 participants