diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-08-28 13:13:05 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-09-14 16:07:18 +0300 |
commit | d607dfd878700648a7cc07ab40b2faf77df29acd (patch) | |
tree | 5f157bfa9dc5bcb75ed152d07f28a044687434ac /lib/rsa/rsa-sign.c | |
parent | 5c25757326ba2481490ebe0f0d59f5933e31d45d (diff) | |
download | u-boot-d607dfd878700648a7cc07ab40b2faf77df29acd.tar.xz |
lib/rsa: don't use NULL as key_id
If keydir is not provided but name is we want to use name as key_id.
But with the current coding name is only used on its own if it is NULL
and keydir is provided which never occurs.
Fixes: 824ee745fbca ("lib/rsa: Use the 'keyfile' argument from mkimage")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/rsa/rsa-sign.c')
-rw-r--r-- | lib/rsa/rsa-sign.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index 085dc89bf7..0e0a890fd1 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -269,7 +269,7 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name, snprintf(key_id, sizeof(key_id), "%s%s", keydir, name); - else if (keydir) + else if (name) snprintf(key_id, sizeof(key_id), "%s", name); |