Skip to content
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

Fix key validation bug #7

Closed
wants to merge 3 commits into from

Commits on Jan 12, 2017

  1. Extract IV generation into

    This is done for two reasons:
    
    1. There's no reason for it to be an instance method, since it does not
    use the key
    
    2. This gets us around the "hack" of creating a new AES instance with an
    empty key, which breaks our validation of the key
    drewblas committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    f03da7c View commit details
    Browse the repository at this point in the history
  2. Generate proper random keys

    * They are of the correct length (64 hex chars)
    * They use only a secure source
    * They pack and unpack correctly
    * Converted the instance method to re-use the class method since key 
    generation doesn't rely on any encryption state
    
    The :base_64 format output of the random keys is very strange, because
    you are base64 encoding the hex string, when the normal expectation is
    you would base64 encode the raw binary. But I have left it as-is
    for backwards compatibility.
    drewblas committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    949333c View commit details
    Browse the repository at this point in the history
  3. Only allow valid keys to be used

    They must be in the proper format and length: 64 character hex string
    Raising an Argument Error
    
    Also updated all examples with using a proper key
    
    Finally, added a CHANGELOG with the breaking changes
    drewblas committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    800a327 View commit details
    Browse the repository at this point in the history