CMP test server: Extend error reporting on cert rejected for revocation

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15053)
This commit is contained in:
Dr. David von Oheimb 2021-05-10 14:36:20 +02:00 committed by Dr. David von Oheimb
parent cc1af4dbfe
commit ca8f823ffd
2 changed files with 3 additions and 2 deletions

View File

@ -251,7 +251,8 @@ static OSSL_CMP_PKISI *process_rr(OSSL_CMP_SRV_CTX *srv_ctx,
if (X509_NAME_cmp(issuer, X509_get_issuer_name(ctx->certOut)) != 0 if (X509_NAME_cmp(issuer, X509_get_issuer_name(ctx->certOut)) != 0
|| ASN1_INTEGER_cmp(serial, || ASN1_INTEGER_cmp(serial,
X509_get0_serialNumber(ctx->certOut)) != 0) { X509_get0_serialNumber(ctx->certOut)) != 0) {
ERR_raise(ERR_LIB_CMP, CMP_R_REQUEST_NOT_ACCEPTED); ERR_raise_data(ERR_LIB_CMP, CMP_R_REQUEST_NOT_ACCEPTED,
"wrong certificate to revoke");
return NULL; return NULL;
} }
return OSSL_CMP_PKISI_dup(ctx->statusOut); return OSSL_CMP_PKISI_dup(ctx->statusOut);

View File

@ -581,7 +581,7 @@ OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx,
} }
if ((si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection, if ((si = OSSL_CMP_STATUSINFO_new(OSSL_CMP_PKISTATUS_rejection,
fail_info, NULL)) != NULL) { fail_info, data)) != NULL) {
if (err != 0 && (flags & ERR_TXT_STRING) != 0) if (err != 0 && (flags & ERR_TXT_STRING) != 0)
data = ERR_reason_error_string(err); data = ERR_reason_error_string(err);
rsp = ossl_cmp_error_new(srv_ctx->ctx, si, rsp = ossl_cmp_error_new(srv_ctx->ctx, si,