diff options
author | Tobias Heider <tobhe@cvs.openbsd.org> | 2021-10-12 09:27:22 +0000 |
---|---|---|
committer | Tobias Heider <tobhe@cvs.openbsd.org> | 2021-10-12 09:27:22 +0000 |
commit | 85d4e994fb2d7a79a137508db85120226fc9922a (patch) | |
tree | f8a6a3fb0e11cb197ce2a788964c8adfe5845966 /sbin/iked/config.c | |
parent | 6425c53ed1ee106c4e6efe0e0156bf72c41f3536 (diff) |
Make sure all copies of MSCHAPv2 passphrase are zeroed after use.
ok patrick@
Diffstat (limited to 'sbin/iked/config.c')
-rw-r--r-- | sbin/iked/config.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sbin/iked/config.c b/sbin/iked/config.c index 87047a1f326..50b73b67c1a 100644 --- a/sbin/iked/config.c +++ b/sbin/iked/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.81 2021/09/18 16:45:07 deraadt Exp $ */ +/* $OpenBSD: config.c,v 1.82 2021/10/12 09:27:21 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de> @@ -670,16 +670,18 @@ int config_getuser(struct iked *env, struct imsg *imsg) { struct iked_user usr; + int ret = -1; IMSG_SIZE_CHECK(imsg, &usr); memcpy(&usr, imsg->data, sizeof(usr)); - if (config_new_user(env, &usr) == NULL) - return (-1); - - print_user(&usr); + if (config_new_user(env, &usr) != NULL) { + print_user(&usr); + ret = 0; + } - return (0); + explicit_bzero(&usr, sizeof(usr)); + return (ret); } int |