@@ -7210,8 +7210,9 @@ static int DoUserAuthRequestRsaCert(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
72107210 }
72117211
72127212 if (ret == WS_SUCCESS) {
7213- if (publicKeyTypeSz != pk->publicKeyTypeSz &&
7214- WMEMCMP(publicKeyType, pk->publicKeyType, publicKeyTypeSz) != 0) {
7213+ if (publicKeyTypeSz != pk->publicKeyTypeSz
7214+ || WMEMCMP(publicKeyType, pk->publicKeyType,
7215+ publicKeyTypeSz) != 0) {
72157216
72167217 WLOG(WS_LOG_DEBUG,
72177218 "Signature's type does not match public key type");
@@ -7309,8 +7310,9 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
73097310 if (ret == WS_SUCCESS) {
73107311 publicKeyType = pk->publicKey + i;
73117312 i += publicKeyTypeSz;
7312- if (publicKeyTypeSz != pk->publicKeyTypeSz &&
7313- WMEMCMP(publicKeyType, pk->publicKeyType, publicKeyTypeSz) != 0) {
7313+ if (publicKeyTypeSz != pk->publicKeyTypeSz
7314+ || WMEMCMP(publicKeyType, pk->publicKeyType,
7315+ publicKeyTypeSz) != 0) {
73147316
73157317 WLOG(WS_LOG_DEBUG,
73167318 "Public Key's type does not match public key type");
@@ -7351,8 +7353,9 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
73517353 publicKeyType = pk->signature + i;
73527354 i += publicKeyTypeSz;
73537355
7354- if (publicKeyTypeSz != pk->publicKeyTypeSz &&
7355- WMEMCMP(publicKeyType, pk->publicKeyType, publicKeyTypeSz) != 0) {
7356+ if (publicKeyTypeSz != pk->publicKeyTypeSz
7357+ || WMEMCMP(publicKeyType, pk->publicKeyType,
7358+ publicKeyTypeSz) != 0) {
73567359
73577360 WLOG(WS_LOG_DEBUG,
73587361 "Signature's type does not match public key type");
@@ -7620,7 +7623,7 @@ static int DoUserAuthRequestEd25519(WOLFSSH* ssh,
76207623 publicKeyType = pk->publicKey + i;
76217624 i += publicKeyTypeSz;
76227625 if (publicKeyTypeSz != pk->publicKeyTypeSz
7623- && WMEMCMP(publicKeyType,
7626+ || WMEMCMP(publicKeyType,
76247627 pk->publicKeyType, publicKeyTypeSz) != 0) {
76257628 WLOG(WS_LOG_DEBUG,
76267629 "Public Key's type does not match public key type");
@@ -7651,8 +7654,9 @@ static int DoUserAuthRequestEd25519(WOLFSSH* ssh,
76517654 publicKeyType = pk->signature + i;
76527655 i += publicKeyTypeSz;
76537656
7654- if (publicKeyTypeSz != pk->publicKeyTypeSz &&
7655- WMEMCMP(publicKeyType, pk->publicKeyType, publicKeyTypeSz) != 0) {
7657+ if (publicKeyTypeSz != pk->publicKeyTypeSz
7658+ || WMEMCMP(publicKeyType, pk->publicKeyType,
7659+ publicKeyTypeSz) != 0) {
76567660
76577661 WLOG(WS_LOG_DEBUG,
76587662 "Signature's type does not match public key type");
@@ -8940,7 +8944,7 @@ int wolfSSH_DoModes(const byte* modes, word32 modesSz, int fd)
89408944
89418945 tcgetattr(fd, &term);
89428946
8943- while (idx < modesSz && modes[idx] != WOLFSSH_TTY_OP_END
8947+ while (idx + TERMINAL_MODE_SZ <= modesSz && modes[idx] != WOLFSSH_TTY_OP_END
89448948 && modes[idx] < WOLFSSH_TTY_INVALID) {
89458949
89468950 ato32(modes + idx + 1, &arg);
0 commit comments