aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-04-12 14:50:28 +0100
committerMatt Caswell <matt@openssl.org>2022-08-18 16:38:12 +0100
commit4030869d24309bfb5292e7bec41cd2b3012ba99d (patch)
tree485386d25b0f37ff92957200aa7902be613af63d /test
parent26dad42e9ca609569073463165263173ab2a27ab (diff)
downloadopenssl-4030869d24309bfb5292e7bec41cd2b3012ba99d.tar.gz
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 <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18132)
Diffstat (limited to 'test')
-rw-r--r--test/sslapitest.c23
1 files changed, 18 insertions, 5 deletions
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