aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypto/krb/etypes.h
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-12-04 05:12:35 +0000
committerGreg Hudson <ghudson@mit.edu>2009-12-04 05:12:35 +0000
commit5ffa313d9f6b7c509aa0d7579273150d71ea0f95 (patch)
tree48f8d5606c919dd09d950c5cbf1609f312f2937d /src/lib/crypto/krb/etypes.h
parentea6f77d42700352fcb2a06444d1dc00acf7c20fc (diff)
downloadkrb5-5ffa313d9f6b7c509aa0d7579273150d71ea0f95.zip
krb5-5ffa313d9f6b7c509aa0d7579273150d71ea0f95.tar.gz
krb5-5ffa313d9f6b7c509aa0d7579273150d71ea0f95.tar.bz2
Consolidate the IOV and non-IOV encryption/decryption code paths, and
drop the _iov suffix from most encryption- and decryption-related functions. The enc_provider encrypt and decrypt functions take IOVs, as do the enctype entries in etypes.c, and there are no separate encrypt_iov or decrypt_iov functions. aead_provider is gone. Enctype functions now take pointers to the enctype entry instead of pointers to the enc/hash/aead providers; this allows dk_encrypt and dk_decrypt to be polymorphic in the length function they use now that AES and DES3 can't differentiate by aead provider. aes_string_to_key needed to be moved into the krb/ fold for this since it's an enctype function; it was duplicated between builtin/ and openssl/ before. This leaves openssl/aes empty; the build system currently demands that all modules have the same directory structure, so the directory and Makefile will stick around for now. Three separate copies of the derive_random logic are also now consolidated into one. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23444 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/krb/etypes.h')
-rw-r--r--src/lib/crypto/krb/etypes.h53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/lib/crypto/krb/etypes.h b/src/lib/crypto/krb/etypes.h
index 57cca74..be737cb 100644
--- a/src/lib/crypto/krb/etypes.h
+++ b/src/lib/crypto/krb/etypes.h
@@ -25,32 +25,30 @@
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+#ifndef ETYPES_H
+#define ETYPES_H
+
#include "k5-int.h"
-typedef void (*krb5_encrypt_length_func)(const struct krb5_enc_provider *enc,
- const struct krb5_hash_provider *hash,
- size_t inputlen, size_t *length);
+struct krb5_keytypes;
+
+typedef unsigned int (*crypto_length_func)(const struct krb5_keytypes *ktp,
+ krb5_cryptotype type);
-typedef krb5_error_code (*krb5_crypt_func)(const struct krb5_enc_provider *enc,
- const struct
- krb5_hash_provider *hash,
- krb5_key key,
- krb5_keyusage keyusage,
- const krb5_data *ivec,
- const krb5_data *input,
- krb5_data *output);
+typedef krb5_error_code (*crypt_func)(const struct krb5_keytypes *ktp,
+ krb5_key key, krb5_keyusage keyusage,
+ const krb5_data *ivec,
+ krb5_crypto_iov *data, size_t num_data);
-typedef krb5_error_code (*krb5_str2key_func)(const struct
- krb5_enc_provider *enc,
- const krb5_data *string,
- const krb5_data *salt,
- const krb5_data *parm,
- krb5_keyblock *key);
+typedef krb5_error_code (*str2key_func)(const struct krb5_keytypes *ktp,
+ const krb5_data *string,
+ const krb5_data *salt,
+ const krb5_data *parm,
+ krb5_keyblock *key);
-typedef krb5_error_code (*krb5_prf_func)(const struct krb5_enc_provider *enc,
- const struct krb5_hash_provider *hash,
- krb5_key key,
- const krb5_data *in, krb5_data *out);
+typedef krb5_error_code (*prf_func)(const struct krb5_keytypes *ktp,
+ krb5_key key,
+ const krb5_data *in, krb5_data *out);
struct krb5_keytypes {
krb5_enctype etype;
@@ -60,13 +58,12 @@ struct krb5_keytypes {
const struct krb5_enc_provider *enc;
const struct krb5_hash_provider *hash;
size_t prf_length;
- krb5_encrypt_length_func encrypt_len;
- krb5_crypt_func encrypt;
- krb5_crypt_func decrypt;
- krb5_str2key_func str2key;
- krb5_prf_func prf;
+ crypto_length_func crypto_length;
+ crypt_func encrypt;
+ crypt_func decrypt;
+ str2key_func str2key;
+ prf_func prf;
krb5_cksumtype required_ctype;
- const struct krb5_aead_provider *aead;
krb5_flags flags;
};
@@ -89,3 +86,5 @@ find_enctype(krb5_enctype enctype)
return NULL;
return &krb5int_enctypes_list[i];
}
+
+#endif