Skip to content
  • Jonathan Hefner's avatar
    0fc7448f
    Improve error when EncryptedFile key length wrong · 0fc7448f
    Jonathan Hefner authored
    When given a key of invalid length, OpenSSL::Cipher raises a "key must
    be X bytes" error.  However, EncryptedFile keys are packed before they
    are passed to OpenSSL::Cipher, so the actual length requirement is "2*X
    characters".
    
    This commit checks the key length, and raises a more helpful error if
    the key length is invalid.
    
    Closes #39528.
    0fc7448f
    Improve error when EncryptedFile key length wrong
    Jonathan Hefner authored
    When given a key of invalid length, OpenSSL::Cipher raises a "key must
    be X bytes" error.  However, EncryptedFile keys are packed before they
    are passed to OpenSSL::Cipher, so the actual length requirement is "2*X
    characters".
    
    This commit checks the key length, and raises a more helpful error if
    the key length is invalid.
    
    Closes #39528.
Loading