From c04de52da4e89e15b211b4a19a3d9bc4d612b209 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 26 Feb 2013 12:10:17 +0000 Subject: [PATCH] bosserver: Return error if key is bad If a key is bad, have SBOZO_ListKeys return an error, rather than silently ignoring the result from ka_KeyCheckSum. Caught by coverity (#988413) Change-Id: Ifacc9bac654d2632bd31731995795b786d485327 Reviewed-on: http://gerrit.openafs.org/9270 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/bozo/bosoprocs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bozo/bosoprocs.c b/src/bozo/bosoprocs.c index 5204002b7..d90ed950b 100644 --- a/src/bozo/bosoprocs.c +++ b/src/bozo/bosoprocs.c @@ -612,8 +612,10 @@ SBOZO_ListKeys(struct rx_call *acall, afs_int32 an, afs_int32 *akvno, if (code == 0) { akeyinfo->mod_sec = tstat.st_mtime; } - ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum); - /* only errors is bad key parity */ + + /* If the key is bad, this will produce an error. Should never happen, + * but ... */ + code = ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum); fail: if (noauth) -- 2.39.5