forked from wolfSSL/wolfssl
coverity: unchecked return value in EchHashHelloInner.
This commit is contained in:
13
src/tls13.c
13
src/tls13.c
@@ -4184,9 +4184,9 @@ static int EchHashHelloInner(WOLFSSL* ssl, WOLFSSL_ECH* ech)
|
|||||||
tmpHashes = ssl->hsHashes;
|
tmpHashes = ssl->hsHashes;
|
||||||
ssl->hsHashes = NULL;
|
ssl->hsHashes = NULL;
|
||||||
/* init the ech hashes */
|
/* init the ech hashes */
|
||||||
InitHandshakeHashes(ssl);
|
ret = InitHandshakeHashes(ssl);
|
||||||
ssl->hsHashesEch = ssl->hsHashes;
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
ssl->hsHashesEch = ssl->hsHashes;
|
||||||
/* do the handshake header then the body */
|
/* do the handshake header then the body */
|
||||||
AddTls13HandShakeHeader(falseHeader, realSz, 0, 0, client_hello, ssl);
|
AddTls13HandShakeHeader(falseHeader, realSz, 0, 0, client_hello, ssl);
|
||||||
ret = HashRaw(ssl, falseHeader, HANDSHAKE_HEADER_SZ);
|
ret = HashRaw(ssl, falseHeader, HANDSHAKE_HEADER_SZ);
|
||||||
@@ -4195,21 +4195,26 @@ static int EchHashHelloInner(WOLFSSL* ssl, WOLFSSL_ECH* ech)
|
|||||||
/* init hsHashesEchInner */
|
/* init hsHashesEchInner */
|
||||||
if (ech->innerCount == 0) {
|
if (ech->innerCount == 0) {
|
||||||
ssl->hsHashes = ssl->hsHashesEchInner;
|
ssl->hsHashes = ssl->hsHashesEchInner;
|
||||||
InitHandshakeHashes(ssl);
|
ret = InitHandshakeHashes(ssl);
|
||||||
|
if (ret == 0) {
|
||||||
ssl->hsHashesEchInner = ssl->hsHashes;
|
ssl->hsHashesEchInner = ssl->hsHashes;
|
||||||
ech->innerCount = 1;
|
ech->innerCount = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* switch back to hsHashes so we have hrr -> echInner2 */
|
/* switch back to hsHashes so we have hrr -> echInner2 */
|
||||||
ssl->hsHashes = tmpHashes;
|
ssl->hsHashes = tmpHashes;
|
||||||
InitHandshakeHashesAndCopy(ssl, ssl->hsHashes,
|
ret = InitHandshakeHashesAndCopy(ssl, ssl->hsHashes,
|
||||||
&ssl->hsHashesEchInner);
|
&ssl->hsHashesEchInner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret == 0) {
|
||||||
ssl->hsHashes = ssl->hsHashesEchInner;
|
ssl->hsHashes = ssl->hsHashesEchInner;
|
||||||
ret = HashRaw(ssl, falseHeader, HANDSHAKE_HEADER_SZ);
|
ret = HashRaw(ssl, falseHeader, HANDSHAKE_HEADER_SZ);
|
||||||
ssl->hsHashes = ssl->hsHashesEch;
|
ssl->hsHashes = ssl->hsHashesEch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* hash the body */
|
/* hash the body */
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = HashRaw(ssl, ech->innerClientHello, realSz);
|
ret = HashRaw(ssl, ech->innerClientHello, realSz);
|
||||||
|
Reference in New Issue
Block a user