From ca999f932c1c2ca1753d3fb674f01d6a0b9536aa Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 2 Feb 2023 14:49:15 -0800 Subject: [PATCH] SRTP Marshaling 1. Changed the loop over the SRTP setting bitfield when it is encoded for the TLS extension. --- src/tls.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tls.c b/src/tls.c index 321586344..d18fe1d70 100644 --- a/src/tls.c +++ b/src/tls.c @@ -5698,12 +5698,13 @@ static word16 TLSX_UseSRTP_Write(TlsxSrtp* srtp, byte* output) word16 offset = 0; int i, j; - c16toa(srtp->profileCount*2, output+offset); + c16toa(srtp->profileCount * 2, output + offset); offset += OPAQUE16_LEN; - for (i=0; i< srtp->profileCount; i+=2) { - for (j=0; j<16; j++) { + j = 0; + for (i = 0; i < srtp->profileCount; i++) { + for (; j < 16; j++) { if (srtp->ids & (1 << j)) { - c16toa(j, output+offset); + c16toa(j, output + offset); offset += OPAQUE16_LEN; } }