[25828] in CVS-changelog-for-Kerberos-V5
svn rev #25318: trunk/src/ include/krb5/ kdc/
daemon@ATHENA.MIT.EDU (ghudson@mit.edu)
Thu Oct 6 16:08:31 2011
Date: Thu, 6 Oct 2011 16:08:29 -0400
From: ghudson@mit.edu
Message-Id: <201110062008.p96K8Tic002176@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
http://src.mit.edu/fisheye/changelog/krb5/?cs=25318
Commit By: ghudson
Log Message:
Add get_string, free_string kdcpreauth callbacks.
String attributes should be useful to preauth modules without having
to link against libkdb5. Add a callback to make client string
attributes accessible to modules.
Changed Files:
U trunk/src/include/krb5/preauth_plugin.h
U trunk/src/kdc/kdc_preauth.c
Modified: trunk/src/include/krb5/preauth_plugin.h
===================================================================
--- trunk/src/include/krb5/preauth_plugin.h 2011-10-06 19:24:56 UTC (rev 25317)
+++ trunk/src/include/krb5/preauth_plugin.h 2011-10-06 20:08:29 UTC (rev 25318)
@@ -355,6 +355,16 @@
krb5_keyblock *(*fast_armor)(krb5_context context,
krb5_kdcpreauth_rock rock);
+ /* Retrieve a string attribute from the client DB entry, or NULL if no such
+ * attribute is set. Free the result with the free_string callback. */
+ krb5_error_code (*get_string)(krb5_context context,
+ krb5_kdcpreauth_rock rock, const char *key,
+ char **value_out);
+
+ /* Free the result of get_string. */
+ void (*free_string)(krb5_context context, krb5_kdcpreauth_rock rock,
+ char *string);
+
/* Get a pointer to the client DB entry (returned as a void pointer to
* avoid a dependency on a libkdb5 type). */
void *(*client_entry)(krb5_context context, krb5_kdcpreauth_rock rock);
Modified: trunk/src/kdc/kdc_preauth.c
===================================================================
--- trunk/src/kdc/kdc_preauth.c 2011-10-06 19:24:56 UTC (rev 25317)
+++ trunk/src/kdc/kdc_preauth.c 2011-10-06 20:08:29 UTC (rev 25318)
@@ -574,6 +574,19 @@
return rock->rstate->armor_key;
}
+static krb5_error_code
+get_string(krb5_context context, krb5_kdcpreauth_rock rock, const char *key,
+ char **value_out)
+{
+ return krb5_dbe_get_string(context, rock->client, key, value_out);
+}
+
+static void
+free_string(krb5_context context, krb5_kdcpreauth_rock rock, char *string)
+{
+ krb5_dbe_free_string(context, string);
+}
+
static void *
client_entry(krb5_context context, krb5_kdcpreauth_rock rock)
{
@@ -587,6 +600,8 @@
free_keys,
request_body,
fast_armor,
+ get_string,
+ free_string,
client_entry
};
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5