Commit 4d04f6a4 authored by Youness Alaoui's avatar Youness Alaoui

Fix hmac calculation. If a multiple of 64, do not pad with 64 bytes. It's fine as it is

parent 520d2973
......@@ -68,7 +68,7 @@ void stun_sha1 (const uint8_t *msg, size_t len, uint8_t *sha,
/* RFC 3489 specifies that the message's size should be 64 bytes,
and \x00 padding should be done */
if (padding) {
if (padding && ((len - 24) % 64) > 0) {
uint16_t pad_size = 64 - ((len - 24) % 64);
int i;
uint8_t pad_char[1] = {0};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment