mka: Simplify ieee802_1x_mka_encode_icv_body() memory copying
There is no need to maintain two os_memcpy() calls to cover different cmac lengths. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
This commit is contained in:
parent
8b4a148842
commit
cf375eb2da
1 changed files with 3 additions and 6 deletions
|
@ -1756,12 +1756,9 @@ ieee802_1x_mka_encode_icv_body(struct ieee802_1x_mka_participant *participant,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length != DEFAULT_ICV_LEN) {
|
if (length != DEFAULT_ICV_LEN)
|
||||||
os_memcpy(wpabuf_put(buf, length - MKA_HDR_LEN), cmac,
|
length -= MKA_HDR_LEN;
|
||||||
length - MKA_HDR_LEN);
|
|
||||||
} else {
|
|
||||||
os_memcpy(wpabuf_put(buf, length), cmac, length);
|
os_memcpy(wpabuf_put(buf, length), cmac, length);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue