fix pvs studio warnings
This commit is contained in:
parent
87fbf7df80
commit
7e8438b7b4
@ -7257,30 +7257,31 @@ int SetCipherList(Suites* s, const char* list)
|
|||||||
|
|
||||||
ssl->options.haveSessionId = 1;
|
ssl->options.haveSessionId = 1;
|
||||||
/* DoClientHello uses same resume code */
|
/* DoClientHello uses same resume code */
|
||||||
while (ssl->options.resuming) { /* let's try */
|
if (ssl->options.resuming) { /* let's try */
|
||||||
int ret;
|
int ret;
|
||||||
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
|
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
|
||||||
if (!session) {
|
if (!session) {
|
||||||
|
CYASSL_MSG("Session lookup for resume failed");
|
||||||
ssl->options.resuming = 0;
|
ssl->options.resuming = 0;
|
||||||
break; /* session lookup failed */
|
} else {
|
||||||
}
|
if (MatchSuite(ssl, &clSuites) < 0) {
|
||||||
if (MatchSuite(ssl, &clSuites) < 0) {
|
CYASSL_MSG("Unsupported cipher suite, OldClientHello");
|
||||||
CYASSL_MSG("Unsupported cipher suite, OldClientHello");
|
return UNSUPPORTED_SUITE;
|
||||||
return UNSUPPORTED_SUITE;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RNG_GenerateBlock(ssl->rng, ssl->arrays->serverRandom, RAN_LEN);
|
RNG_GenerateBlock(ssl->rng, ssl->arrays->serverRandom, RAN_LEN);
|
||||||
#ifndef NO_OLD_TLS
|
#ifndef NO_OLD_TLS
|
||||||
if (ssl->options.tls)
|
if (ssl->options.tls)
|
||||||
|
ret = DeriveTlsKeys(ssl);
|
||||||
|
else
|
||||||
|
ret = DeriveKeys(ssl);
|
||||||
|
#else
|
||||||
ret = DeriveTlsKeys(ssl);
|
ret = DeriveTlsKeys(ssl);
|
||||||
else
|
#endif
|
||||||
ret = DeriveKeys(ssl);
|
ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
|
||||||
#else
|
|
||||||
ret = DeriveTlsKeys(ssl);
|
|
||||||
#endif
|
|
||||||
ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return MatchSuite(ssl, &clSuites);
|
return MatchSuite(ssl, &clSuites);
|
||||||
@ -7429,31 +7430,31 @@ int SetCipherList(Suites* s, const char* list)
|
|||||||
|
|
||||||
ssl->options.haveSessionId = 1;
|
ssl->options.haveSessionId = 1;
|
||||||
/* ProcessOld uses same resume code */
|
/* ProcessOld uses same resume code */
|
||||||
while (ssl->options.resuming) { /* let's try */
|
if (ssl->options.resuming) { /* let's try */
|
||||||
int ret;
|
int ret;
|
||||||
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
|
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
|
||||||
if (!session) {
|
if (!session) {
|
||||||
ssl->options.resuming = 0;
|
|
||||||
CYASSL_MSG("Session lookup for resume failed");
|
CYASSL_MSG("Session lookup for resume failed");
|
||||||
break; /* session lookup failed */
|
ssl->options.resuming = 0;
|
||||||
}
|
} else {
|
||||||
if (MatchSuite(ssl, &clSuites) < 0) {
|
if (MatchSuite(ssl, &clSuites) < 0) {
|
||||||
CYASSL_MSG("Unsupported cipher suite, ClientHello");
|
CYASSL_MSG("Unsupported cipher suite, ClientHello");
|
||||||
return UNSUPPORTED_SUITE;
|
return UNSUPPORTED_SUITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RNG_GenerateBlock(ssl->rng, ssl->arrays->serverRandom, RAN_LEN);
|
RNG_GenerateBlock(ssl->rng, ssl->arrays->serverRandom, RAN_LEN);
|
||||||
#ifndef NO_OLD_TLS
|
#ifndef NO_OLD_TLS
|
||||||
if (ssl->options.tls)
|
if (ssl->options.tls)
|
||||||
|
ret = DeriveTlsKeys(ssl);
|
||||||
|
else
|
||||||
|
ret = DeriveKeys(ssl);
|
||||||
|
#else
|
||||||
ret = DeriveTlsKeys(ssl);
|
ret = DeriveTlsKeys(ssl);
|
||||||
else
|
#endif
|
||||||
ret = DeriveKeys(ssl);
|
ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
|
||||||
#else
|
|
||||||
ret = DeriveTlsKeys(ssl);
|
|
||||||
#endif
|
|
||||||
ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return MatchSuite(ssl, &clSuites);
|
return MatchSuite(ssl, &clSuites);
|
||||||
}
|
}
|
||||||
|
@ -2275,7 +2275,7 @@ static int ProcessMessage(const byte* sslFrame, SnifferSession* session,
|
|||||||
const byte* sslBegin = sslFrame;
|
const byte* sslBegin = sslFrame;
|
||||||
const byte* tmp;
|
const byte* tmp;
|
||||||
RecordLayerHeader rh;
|
RecordLayerHeader rh;
|
||||||
int rhSize;
|
int rhSize = 0;
|
||||||
int ret;
|
int ret;
|
||||||
int decoded = 0; /* bytes stored for user in data */
|
int decoded = 0; /* bytes stored for user in data */
|
||||||
int notEnough; /* notEnough bytes yet flag */
|
int notEnough; /* notEnough bytes yet flag */
|
||||||
|
Loading…
Reference in New Issue
Block a user