Skip to content

Commit d72fcb1

Browse files
committed
tls13: avoid to create a new suite in CertificateRequest
This way the ssl object honour the HasSigAlgo list set by wolfSSL_set1_sigalgs_list.
1 parent a08efc9 commit d72fcb1

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/tls13.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7791,7 +7791,6 @@ static int SendTls13CertificateRequest(WOLFSSL* ssl, byte* reqCtx,
77917791
int sendSz;
77927792
word32 i;
77937793
word32 reqSz;
7794-
word16 hashSigAlgoSz = 0;
77957794
SignatureAlgorithms* sa;
77967795

77977796
WOLFSSL_START(WC_FUNC_CERTIFICATE_REQUEST_SEND);
@@ -7802,14 +7801,11 @@ static int SendTls13CertificateRequest(WOLFSSL* ssl, byte* reqCtx,
78027801
if (ssl->options.side != WOLFSSL_SERVER_END)
78037802
return SIDE_ERROR;
78047803

7805-
/* Get the length of the hashSigAlgo buffer */
7806-
InitSuitesHashSigAlgo(NULL, SIG_ALL, 1, 1, ssl->buffers.keySz,
7807-
&hashSigAlgoSz);
7808-
sa = TLSX_SignatureAlgorithms_New(ssl, hashSigAlgoSz, ssl->heap);
7804+
/* Use ssl->suites->hashSigAlgo so wolfSSL_set1_sigalgs_list() is honored.
7805+
* hashSigAlgoSz=0 makes GetSize/Write fall back to WOLFSSL_SUITES(ssl). */
7806+
sa = TLSX_SignatureAlgorithms_New(ssl, 0, ssl->heap);
78097807
if (sa == NULL)
78107808
return MEMORY_ERROR;
7811-
InitSuitesHashSigAlgo(sa->hashSigAlgo, SIG_ALL, 1, 1, ssl->buffers.keySz,
7812-
&hashSigAlgoSz);
78137809
ret = TLSX_Push(&ssl->extensions, TLSX_SIGNATURE_ALGORITHMS, sa, ssl->heap);
78147810
if (ret != 0) {
78157811
TLSX_SignatureAlgorithms_FreeAll(sa, ssl->heap);

0 commit comments

Comments
 (0)