aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypto/krb/valid_cksumtype.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-12-10 17:10:10 +0000
committerGreg Hudson <ghudson@mit.edu>2009-12-10 17:10:10 +0000
commitbad149c2a94f20df57f9d51810aff23aeb0921a4 (patch)
tree9a023564d65fe8c46bcc330f950b37b919599c03 /src/lib/crypto/krb/valid_cksumtype.c
parent009463e22f989a287835228459487c64dcb0b8b3 (diff)
downloadkrb5-bad149c2a94f20df57f9d51810aff23aeb0921a4.zip
krb5-bad149c2a94f20df57f9d51810aff23aeb0921a4.tar.gz
krb5-bad149c2a94f20df57f9d51810aff23aeb0921a4.tar.bz2
Restructure the crypto checksum implementation to minimize
dependencies on the internals of modules. * Keyhash providers are gone. * The cksumtypes table contains checksum and verify functions, similar to the etypes encrypt and decrypt functions. New checksum functions parallel the old keyhash providers, and there are also functions for unkeyed and derived-key HMAC checksums. * The flags field is now used to indicate whether a checksum is unkeyed, but not whether it is a derived-key HMAC checksum. * The descbc checksum is handled through a new enc_provider function which calculates a CBC MAC. The OpenSSL module does not implement the CBC MAC function (it didn't implement descbc before). builtin/des could probably get rid of f_cksum.c (the old DES CBC routine) with some alterations to string2key.c. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23462 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/krb/valid_cksumtype.c')
-rw-r--r--src/lib/crypto/krb/valid_cksumtype.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/crypto/krb/valid_cksumtype.c b/src/lib/crypto/krb/valid_cksumtype.c
index a701efc..07b84fe 100644
--- a/src/lib/crypto/krb/valid_cksumtype.c
+++ b/src/lib/crypto/krb/valid_cksumtype.c
@@ -31,12 +31,10 @@
krb5_boolean KRB5_CALLCONV
krb5_c_valid_cksumtype(krb5_cksumtype ctype)
{
- unsigned int i;
+ const struct krb5_cksumtypes *ctp;
- for (i = 0; i < krb5int_cksumtypes_length; i++) {
- if (krb5int_cksumtypes_list[i].ctype == ctype)
- return TRUE;
- }
-
- return FALSE;
+ ctp = find_cksumtype(ctype);
+ if (ctp == NULL)
+ return FALSE;
+ return TRUE;
}