1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

lws_timingsafe_bcmp

This commit is contained in:
Andy Green 2017-10-28 13:24:41 +08:00
parent 413631632b
commit 491fd183f8
3 changed files with 3 additions and 3 deletions

View file

@ -322,7 +322,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;
}

View file

@ -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;

View file

@ -97,7 +97,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;