mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-29 02:38:22 -05:00
d72a00539c
Rework the Acct-Session-Id and Acct-Multi-Session-Id implementation to give better global and temporal uniqueness. Previously, only 32-bits of the Acct-Session-Id would contain random data, the other 32-bits would be incremented. Previously, the Acct-Multi-Session-Id would not use random data. Switch from two u32 variables to a single u64 for the Acct-Session-Id and Acct-Multi-Session-Id. Do not increment, this serves no legitimate purpose. Exclusively use os_get_random() to get quality random numbers, do not use or mix in the time. Inherently take a dependency on /dev/urandom working properly therefore. Remove the global Acct-Session-Id and Acct-Multi-Session-Id values that serve no legitimate purpose. Signed-off-by: Nick Lowe <nick.lowe@lugatech.com>
46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
/*
|
|
* hostapd / RADIUS Accounting
|
|
* Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
|
|
*
|
|
* This software may be distributed under the terms of the BSD license.
|
|
* See README for more details.
|
|
*/
|
|
|
|
#ifndef ACCOUNTING_H
|
|
#define ACCOUNTING_H
|
|
|
|
#ifdef CONFIG_NO_ACCOUNTING
|
|
static inline int accounting_sta_get_id(struct hostapd_data *hapd,
|
|
struct sta_info *sta)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void accounting_sta_start(struct hostapd_data *hapd,
|
|
struct sta_info *sta)
|
|
{
|
|
}
|
|
|
|
static inline void accounting_sta_stop(struct hostapd_data *hapd,
|
|
struct sta_info *sta)
|
|
{
|
|
}
|
|
|
|
static inline int accounting_init(struct hostapd_data *hapd)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void accounting_deinit(struct hostapd_data *hapd)
|
|
{
|
|
}
|
|
#else /* CONFIG_NO_ACCOUNTING */
|
|
int accounting_sta_get_id(struct hostapd_data *hapd, struct sta_info *sta);
|
|
void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta);
|
|
void accounting_sta_stop(struct hostapd_data *hapd, struct sta_info *sta);
|
|
int accounting_init(struct hostapd_data *hapd);
|
|
void accounting_deinit(struct hostapd_data *hapd);
|
|
#endif /* CONFIG_NO_ACCOUNTING */
|
|
|
|
#endif /* ACCOUNTING_H */
|