diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-02-06 13:35:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-06 13:35:56 +0100 |
commit | 9194199c9894c5fd4f497fbbf5fc0449686c8fe5 (patch) | |
tree | 28fcef4121e585704b6d695d2113a037a165141e /src/shared/ask-password-api.c | |
parent | 65c8834942a5ca2d2016f28c4dfc6738a717ed69 (diff) | |
parent | 1075122f42211ddb319126d6713a68a05056cd9d (diff) |
Merge pull request #5237 from keszybz/explicit-bzero
Use `explicit_bzero`
Diffstat (limited to 'src/shared/ask-password-api.c')
-rw-r--r-- | src/shared/ask-password-api.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index 3e877920da..e3b29e390c 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -95,7 +95,7 @@ static int retrieve_key(key_serial_t serial, char ***ret) { if (n < m) break; - memory_erase(p, n); + explicit_bzero(p, n); free(p); m *= 2; } @@ -104,7 +104,7 @@ static int retrieve_key(key_serial_t serial, char ***ret) { if (!l) return -ENOMEM; - memory_erase(p, n); + explicit_bzero(p, n); *ret = l; return 0; @@ -140,7 +140,7 @@ static int add_to_keyring(const char *keyname, AskPasswordFlags flags, char **pa return r; serial = add_key("user", keyname, p, n, KEY_SPEC_USER_KEYRING); - memory_erase(p, n); + explicit_bzero(p, n); if (serial == -1) return -errno; @@ -390,7 +390,7 @@ int ask_password_tty( } x = strndup(passphrase, p); - memory_erase(passphrase, p); + explicit_bzero(passphrase, p); if (!x) { r = -ENOMEM; goto finish; @@ -647,7 +647,7 @@ int ask_password_agent( l = strv_new("", NULL); else l = strv_parse_nulstr(passphrase+1, n-1); - memory_erase(passphrase, n); + explicit_bzero(passphrase, n); if (!l) { r = -ENOMEM; goto finish; |