]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
bosserver: Return error if key is bad
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 26 Feb 2013 12:10:17 +0000 (12:10 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 26 Jun 2014 09:23:30 +0000 (05:23 -0400)
If a key is bad, have SBOZO_ListKeys return an error, rather than
silently ignoring the result from ka_KeyCheckSum.

Caught by coverity (#988413)

Reviewed-on: http://gerrit.openafs.org/9270
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit c04de52da4e89e15b211b4a19a3d9bc4d612b209)

Change-Id: I7474da0967d759fc4359140c9057ac997935dc76
Reviewed-on: http://gerrit.openafs.org/11014
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/bozo/bosoprocs.c

index 0ab80028b7e3a1b8f37f3bf84b2268fe793c0b80..c3e2cd99260e1069805c7d0db8e53120bedad138 100644 (file)
@@ -628,8 +628,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)