wolfssl-examples icon indicating copy to clipboard operation
wolfssl-examples copied to clipboard

DTLS Handshake is failing with "VERIFY_MAC_ERROR"

Open swamidas1998 opened this issue 1 year ago • 1 comments

Hi Team,

Type:- Bug Priority:- Critical WolfSSL build:- 4.6.0 OpenSSL Server version:- OpenSSL 1.0.2u

I was porting the DTLS client into my application and encountered an error during the DTLS Handshake. During the handshake, The TimingPadVerify API is failing with VERIFY_MAC_ERROR For the "Encrypted Handshake Message" packet received from the DTLS server, and this issue is observed only in the case when we get "Change Cipher Spec + Encrypted Handshake Message" in a single DTLS packet. However, The handshake is successful when the "Encrypted Handshake Message" alone is received in a single packet. Do I need to enable any other macros or need to call any APIs? Could you please help me in resolving this issue?

Please find the snaps of the Wireshark capture. If you have a look at the below capture, Packet number 105 has both the headers and the TimingPadVerify API fails. DTLS_multi_packets

If you have a look at the below capture, Packet number 110 has only "Encrypted Handshake Message" and the API is successful at this point. DTLS_single_packet

OpenSSL Server command:- .\openssl.exe s_server -accept 5012 -cert server-cert.pem -key server-key.pem -dtls1_2 -cipher AES256-SHA256

Note:- It's not a cipher specific issue.

swamidas1998 avatar Sep 30 '24 14:09 swamidas1998

Hi @swamidas1998 , Thank you for the report. @rizlik will review this report. Thanks, David Garske, wolfSSL

dgarske avatar Sep 30 '24 15:09 dgarske