1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 21:14:28 +01:00

Fix Dot11/RSNInformation big endian issues.

This commit is contained in:
Matias Fontanini
2015-04-02 22:59:47 -07:00
parent bb683c9f79
commit 40a8354125
3 changed files with 11 additions and 6 deletions

View File

@@ -116,11 +116,11 @@ void RSNInformation::group_suite(CypherSuites group) {
}
void RSNInformation::version(uint16_t ver) {
_version = Endian::host_to_le(ver);
_version = ver;
}
void RSNInformation::capabilities(uint16_t cap) {
_capabilities = Endian::host_to_le(cap);
_capabilities = cap;
}
RSNInformation::serialization_type RSNInformation::serialize() const {
@@ -131,10 +131,11 @@ RSNInformation::serialization_type RSNInformation::serialize() const {
uint16_t pairwise_cyphers_size = _pairwise_cyphers.size();
uint16_t akm_cyphers_size = _akm_cyphers.size();
uint16_t capabilities = Endian::host_to_le(_capabilities);
uint16_t version = Endian::host_to_le(_version);
serialization_type buffer(size);
serialization_type::value_type *ptr = &buffer[0];
std::memcpy(ptr, &_version, sizeof(_version));
std::memcpy(ptr, &version, sizeof(version));
ptr += sizeof(uint16_t);
std::memcpy(ptr, &_group_suite, sizeof(uint32_t));
ptr += sizeof(uint32_t);