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);
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)
{
free_keys,
request_body,
fast_armor,
+ get_string,
+ free_string,
client_entry
};