*
* The certauth pluggable interface currently has only one supported major
* version, which is 1. Major version 1 has a current minor version number of
- * 1.
+ * 2.
*
* certauth plugin modules should define a function named
* certauth_<modulename>_initvt, matching the signature:
(*krb5_certauth_init_fn)(krb5_context context,
krb5_certauth_moddata *moddata_out);
+/*
+ * Optional: Initialize module data. Supersedes init if present.
+ */
+typedef krb5_error_code
+(*krb5_certauth_init_ex_fn)(krb5_context context, const char *const *realmlist,
+ krb5_certauth_moddata *moddata_out);
+
/*
* Optional: Clean up the module data.
*/
krb5_certauth_fini_fn fini;
krb5_certauth_authorize_fn authorize;
krb5_certauth_free_indicator_fn free_ind;
+ /* Minor version 1 ends here. */
+
+ krb5_certauth_init_ex_fn init_ex;
+ /* Minor version 2 ends here. */
} *krb5_certauth_vtable;
#endif /* KRB5_CERTAUTH_PLUGIN_H */
}
static krb5_error_code
-load_certauth_plugins(krb5_context context, certauth_handle **handle_out)
+load_certauth_plugins(krb5_context context, const char *const *realmnames,
+ certauth_handle **handle_out)
{
krb5_error_code ret;
krb5_plugin_initvt_fn *modules = NULL, *mod;
if (h == NULL)
goto cleanup;
- ret = (*mod)(context, 1, 1, (krb5_plugin_vtable)&h->vt);
+ ret = (*mod)(context, 1, 2, (krb5_plugin_vtable)&h->vt);
if (ret) {
TRACE_CERTAUTH_VTINIT_FAIL(context, ret);
free(h);
continue;
}
h->moddata = NULL;
- if (h->vt.init != NULL) {
+ if (h->vt.init_ex != NULL)
+ ret = h->vt.init_ex(context, realmnames, &h->moddata);
+ else if (h->vt.init != NULL)
ret = h->vt.init(context, &h->moddata);
- if (ret) {
- TRACE_CERTAUTH_INIT_FAIL(context, h->vt.name, ret);
- free(h);
- continue;
- }
+ if (ret) {
+ TRACE_CERTAUTH_INIT_FAIL(context, h->vt.name, ret);
+ free(h);
+ continue;
}
list[count++] = h;
list[count] = NULL;
goto errout;
}
- retval = load_certauth_plugins(context, &certauth_modules);
+ retval = load_certauth_plugins(context, realmnames, &certauth_modules);
if (retval)
goto errout;