}
if (processing_request) {
+ if (reqctx->idopts->anchors == NULL) {
+ krb5_set_error_message(context, KRB5_PREAUTH_FAILED,
+ _("No pkinit_anchors supplied"));
+ return KRB5_PREAUTH_FAILED;
+ }
pkinit_client_profile(context, plgctx, reqctx, cb, rock,
&request->server->realm);
/* Pull in PINs and passwords for identities which we deferred
int do_matching,
krb5_principal princ)
{
- krb5_error_code retval = EINVAL;
+ krb5_error_code retval = 0;
const char *signer_identity;
+ krb5_boolean valid;
int i;
pkiDebug("%s: %p %p %p\n", __FUNCTION__, context, idopts, id_cryptoctx);
goto errout;
} /* Not anonymous principal */
+ /* Require at least one successful anchor if any are specified. */
+ valid = FALSE;
for (i = 0; idopts->anchors != NULL && idopts->anchors[i] != NULL; i++) {
retval = process_option_ca_crl(context, plg_cryptoctx, req_cryptoctx,
idopts, id_cryptoctx,
idopts->anchors[i], CATYPE_ANCHORS);
- if (retval)
- goto errout;
+ if (!retval)
+ valid = TRUE;
}
+ if (retval && !valid)
+ goto errout;
+ krb5_clear_error_message(context);
+ retval = 0;
+
+ /* Require at least one successful intermediate if any are specified. */
+ valid = FALSE;
for (i = 0; idopts->intermediates != NULL
&& idopts->intermediates[i] != NULL; i++) {
retval = process_option_ca_crl(context, plg_cryptoctx, req_cryptoctx,
idopts, id_cryptoctx,
idopts->intermediates[i],
CATYPE_INTERMEDIATES);
- if (retval)
- goto errout;
+ if (!retval)
+ valid = TRUE;
}
+ if (retval && !valid)
+ goto errout;
+ krb5_clear_error_message(context);
+ retval = 0;
+
for (i = 0; idopts->crls != NULL && idopts->crls[i] != NULL; i++) {
retval = process_option_ca_crl(context, plg_cryptoctx, req_cryptoctx,
idopts, id_cryptoctx, idopts->crls[i],