B:BD[
2.12707] → [
2.12707:12811]
function _decrypt_encrypted_string(n, env, d, hdlrs, st, errp, line, out, status, dcmd, tfn, oors) {
function _assert_key_readable(env, d, hdlrs, st, errp, n_exitcode) {
# use glotawk's system function, not awk's, because the KEY_FILE
# variable is a user input, we wouldn't want to allow shell
# command injection, and glotawk's system function is shown by
# testing to disallow shell injection.
n_exitcode = _eval3(_cons(_symbol("system"),
_cons(_string("/bin/test"),
_cons(_string("-r"),
_cons(_string(KEY_FILE),
_nil())))),
env, env, d+1, hdlrs, st, errp)
if(_eq_awk(n_exitcode, _number(0))) {
return _true()
} else {
return _error(_cons(_string("cryptography attempted but KEY_FILE not readable: %s"),
_cons(_string(KEY_FILE),
_nil())),
env, d, hdlrs, st, errp)
}
}
function _decrypt_encrypted_string(n, env, d, hdlrs, st, errp, line, out, status, dcmd, tfn, oors, akr) {
akr = _assert_key_readable(env, d, hdlrs, st, errp)
if(!_eq_awk(_true(), akr))
return akr