mirror of https://github.com/wolfSSL/wolfssh.git
Fix a couple dead stores.
parent
91ca3ee43b
commit
b9ccb6f4fb
|
@ -3023,7 +3023,6 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
|
||||||
/* Load in the server's public signing key */
|
/* Load in the server's public signing key */
|
||||||
sigKeyBlock.useRsa = ssh->handshake->pubKeyId == ID_SSH_RSA;
|
sigKeyBlock.useRsa = ssh->handshake->pubKeyId == ID_SSH_RSA;
|
||||||
|
|
||||||
ret = WS_INVALID_ALGO_ID;
|
|
||||||
if (sigKeyBlock.useRsa) {
|
if (sigKeyBlock.useRsa) {
|
||||||
#ifndef NO_RSA
|
#ifndef NO_RSA
|
||||||
byte* e;
|
byte* e;
|
||||||
|
@ -3062,6 +3061,7 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
|
||||||
ret = WS_RSA_E;
|
ret = WS_RSA_E;
|
||||||
#else
|
#else
|
||||||
(void)tmpIdx;
|
(void)tmpIdx;
|
||||||
|
ret = WS_INVALID_ALGO_ID;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3109,12 +3109,13 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
|
||||||
else
|
else
|
||||||
ret = WS_ECC_E;
|
ret = WS_ECC_E;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
ret = WS_INVALID_ALGO_ID;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate and hash in the shared secret */
|
/* Generate and hash in the shared secret */
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = WS_INVALID_ALGO_ID;
|
|
||||||
if (!ssh->handshake->useEcc) {
|
if (!ssh->handshake->useEcc) {
|
||||||
#ifndef NO_DH
|
#ifndef NO_DH
|
||||||
ret = wc_DhAgree(&ssh->handshake->privKey.dh,
|
ret = wc_DhAgree(&ssh->handshake->privKey.dh,
|
||||||
|
@ -3123,6 +3124,8 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
|
||||||
f, fSz);
|
f, fSz);
|
||||||
ForceZero(ssh->handshake->x, ssh->handshake->xSz);
|
ForceZero(ssh->handshake->x, ssh->handshake->xSz);
|
||||||
wc_FreeDhKey(&ssh->handshake->privKey.dh);
|
wc_FreeDhKey(&ssh->handshake->privKey.dh);
|
||||||
|
#else
|
||||||
|
ret = WS_INVALID_ALGO_ID;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3140,6 +3143,8 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
|
||||||
&key, ssh->k, &ssh->kSz);
|
&key, ssh->k, &ssh->kSz);
|
||||||
wc_ecc_free(&key);
|
wc_ecc_free(&key);
|
||||||
wc_ecc_free(&ssh->handshake->privKey.ecc);
|
wc_ecc_free(&ssh->handshake->privKey.ecc);
|
||||||
|
#else
|
||||||
|
ret = WS_INVALID_ALGO_ID;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6142,7 +6147,6 @@ static int BundlePacket(WOLFSSH* ssh)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (ret == WS_SUCCESS) {
|
if (ret == WS_SUCCESS) {
|
||||||
ret = WS_INVALID_ALGO_ID;
|
|
||||||
#ifndef WOLFSSH_NO_AEAD
|
#ifndef WOLFSSH_NO_AEAD
|
||||||
idx += paddingSz;
|
idx += paddingSz;
|
||||||
ret = EncryptAead(ssh,
|
ret = EncryptAead(ssh,
|
||||||
|
@ -6158,6 +6162,8 @@ static int BundlePacket(WOLFSSH* ssh)
|
||||||
ssh->packetStartIdx,
|
ssh->packetStartIdx,
|
||||||
LENGTH_SZ);
|
LENGTH_SZ);
|
||||||
idx += ssh->macSz;
|
idx += ssh->macSz;
|
||||||
|
#else
|
||||||
|
ret = WS_INVALID_ALGO_ID;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue