summaryrefslogtreecommitdiff
path: root/src/cryptenroll
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-08-16 16:41:34 +0200
committerLennart Poettering <lennart@poettering.net>2021-08-17 13:17:44 +0200
commit7a6abbe93762fe23d415144ae7a040df3266bb5f (patch)
tree3c241ce87c245becbe36b6e3f1b366b32f2f6461 /src/cryptenroll
parent8b474a437ce980bd0909db59141b40d56f6d5688 (diff)
downloadsystemd-7a6abbe93762fe23d415144ae7a040df3266bb5f.tar.gz
env-util: add unsetenv_erase() helper
Let's unify how we remove secrets from the env block.
Diffstat (limited to 'src/cryptenroll')
-rw-r--r--src/cryptenroll/cryptenroll-password.c4
-rw-r--r--src/cryptenroll/cryptenroll.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cryptenroll/cryptenroll-password.c b/src/cryptenroll/cryptenroll-password.c
index 0314831174..1775912d8e 100644
--- a/src/cryptenroll/cryptenroll-password.c
+++ b/src/cryptenroll/cryptenroll-password.c
@@ -2,6 +2,7 @@
#include "ask-password-api.h"
#include "cryptenroll-password.h"
+#include "env-util.h"
#include "escape.h"
#include "memory-util.h"
#include "pwquality-util.h"
@@ -27,8 +28,7 @@ int enroll_password(
if (!new_password)
return log_oom();
- string_erase(e);
- assert_se(unsetenv("NEWPASSWORD") == 0);
+ assert_se(unsetenv_erase("NEWPASSWORD") >= 0);
} else {
_cleanup_free_ char *disk_path = NULL;
diff --git a/src/cryptenroll/cryptenroll.c b/src/cryptenroll/cryptenroll.c
index f2e194e88c..cf99aab96d 100644
--- a/src/cryptenroll/cryptenroll.c
+++ b/src/cryptenroll/cryptenroll.c
@@ -12,6 +12,7 @@
#include "cryptenroll-wipe.h"
#include "cryptenroll.h"
#include "cryptsetup-util.h"
+#include "env-util.h"
#include "escape.h"
#include "libfido2-util.h"
#include "main-func.h"
@@ -426,8 +427,7 @@ static int prepare_luks(
if (!password)
return log_oom();
- string_erase(e);
- assert_se(unsetenv("PASSWORD") >= 0);
+ assert_se(unsetenv_erase("PASSWORD") >= 0);
r = crypt_volume_key_get(
cd,