TLS 1.3 using SChannel - DecryptMessage Failed with CONTEXT EXPIRED

Ajaykumar Jaiswal 6 Reputation points
2023-11-28T12:27:15.5166667+00:00

Team,
Do we have example client/server programs in C/C++ for implementing TLS 1.3 using SChannel?

DecryptMessage() function first initial call return SEC_I_RENEGOTIATE and when we reinitiate the connection it get expire and connection close.

If you could help, handling renegotiate requests from server (Ex: SEC_I_RENEGOTIATE).

Thanks.

Regards: Ajay

Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,727 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,198 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ポカリ 0 Reputation points
    2024-04-11T07:39:19.1733333+00:00

    I also suffered from the same problem.

    If SEC_I_RENEGOTIATE is received when using TLS1.3

    1.Prepare OutSecBuff and InSecBuff and pass the received data to InitializeSecurityContext.

    2-1 If SEC_E_OK and there is no SECBUFFER_EXTRA buffer in OutSecBuff, receive the next packet and call Decryptmessage.

    2-2 If SEC_E_OK and OutSecBuff has a SECBUFFER_EXTRA buffer, pass the SECBUFFER_EXTRA buffer to Decryptmessage.

    If you are still looking for this information, please let me know your results.

    Regards,

    poca256

    0 comments No comments