From 7a6abbe93762fe23d415144ae7a040df3266bb5f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 16 Aug 2021 16:41:34 +0200 Subject: env-util: add unsetenv_erase() helper Let's unify how we remove secrets from the env block. --- src/cryptsetup/cryptsetup-fido2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/cryptsetup/cryptsetup-fido2.c') 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 (;;) { -- cgit v1.2.1