mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-25 05:38:18 +00:00
847cc21e9b
Add CBC and ecb Block mode aes encryption/decryption. To facilitate testing this better, and just to be nicer overall, adjust data-loader's KeySource::key_data variant to support loading raw binary bytes. Co-authored-by: Wez Furlong <wez@wezfurlong.org> Closes: https://github.com/KumoCorp/kumomta/pull/395
15 lines
339 B
Lua
15 lines
339 B
Lua
local kumo = require 'kumo'
|
|
local utils = require 'policy-extras.policy_utils'
|
|
|
|
-- Confirm that text is loaded as a string
|
|
local text = kumo.secrets.load {
|
|
key_data = 'hello',
|
|
}
|
|
utils.assert_eq(text, 'hello')
|
|
|
|
-- Confirm that binary can be loaded too
|
|
local text = kumo.secrets.load {
|
|
key_data = '\x00',
|
|
}
|
|
utils.assert_eq(text, '\x00')
|