From: Dr. David von Oheimb Date: Mon, 4 May 2020 17:53:09 +0000 (+0200) Subject: Fix bug in OSSL_CMP_SRV_process_request() on transaction renewal X-Git-Tag: openssl-3.0.0-alpha2~55 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=045229cfe88aba44f8b67e7306281f6fbf516625;p=oweals%2Fopenssl.git Fix bug in OSSL_CMP_SRV_process_request() on transaction renewal Reviewed-by: Matt Caswell Reviewed-by: Viktor Dukhovni (Merged from https://github.com/openssl/openssl/pull/11736) --- diff --git a/crypto/cmp/cmp_server.c b/crypto/cmp/cmp_server.c index 4da9a4436f..8bd3b56a26 100644 --- a/crypto/cmp/cmp_server.c +++ b/crypto/cmp/cmp_server.c @@ -489,9 +489,9 @@ OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx, tid); OPENSSL_free(tid); } - /* start of a new transaction, set transactionID and senderNonce */ - if (!OSSL_CMP_CTX_set1_transactionID(ctx, hdr->transactionID) - || !ossl_cmp_ctx_set1_recipNonce(ctx, hdr->senderNonce)) + /* start of a new transaction, reset transactionID and senderNonce */ + if (!OSSL_CMP_CTX_set1_transactionID(ctx, NULL) + || !OSSL_CMP_CTX_set1_senderNonce(ctx, NULL)) goto err; break; default: @@ -594,7 +594,9 @@ OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx, case OSSL_CMP_PKIBODY_GENP: case OSSL_CMP_PKIBODY_ERROR: /* TODO possibly support further terminating response message types */ - (void)OSSL_CMP_CTX_set1_transactionID(ctx, NULL); /* ignore any error */ + /* prepare for next transaction, ignoring any errors here: */ + (void)OSSL_CMP_CTX_set1_transactionID(ctx, NULL); + (void)OSSL_CMP_CTX_set1_senderNonce(ctx, NULL); default: /* not closing transaction in other cases */ break;