mirror of https://github.com/wolfSSL/wolfssh.git
Merge pull request #915 from padelsbach/const-time-auth
Replace WMEMCMP in CheckAuthKeysLinepull/922/head
commit
543a6c2a2f
|
|
@ -229,7 +229,10 @@ static int CheckAuthKeysLine(char* line, word32 lineSz, const byte* key,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret == WSSHD_AUTH_SUCCESS) {
|
if (ret == WSSHD_AUTH_SUCCESS) {
|
||||||
if (keyCandSz != keySz || WMEMCMP(key, keyCand, keySz) != 0) {
|
/* Constant-time compare to avoid leaking which prefix bytes of an
|
||||||
|
* authorized key match a candidate offered by a remote peer. */
|
||||||
|
if (keyCandSz != keySz ||
|
||||||
|
ConstantCompare(key, keyCand, keySz) != 0) {
|
||||||
ret = WSSHD_AUTH_FAILURE;
|
ret = WSSHD_AUTH_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue