In the sk_name2hmac function in lgss_sk.c, there are a couple minor
errors: bad usage of strcmp(), use of putchar() instead of assigning
a lowercased value, and use of a logical OR instead of AND.
These errors would prevent proper creation of shared keys in certain
circumstances.
Signed-off-by: Chris Hanna <hannac@iu.edu>
Change-Id: I16462f15201626f194e1b452acf3a1e63dbf0ed7
Reviewed-on: https://review.whamcloud.com/26920
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
/* convert to lower case */
while (name[i]) {
/* convert to lower case */
while (name[i]) {
- putchar(tolower(name[i]));
+ name[i] = tolower(name[i]);
- if (strcmp(name, "none"))
+ if (strcmp(name, "none") == 0)
return CFS_HASH_ALG_NULL;
algo = cfs_crypto_hash_alg(name);
return CFS_HASH_ALG_NULL;
algo = cfs_crypto_hash_alg(name);
- if ((algo != CFS_HASH_ALG_SHA256) ||
+ if ((algo != CFS_HASH_ALG_SHA256) &&
(algo != CFS_HASH_ALG_SHA512))
return SK_HMAC_INVALID;
(algo != CFS_HASH_ALG_SHA512))
return SK_HMAC_INVALID;