Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-9430 utils: fix logic errors and putchar in sk_name2hmac()
[fs/lustre-release.git]
/
lustre
/
utils
/
gss
/
lgss_sk.c
diff --git
a/lustre/utils/gss/lgss_sk.c
b/lustre/utils/gss/lgss_sk.c
index
825146e
..
d036450
100644
(file)
--- a/
lustre/utils/gss/lgss_sk.c
+++ b/
lustre/utils/gss/lgss_sk.c
@@
-83,15
+83,15
@@
enum cfs_crypto_hash_alg sk_name2hmac(char *name)
/* convert to lower case */
while (name[i]) {
/* convert to lower case */
while (name[i]) {
-
putchar(tolower(name[i])
);
+
name[i] = tolower(name[i]
);
i++;
}
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;