fixes #18735 - truncate encryption key to match preferred length (#4350)
Ruby 2.4's OpenSSL bindings raise an ArgumentError during encryption if the key length exceeds the cipher's configured length (32 bytes with the default cipher), but the verification hash algorithm still uses the full length key.
The encryption key is now truncated to the cipher's preferred length while passing the full key (if supplied) for signatures.
The default new key length has been changed from 40 to 32 bytes matching the cipher default, but there's no reason to deprecate or force existing installations to change.
Related issues
Bug #18735: Encryptable unit tests fail under Ruby 2.4: key must be 32 bytes
fixes #18735 - truncate encryption key to match preferred length (#4350)
Ruby 2.4's OpenSSL bindings raise an ArgumentError during encryption if
the key length exceeds the cipher's configured length (32 bytes with the
default cipher), but the verification hash algorithm still uses the full
length key.
The encryption key is now truncated to the cipher's preferred length
while passing the full key (if supplied) for signatures.
The default new key length has been changed from 40 to 32 bytes matching
the cipher default, but there's no reason to deprecate or force existing
installations to change.