summaryrefslogtreecommitdiffstats
path: root/src/include/fast_factor.h
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-10-06 16:18:56 +0000
committerGreg Hudson <ghudson@mit.edu>2011-10-06 16:18:56 +0000
commit7003d3dbdfd0a7f4f6843068affb290c844ccb65 (patch)
tree2b31a19ce468926f02f471597b68cb60d3bffe82 /src/include/fast_factor.h
parent72dc9d3ca51e6b54f088f7dc6a68c38504cde1d9 (diff)
downloadkrb5-7003d3dbdfd0a7f4f6843068affb290c844ccb65.tar.gz
krb5-7003d3dbdfd0a7f4f6843068affb290c844ccb65.tar.xz
krb5-7003d3dbdfd0a7f4f6843068affb290c844ccb65.zip
Use type-safe callbacks in preauth interface
Replace the generic get_data functions in clpreauth and kdcpreauth with structures containing callback functions. Each structure has a minor version number to allow adding new callbacks. For simplicity, the new fast armor key callbacks return aliases, which is how we would supply the armor key as a function parameter. The new client keys callback is paired with a free_keys callback to reduce the amount of cleanup code needed in modules. ticket: 6971 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25315 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/fast_factor.h')
-rw-r--r--src/include/fast_factor.h42
1 files changed, 2 insertions, 40 deletions
diff --git a/src/include/fast_factor.h b/src/include/fast_factor.h
index 734d377797..32581bd44f 100644
--- a/src/include/fast_factor.h
+++ b/src/include/fast_factor.h
@@ -26,47 +26,9 @@
#ifndef FAST_FACTOR_H
-/*
- * Returns success with a null armor_key if FAST is available but not in use.
- * Returns failure if the client library does not support FAST.
- */
-static inline krb5_error_code
-fast_get_armor_key(krb5_context context, krb5_clpreauth_get_data_fn get_data,
- krb5_clpreauth_rock rock, krb5_keyblock **armor_key)
-{
- krb5_error_code retval = 0;
- krb5_data *data;
- retval = get_data(context, rock, krb5_clpreauth_fast_armor, &data);
- if (retval == 0) {
- *armor_key = (krb5_keyblock *) data->data;
- data->data = NULL;
- get_data(context, rock, krb5_clpreauth_free_fast_armor, &data);
- }
- return retval;
-}
-
-static inline krb5_error_code
-fast_kdc_get_armor_key(krb5_context context,
- krb5_kdcpreauth_get_data_fn get_data,
- krb5_kdcpreauth_rock rock,
- krb5_keyblock **armor_key)
-{
- krb5_error_code retval;
- krb5_data *data;
- retval = (*get_data)(context, rock, krb5_kdcpreauth_fast_armor, &data);
- if (retval == 0) {
- *armor_key = (krb5_keyblock *) data->data;
- data->data = NULL;
- (*get_data)(context, rock, krb5_kdcpreauth_free_fast_armor, &data);
- }
- return retval;
-}
-
-
-
static inline krb5_error_code
fast_kdc_replace_reply_key(krb5_context context,
- krb5_kdcpreauth_get_data_fn get,
+ krb5_kdcpreauth_callbacks cb,
krb5_kdcpreauth_rock rock)
{
return 0;
@@ -74,7 +36,7 @@ fast_kdc_replace_reply_key(krb5_context context,
static inline krb5_error_code
fast_set_kdc_verified(krb5_context context,
- krb5_clpreauth_get_data_fn get_data,
+ krb5_clpreauth_callbacks cb,
krb5_clpreauth_rock rock)
{
return 0;