diff --git a/plugins/ssh-base/crypto/chacha.c b/plugins/ssh-base/crypto/chacha.c index 46d46cb81..7a8dfbb36 100644 --- a/plugins/ssh-base/crypto/chacha.c +++ b/plugins/ssh-base/crypto/chacha.c @@ -321,7 +321,7 @@ chachapoly_crypt(struct lws_ssh_keys *keys, u_int seqnr, u_char *dest, const u_char *tag = src + aadlen + len; poly1305_auth(expected_tag, src, aadlen + len, poly_key); - if (timingsafe_bcmp(expected_tag, tag, POLY1305_TAGLEN) != 0) { + if (lws_timingsafe_bcmp(expected_tag, tag, POLY1305_TAGLEN)) { r = 2; goto out; } diff --git a/plugins/ssh-base/include/lws-ssh.h b/plugins/ssh-base/include/lws-ssh.h index c74c517d7..7259349a2 100644 --- a/plugins/ssh-base/include/lws-ssh.h +++ b/plugins/ssh-base/include/lws-ssh.h @@ -556,7 +556,7 @@ extern void explicit_bzero(void *p, size_t len); extern int -timingsafe_bcmp(const void *a, const void *b, uint32_t len); +lws_timingsafe_bcmp(const void *a, const void *b, uint32_t len); extern const char *lws_V_S; diff --git a/plugins/ssh-base/sshd.c b/plugins/ssh-base/sshd.c index 345e1b85a..bc9dfb1ab 100644 --- a/plugins/ssh-base/sshd.c +++ b/plugins/ssh-base/sshd.c @@ -96,7 +96,7 @@ explicit_bzero(void *p, size_t len) } int -timingsafe_bcmp(const void *a, const void *b, uint32_t len) +lws_timingsafe_bcmp(const void *a, const void *b, uint32_t len) { const uint8_t *pa = a, *pb = b; uint8_t sum = 0;