zkey: Use secure_getenv() instead of getenv() for all environment variables

... to avoid vulnerabilities that could occur if set-user-ID or
set-group-ID programs accidentally trusted the environment.

zkey is usually NOT a set-user-ID or set-group-ID program, but its
safer to use secure_getenv() anyway.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2021-06-21 11:26:23 +02:00
committed by Jan Höppner
parent 8723dbce04
commit 02aaff72fa
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -2894,7 +2894,7 @@ static int open_keystore(void)
{
char *directory;
directory = getenv(ENVVAR_ZKEY_REPOSITORY);
directory = secure_getenv(ENVVAR_ZKEY_REPOSITORY);
if (directory == NULL)
directory = DEFAULT_KEYSTORE;