Repeating an identical typedef is allowed by C11, but not C99 or C89.
Use the underlying structure type in certauth_plugin.h so that it can
safely be included along with kdb.h.
Also constify the name field in the vtable.
ticket: 8561
/* Abstract module data type. */
typedef struct krb5_certauth_moddata_st *krb5_certauth_moddata;
-typedef struct _krb5_db_entry_new krb5_db_entry;
+/* A module can optionally include <kdb.h> to inspect the client principal
+ * entry when authorizing a request. */
+struct _krb5_db_entry_new;
/*
* Optional: Initialize module data.
krb5_certauth_moddata moddata,
const uint8_t *cert, size_t cert_len,
krb5_const_principal princ, const void *opts,
- const krb5_db_entry *db_entry,
+ const struct _krb5_db_entry_new *db_entry,
char ***authinds_out);
/*
char **authinds);
typedef struct krb5_certauth_vtable_st {
- char *name;
+ const char *name;
krb5_certauth_init_fn init;
krb5_certauth_fini_fn fini;
krb5_certauth_authorize_fn authorize;
test1_authorize(krb5_context context, krb5_certauth_moddata moddata,
const uint8_t *cert, size_t cert_len,
krb5_const_principal princ, const void *opts,
- const krb5_db_entry *db_entry, char ***authinds_out)
+ const struct _krb5_db_entry_new *db_entry,
+ char ***authinds_out)
{
char **ais = NULL;
test2_authorize(krb5_context context, krb5_certauth_moddata moddata,
const uint8_t *cert, size_t cert_len,
krb5_const_principal princ, const void *opts,
- const krb5_db_entry *db_entry, char ***authinds_out)
+ const struct _krb5_db_entry_new *db_entry,
+ char ***authinds_out)
{
krb5_error_code ret;
char *name = NULL, **ais = NULL;
pkinit_san_authorize(krb5_context context, krb5_certauth_moddata moddata,
const uint8_t *cert, size_t cert_len,
krb5_const_principal princ, const void *opts,
- const krb5_db_entry *db_entry, char ***authinds_out)
+ const struct _krb5_db_entry_new *db_entry,
+ char ***authinds_out)
{
krb5_error_code ret;
int valid_san;
pkinit_eku_authorize(krb5_context context, krb5_certauth_moddata moddata,
const uint8_t *cert, size_t cert_len,
krb5_const_principal princ, const void *opts,
- const krb5_db_entry *db_entry, char ***authinds_out)
+ const struct _krb5_db_entry_new *db_entry,
+ char ***authinds_out)
{
krb5_error_code ret;
int valid_eku;
dbmatch_authorize(krb5_context context, krb5_certauth_moddata moddata,
const uint8_t *cert, size_t cert_len,
krb5_const_principal princ, const void *opts,
- const krb5_db_entry *db_entry, char ***authinds_out)
+ const struct _krb5_db_entry_new *db_entry,
+ char ***authinds_out)
{
krb5_error_code ret;
const struct certauth_req_opts *req_opts = opts;