diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-08-16 16:41:34 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-08-17 13:17:44 +0200 |
commit | 7a6abbe93762fe23d415144ae7a040df3266bb5f (patch) | |
tree | 3c241ce87c245becbe36b6e3f1b366b32f2f6461 /src/cryptsetup/cryptsetup-fido2.c | |
parent | 8b474a437ce980bd0909db59141b40d56f6d5688 (diff) | |
download | systemd-7a6abbe93762fe23d415144ae7a040df3266bb5f.tar.gz |
env-util: add unsetenv_erase() helper
Let's unify how we remove secrets from the env block.
Diffstat (limited to 'src/cryptsetup/cryptsetup-fido2.c')
-rw-r--r-- | src/cryptsetup/cryptsetup-fido2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cryptsetup/cryptsetup-fido2.c b/src/cryptsetup/cryptsetup-fido2.c index dfaded3cdb..74b6bff1aa 100644 --- a/src/cryptsetup/cryptsetup-fido2.c +++ b/src/cryptsetup/cryptsetup-fido2.c @@ -2,6 +2,7 @@ #include "ask-password-api.h" #include "cryptsetup-fido2.h" +#include "env-util.h" #include "fileio.h" #include "hexdecoct.h" #include "json.h" @@ -70,9 +71,7 @@ int acquire_fido2_key( if (!pins) return log_oom(); - string_erase(e); - if (unsetenv("PIN") < 0) - return log_error_errno(errno, "Failed to unset $PIN: %m"); + assert_se(unsetenv_erase("PIN") >= 0); } for (;;) { |