@@ -5887,69 +5887,6 @@ static int DoTls13CertificateRequest(WOLFSSL* ssl, const byte* input,
58875887
58885888#ifndef NO_WOLFSSL_SERVER
58895889#if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
5890- /* Refine list of supported cipher suites to those common to server and client.
5891- *
5892- * ssl SSL/TLS object.
5893- * peerSuites The peer's advertised list of supported cipher suites.
5894- */
5895- static void RefineSuites(WOLFSSL* ssl, Suites* peerSuites)
5896- {
5897- byte suites[WOLFSSL_MAX_SUITE_SZ];
5898- word16 suiteSz = 0;
5899- word16 i;
5900- word16 j;
5901-
5902- if (AllocateSuites(ssl) != 0)
5903- return;
5904-
5905- XMEMSET(suites, 0, sizeof(suites));
5906-
5907- if (!ssl->options.useClientOrder) {
5908- /* Server order refining. */
5909- for (i = 0; i < ssl->suites->suiteSz; i += 2) {
5910- for (j = 0; j < peerSuites->suiteSz; j += 2) {
5911- if ((ssl->suites->suites[i+0] == peerSuites->suites[j+0]) &&
5912- (ssl->suites->suites[i+1] == peerSuites->suites[j+1])) {
5913- suites[suiteSz++] = peerSuites->suites[j+0];
5914- suites[suiteSz++] = peerSuites->suites[j+1];
5915- break;
5916- }
5917- }
5918- if (suiteSz == WOLFSSL_MAX_SUITE_SZ)
5919- break;
5920- }
5921- }
5922- else {
5923- /* Client order refining. */
5924- for (j = 0; j < peerSuites->suiteSz; j += 2) {
5925- for (i = 0; i < ssl->suites->suiteSz; i += 2) {
5926- if ((ssl->suites->suites[i+0] == peerSuites->suites[j+0]) &&
5927- (ssl->suites->suites[i+1] == peerSuites->suites[j+1])) {
5928- suites[suiteSz++] = peerSuites->suites[j+0];
5929- suites[suiteSz++] = peerSuites->suites[j+1];
5930- break;
5931- }
5932- }
5933- if (suiteSz == WOLFSSL_MAX_SUITE_SZ)
5934- break;
5935- }
5936- }
5937-
5938- ssl->suites->suiteSz = suiteSz;
5939- XMEMCPY(ssl->suites->suites, &suites, sizeof(suites));
5940- #ifdef WOLFSSL_DEBUG_TLS
5941- {
5942- int ii;
5943- WOLFSSL_MSG("Refined Ciphers:");
5944- for (ii = 0 ; ii < ssl->suites->suiteSz; ii += 2) {
5945- WOLFSSL_MSG(GetCipherNameInternal(ssl->suites->suites[ii+0],
5946- ssl->suites->suites[ii+1]));
5947- }
5948- }
5949- #endif
5950- }
5951-
5952-
59535890#ifndef NO_PSK
59545891int FindPskSuite(const WOLFSSL* ssl, PreSharedKey* psk, byte* psk_key,
59555892 word32* psk_keySz, const byte* suite, int* found, byte* foundSuite)
@@ -6322,7 +6259,7 @@ static int CheckPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
63226259 return ret;
63236260
63246261 /* Refine list for PSK processing. */
6325- RefineSuites (ssl, clSuites);
6262+ sslRefineSuites (ssl, clSuites);
63266263#ifndef WOLFSSL_PSK_ONE_ID
63276264 if (usingPSK == NULL)
63286265 return BAD_FUNC_ARG;
0 commit comments