forked from wolfSSL/wolfssl
Refactor unneeded PickHashSigAlgo_ex function.
This commit is contained in:
@@ -27400,12 +27400,7 @@ static int SupportedHashSigAlgo(WOLFSSL* ssl, const byte * hashSigAlgo)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz)
|
int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz,
|
||||||
{
|
|
||||||
return PickHashSigAlgo_ex(ssl, hashSigAlgo, hashSigAlgoSz, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int PickHashSigAlgo_ex(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz,
|
|
||||||
int matchSuites)
|
int matchSuites)
|
||||||
{
|
{
|
||||||
word32 i;
|
word32 i;
|
||||||
@@ -30074,7 +30069,7 @@ static int HashSkeData(WOLFSSL* ssl, enum wc_HashType hashType,
|
|||||||
if ((len > size) || ((*inOutIdx - begin) + len > size))
|
if ((len > size) || ((*inOutIdx - begin) + len > size))
|
||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
|
|
||||||
if (PickHashSigAlgo(ssl, input + *inOutIdx, len) != 0 &&
|
if (PickHashSigAlgo(ssl, input + *inOutIdx, len, 0) != 0 &&
|
||||||
ssl->buffers.certificate &&
|
ssl->buffers.certificate &&
|
||||||
ssl->buffers.certificate->buffer) {
|
ssl->buffers.certificate->buffer) {
|
||||||
#ifdef HAVE_PK_CALLBACKS
|
#ifdef HAVE_PK_CALLBACKS
|
||||||
@@ -35959,7 +35954,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
ret = SetCipherSpecs(ssl);
|
ret = SetCipherSpecs(ssl);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
ret = PickHashSigAlgo_ex(ssl, peerSuites->hashSigAlgo,
|
ret = PickHashSigAlgo(ssl, peerSuites->hashSigAlgo,
|
||||||
peerSuites->hashSigAlgoSz, 1);
|
peerSuites->hashSigAlgoSz, 1);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -36323,7 +36318,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
ret = SetCipherSpecs(ssl);
|
ret = SetCipherSpecs(ssl);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = PickHashSigAlgo(ssl, clSuites->hashSigAlgo,
|
ret = PickHashSigAlgo(ssl, clSuites->hashSigAlgo,
|
||||||
clSuites->hashSigAlgoSz);
|
clSuites->hashSigAlgoSz, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ret == 0) {
|
else if (ret == 0) {
|
||||||
|
@@ -5740,7 +5740,7 @@ static int DoTls13CertificateRequest(WOLFSSL* ssl, const byte* input,
|
|||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
if (PickHashSigAlgo(ssl, peerSuites.hashSigAlgo,
|
if (PickHashSigAlgo(ssl, peerSuites.hashSigAlgo,
|
||||||
peerSuites.hashSigAlgoSz) != 0) {
|
peerSuites.hashSigAlgoSz, 0) != 0) {
|
||||||
WOLFSSL_ERROR_VERBOSE(INVALID_PARAMETER);
|
WOLFSSL_ERROR_VERBOSE(INVALID_PARAMETER);
|
||||||
return INVALID_PARAMETER;
|
return INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
@@ -2180,8 +2180,6 @@ WOLFSSL_LOCAL int DoServerHello(WOLFSSL* ssl, const byte* input, word32* inOutI
|
|||||||
WOLFSSL_LOCAL int CompleteServerHello(WOLFSSL *ssl);
|
WOLFSSL_LOCAL int CompleteServerHello(WOLFSSL *ssl);
|
||||||
WOLFSSL_LOCAL int CheckVersion(WOLFSSL *ssl, ProtocolVersion pv);
|
WOLFSSL_LOCAL int CheckVersion(WOLFSSL *ssl, ProtocolVersion pv);
|
||||||
WOLFSSL_LOCAL int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo,
|
WOLFSSL_LOCAL int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo,
|
||||||
word32 hashSigAlgoSz);
|
|
||||||
WOLFSSL_LOCAL int PickHashSigAlgo_ex(WOLFSSL* ssl, const byte* hashSigAlgo,
|
|
||||||
word32 hashSigAlgoSz, int matchSuites);
|
word32 hashSigAlgoSz, int matchSuites);
|
||||||
#if defined(WOLF_PRIVATE_KEY_ID) && !defined(NO_CHECK_PRIVATE_KEY)
|
#if defined(WOLF_PRIVATE_KEY_ID) && !defined(NO_CHECK_PRIVATE_KEY)
|
||||||
WOLFSSL_LOCAL int CreateDevPrivateKey(void** pkey, byte* data, word32 length,
|
WOLFSSL_LOCAL int CreateDevPrivateKey(void** pkey, byte* data, word32 length,
|
||||||
|
Reference in New Issue
Block a user