From 4030869d24309bfb5292e7bec41cd2b3012ba99d Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 12 Apr 2022 14:50:28 +0100 Subject: Convert ssl3_get_record to tls_read_record We move the old ssl3_get_record function to conform with the new record layer design. Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18132) --- test/sslapitest.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/sslapitest.c b/test/sslapitest.c index 00e9ba39ae..e06d882556 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -1541,7 +1541,6 @@ static int execute_cleanse_plaintext(const SSL_METHOD *smeth, SSL_CTX *cctx = NULL, *sctx = NULL; SSL *clientssl = NULL, *serverssl = NULL; int testresult = 0; - SSL3_RECORD *rr; void *zbuf; SSL_CONNECTION *serversc; @@ -1606,10 +1605,24 @@ static int execute_cleanse_plaintext(const SSL_METHOD *smeth, */ if (!TEST_ptr(serversc = SSL_CONNECTION_FROM_SSL_ONLY(serverssl))) goto end; - rr = serversc->rlayer.rrec; - zbuf = &rr->data[rr->off]; - if (!TEST_int_eq(rr->length, sizeof(cbuf))) - goto end; + + /* + * TODO(RECLAYER): This is temporary until DTLS is converted to use the new + * record layer code. + */ + if (!SSL_is_dtls(serverssl)) { + TLS_RECORD *rr = serversc->rlayer.tlsrecs; + + zbuf = &rr->data[rr->off]; + if (!TEST_int_eq(rr->length, sizeof(cbuf))) + goto end; + } else { + SSL3_RECORD *rr = serversc->rlayer.rrec; + + zbuf = &rr->data[rr->off]; + if (!TEST_int_eq(rr->length, sizeof(cbuf))) + goto end; + } /* * After SSL_peek() the plaintext must still be stored in the -- cgit v1.2.3