aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypto/krb/string_to_cksumtype.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-10-03 16:03:15 +0000
committerGreg Hudson <ghudson@mit.edu>2009-10-03 16:03:15 +0000
commit8025c33f6285b8773a927351c0b3503d878565f1 (patch)
treefe8100e32b4efb5b03a88e065d0bcbc88691c303 /src/lib/crypto/krb/string_to_cksumtype.c
parent0faf98575f91452efee9f4c8d100c83fa9971e46 (diff)
downloadkrb5-8025c33f6285b8773a927351c0b3503d878565f1.zip
krb5-8025c33f6285b8773a927351c0b3503d878565f1.tar.gz
krb5-8025c33f6285b8773a927351c0b3503d878565f1.tar.bz2
Update the crypto API glue to conform to most of the current coding
practices (except lack of tabs). Use the helper functions k5alloc, zapfree, and find_enctype to reduce code size. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22839 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/krb/string_to_cksumtype.c')
-rw-r--r--src/lib/crypto/krb/string_to_cksumtype.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/crypto/krb/string_to_cksumtype.c b/src/lib/crypto/krb/string_to_cksumtype.c
index 5a3c70d..92ecbfa 100644
--- a/src/lib/crypto/krb/string_to_cksumtype.c
+++ b/src/lib/crypto/krb/string_to_cksumtype.c
@@ -31,23 +31,26 @@ krb5_error_code KRB5_CALLCONV
krb5_string_to_cksumtype(char *string, krb5_cksumtype *cksumtypep)
{
unsigned int i, j;
+ const char *alias;
+ const struct krb5_cksumtypes *ctp;
for (i=0; i<krb5_cksumtypes_length; i++) {
- if (strcasecmp(krb5_cksumtypes_list[i].name, string) == 0) {
- *cksumtypep = krb5_cksumtypes_list[i].ctype;
- return(0);
+ ctp = &krb5_cksumtypes_list[i];
+ if (strcasecmp(ctp->name, string) == 0) {
+ *cksumtypep = ctp->ctype;
+ return 0;
}
-#define MAX_ALIASES (sizeof(krb5_cksumtypes_list[i].aliases) / sizeof(krb5_cksumtypes_list[i].aliases[0]))
+#define MAX_ALIASES (sizeof(ctp->aliases) / sizeof(ctp->aliases[0]))
for (j = 0; j < MAX_ALIASES; j++) {
- const char *alias = krb5_cksumtypes_list[i].aliases[j];
+ alias = ctp->aliases[j];
if (alias == NULL)
break;
if (strcasecmp(alias, string) == 0) {
- *cksumtypep = krb5_cksumtypes_list[i].ctype;
+ *cksumtypep = ctp->ctype;
return 0;
}
}
}
- return(EINVAL);
+ return EINVAL;
}