[core,gcc] fix server random length

This commit is contained in:
akallabeth
2023-01-28 12:48:00 +01:00
committed by akallabeth
parent a3152871ab
commit 54e5ff1e75

View File

@@ -1815,10 +1815,12 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs)
if (!gcc_update_server_random(settings))
return FALSE;
if (!Stream_EnsureRemainingCapacity(s, sizeof(UINT32) + settings->ServerRandomLength))
return FALSE;
Stream_Write_UINT32(s, settings->ServerRandomLength); /* serverRandomLen */
const size_t posCertLen = Stream_GetPosition(s);
Stream_Seek_UINT32(s); /* serverCertLen */
Stream_Write(s, settings->ServerRandom, settings->ServerRandom);
Stream_Write(s, settings->ServerRandom, settings->ServerRandomLength);
const SSIZE_T len = certificate_write_server_certificate(
settings->RdpServerRsaKey, CERT_TEMPORARILY_ISSUED | CERT_CHAIN_VERSION_1, s);