aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypto/krb/keyed_cksum.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/keyed_cksum.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/keyed_cksum.c')
-rw-r--r--src/lib/crypto/krb/keyed_cksum.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/lib/crypto/krb/keyed_cksum.c b/src/lib/crypto/krb/keyed_cksum.c
index 2f8bed6..b6d3e3d 100644
--- a/src/lib/crypto/krb/keyed_cksum.c
+++ b/src/lib/crypto/krb/keyed_cksum.c
@@ -31,17 +31,10 @@
krb5_boolean KRB5_CALLCONV
krb5_c_is_keyed_cksum(krb5_cksumtype ctype)
{
- unsigned int i;
const struct krb5_cksumtypes *ctp;
- for (i = 0; i < krb5int_cksumtypes_length; i++) {
- ctp = &krb5int_cksumtypes_list[i];
- if (ctp->ctype == ctype) {
- return (ctp->keyhash != NULL ||
- (ctp->flags & KRB5_CKSUMFLAG_DERIVE));
- }
- }
-
- /* Invalid ctype. This is misleading, but better than dumping core. */
- return FALSE;
+ ctp = find_cksumtype(ctype);
+ if (ctp == NULL)
+ return FALSE;
+ return !(ctp->flags & CKSUM_UNKEYED);
}