gitlab-org--gitlab-foss/app/models/hooks
Nick Thomas 2f2b0ad390
Use a 32-byte version of db_key_base for web hooks
AES-256-GCM cipher mode requires a key that is exactly 32 bytes long.
We already handle the case when the key is too long, by truncating, but
the key can also be too short in some installations. Switching to a key
that is always exactly the right length (by virtue of right-padding
ASCII 0 characters) allows encryption to proceed, without breaking
backward compatibility.

When the key is too short, encryption fails with an `ArgumentError`,
causing the web hooks functionality to be unusable. As a result, zero
rows can exist with values encrypted with the too-short key.

When the key is too long, it is silently truncated. In this case, the
key is unchanged, so values encrypted with the new too-long key will
still be successfully decrypted.
2018-12-05 00:00:42 +00:00
..
active_hook_filter.rb Enable frozen string in vestigial files 2018-09-11 02:06:35 -07:00
project_hook.rb Enable more frozen string in app/models/**/*.rb 2018-08-07 00:37:36 -07:00
service_hook.rb Backport ServiceHook#execute from EE 2018-11-15 16:55:51 +01:00
system_hook.rb Enable more frozen string in app/models/**/*.rb 2018-08-07 00:37:36 -07:00
web_hook.rb Use a 32-byte version of db_key_base for web hooks 2018-12-05 00:00:42 +00:00
web_hook_log.rb Enable more frozen string in app/models/**/*.rb 2018-08-07 00:37:36 -07:00