Skip to content

Commit 7dfef18

Browse files
committed
Refactor unneeded PickHashSigAlgo_ex function.
1 parent 107cc82 commit 7dfef18

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

src/internal.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27400,13 +27400,8 @@ static int SupportedHashSigAlgo(WOLFSSL* ssl, const byte * hashSigAlgo)
2740027400
return 0;
2740127401
}
2740227402

27403-
int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz)
27404-
{
27405-
return PickHashSigAlgo_ex(ssl, hashSigAlgo, hashSigAlgoSz, 0);
27406-
}
27407-
27408-
int PickHashSigAlgo_ex(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz,
27409-
int matchSuites)
27403+
int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz,
27404+
int matchSuites)
2741027405
{
2741127406
word32 i;
2741227407
int ret = WC_NO_ERR_TRACE(MATCH_SUITE_ERROR);
@@ -30074,7 +30069,7 @@ static int HashSkeData(WOLFSSL* ssl, enum wc_HashType hashType,
3007430069
if ((len > size) || ((*inOutIdx - begin) + len > size))
3007530070
return BUFFER_ERROR;
3007630071

30077-
if (PickHashSigAlgo(ssl, input + *inOutIdx, len) != 0 &&
30072+
if (PickHashSigAlgo(ssl, input + *inOutIdx, len, 0) != 0 &&
3007830073
ssl->buffers.certificate &&
3007930074
ssl->buffers.certificate->buffer) {
3008030075
#ifdef HAVE_PK_CALLBACKS
@@ -35959,8 +35954,8 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3595935954
ret = SetCipherSpecs(ssl);
3596035955
if (ret != 0)
3596135956
return ret;
35962-
ret = PickHashSigAlgo_ex(ssl, peerSuites->hashSigAlgo,
35963-
peerSuites->hashSigAlgoSz, 1);
35957+
ret = PickHashSigAlgo(ssl, peerSuites->hashSigAlgo,
35958+
peerSuites->hashSigAlgoSz, 1);
3596435959
if (ret != 0)
3596535960
return ret;
3596635961

@@ -36323,7 +36318,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3632336318
ret = SetCipherSpecs(ssl);
3632436319
if (ret == 0) {
3632536320
ret = PickHashSigAlgo(ssl, clSuites->hashSigAlgo,
36326-
clSuites->hashSigAlgoSz);
36321+
clSuites->hashSigAlgoSz, 0);
3632736322
}
3632836323
}
3632936324
else if (ret == 0) {

src/tls13.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5740,7 +5740,7 @@ static int DoTls13CertificateRequest(WOLFSSL* ssl, const byte* input,
57405740
#endif
57415741
) {
57425742
if (PickHashSigAlgo(ssl, peerSuites.hashSigAlgo,
5743-
peerSuites.hashSigAlgoSz) != 0) {
5743+
peerSuites.hashSigAlgoSz, 0) != 0) {
57445744
WOLFSSL_ERROR_VERBOSE(INVALID_PARAMETER);
57455745
return INVALID_PARAMETER;
57465746
}

wolfssl/internal.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,9 +2180,7 @@ WOLFSSL_LOCAL int DoServerHello(WOLFSSL* ssl, const byte* input, word32* inOutI
21802180
WOLFSSL_LOCAL int CompleteServerHello(WOLFSSL *ssl);
21812181
WOLFSSL_LOCAL int CheckVersion(WOLFSSL *ssl, ProtocolVersion pv);
21822182
WOLFSSL_LOCAL int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo,
2183-
word32 hashSigAlgoSz);
2184-
WOLFSSL_LOCAL int PickHashSigAlgo_ex(WOLFSSL* ssl, const byte* hashSigAlgo,
2185-
word32 hashSigAlgoSz, int matchSuites);
2183+
word32 hashSigAlgoSz, int matchSuites);
21862184
#if defined(WOLF_PRIVATE_KEY_ID) && !defined(NO_CHECK_PRIVATE_KEY)
21872185
WOLFSSL_LOCAL int CreateDevPrivateKey(void** pkey, byte* data, word32 length,
21882186
int hsType, int label, int id,

0 commit comments

Comments
 (0)