If we fail to create a cert chain in cms_signeddata_create(), return
KRB5KDC_ERR_PREAUTH_FAILED, which corresponds to a protocol code,
rather than KRB5_PREAUTH_FAILED, which doesn't. This is also more
consistent with other error clauses in the same function.
(cherry picked from commit
cd59782cb32b79e4001a86b0fe47af8b6275ef0c)
ticket: 7718
version_fixed: 1.12
status: resolved
pkiDebug("failed to create a certificate chain: %s\n", msg);
if (!sk_X509_num(id_cryptoctx->trustedCAs))
pkiDebug("No trusted CAs found. Check your X509_anchors\n");
- retval = KRB5_PREAUTH_FAILED;
+ retval = KRB5KDC_ERR_PREAUTH_FAILED;
krb5_set_error_message(context, retval,
_("Cannot create cert chain: %s"), msg);
goto cleanup;