mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-14 16:58:34 +00:00
Minimal side-channel fix
This commit is contained in:
parent
10ef5735d8
commit
2c329d2537
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@ verify_result_t HMACSign<Hasher>::verify(
|
||||||
auto new_len = jwt::base64_uri_encode(&b64_enc_str[0], b64_enc_str.length());
|
auto new_len = jwt::base64_uri_encode(&b64_enc_str[0], b64_enc_str.length());
|
||||||
b64_enc_str.resize(new_len);
|
b64_enc_str.resize(new_len);
|
||||||
|
|
||||||
bool ret = (jwt::string_view{b64_enc_str} == jwt_sign);
|
bool ret = (new_len == jwt_sign.size()) && (CRYPTO_memcmp(b64_enc_str.data(), jwt_sign.data(), new_len) == 0);
|
||||||
|
|
||||||
return { ret, ec };
|
return { ret, ec };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue