1

(7 replies, posted in wolfSSL)

After introducing more debug statements I found out that

TLSX_Write()

skips my extension because some semaphore is being held.
I have no idea why this semaphore is switched on, however. I didn't switch it on myself.
It comes from

TLSX_WriteRequest()

I really put hours into trying to fix this one single behaviour, because it's difficult to navigate the source code of wolfSSL without much documentation.

2

(7 replies, posted in wolfSSL)

Hello Anthony

I tried using the debugger and I don't see it being written to the extension data.
That's what I am confused about as I thought I'd have written enough code for that to happen.
Unless wolfSSL does smth. unexpected somewhere.

I readded the file, apparently I had to  press two buttons for the upload :-)

3

(7 replies, posted in wolfSSL)

Hello Anthony

The decode error inside wolfSSL is a BUFFER_ERROR inside DoTls13SupportedVersions during the ClientHello check for extensions.

/* TLS 1.3 must have extensions */
if (i < helloSz) {
    if (i + OPAQUE16_LEN > helloSz)
        return BUFFER_ERROR;
    ato16(&input[i], &totalExtSz);
    i += OPAQUE16_LEN;
    if (totalExtSz != helloSz - i)    // failure here
        return BUFFER_ERROR;
...

I have appended a wireshark capture of a tried connection.
The extension length field is correct
The overall handshake length field is off by 5 zeroed bytes at the very end of the handshake which correspond exactly to my custom extension:
- 2 bytes extension type
- 2 bytes extension length
- 1 byte extension data

Thank you for trying to help me!

4

(7 replies, posted in wolfSSL)

Hello everyone

For my Master thesis I am playing around with an implementation of Remote Attestation into TLS using wolfSSL.
I've created necessary functions and implemented reading and writing the extension data from/to in-/outcoming messages.

I am using a small playground to test this communication between a client and a server.
However, whatever I do, the extension data is somehow not being written into the ClientHello message correctly, whereas the total extension size counter gets increased.
This of course results in a decode error on the server side.

I added log statements and it seems that writing the extension data inside the switch branch of the new extension never gets executed, as if the extension wasn't there.
Maybe I miss something obvious? I'd be very glad if someone can look over my changes.
I already put weeks of try-and-error into it, following and debugging the code flow and it just doesn't make sense to me.

My (dummy implementation) changes can be found here: https://github.com/joeftiger/wolfssl/tree/RA
And my playground implementation is here: https://github.com/joeftiger/wolfssl-playground/tree/RA

I tried to keep this implementation example minimal by using only 1 byte as extension data.

Thank you very much for your help!