wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

[Bug]: Selection between status_request and status_request_v2 inconsistent

Open jensguballa opened this issue 4 years ago • 5 comments

Contact Details

No response

Version

5.2.0

Description

./configure --enable-ocspstapling --enable-ocspstapling2 Target platform: Linux kirk 5.13.0-35-generic #40-Ubuntu SMP Mon Mar 7 08:03:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Starting the server: ./examples/server/server -C 5000 -x -p 44330 -d

Testcase1:

Sending a ClientHello (TLSv1.2) with the extensions in this sequence: status_request, status_request_v2

Server behavior: ServerHello contains extension status_request, but no status_request_v2 .

Testcase2:

Sending a ClientHello (TLSv1.2) with the extensions in this sequence: status_request_v2, status_request

Server behavior: ServerHello contains extension status_request_v2 but no status_request.

So it looks like the selection between these two extensions is based on the sequence (first extension found gets processed), but I would expect in both cases to prioritize status_request_v2.

Reproduction steps

If desired, I can share the script I have used to setup and reproduce the tests.

Relevant log output

No response

jensguballa avatar Mar 20 '22 14:03 jensguballa

Hi @jensguballa, thank you for your report. Please share your script for reproducing this issue. This will aid in solving this bug quickly. Thanks, Juliusz

julek-wolfssl avatar Mar 22 '22 17:03 julek-wolfssl

I have used the tool tlsmate (https://gitlab.com/guballa/tlsmate) for the test.

Installation (I recommend using virtual environments):

pip install tlsmate

Starting the TLS server (from the examples/server directory of the wolfssl build):

./server -C 5000 -x -p 44330 -d

This is the test script:tlsmate_wolfssl_ocsp.py.zip

Unzip the script and execute from the directory where it resides (bash shell assumed):

PYTHONPATH=$PYTHONPATH:. tlsmate --plugin=tlsmate_wolfssl_ocsp wolfssl localhost --port=44330

The script executes both testcases and prints the extensions received in the ServerHello. Let me know if you need more information.

jensguballa avatar Mar 22 '22 19:03 jensguballa

@jensguballa Thank you for providing an easy way to reproduce this bug. I never heard of tlsmate but from what I'm seeing I may use it in the future. The test case is very clean and makes reproducing easy. I have posted a fix here: https://github.com/wolfSSL/wolfssl/pull/4978.

julek-wolfssl avatar Mar 23 '22 10:03 julek-wolfssl

@jensguballa https://github.com/wolfSSL/wolfssl/pull/4978 has been merged to wolfSSL master. Thanks again.

julek-wolfssl avatar Mar 25 '22 10:03 julek-wolfssl

Fix works. Great!

In case you have any comments or questions regarding tlsmate let me know, it is developed by me.

jensguballa avatar Mar 25 '22 20:03 jensguballa