From patchwork Sat Feb 13 20:34:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Lowe X-Patchwork-Id: 582443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 30CAB140317 for ; Sun, 14 Feb 2016 07:36:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=lugatech-com.20150623.gappssmtp.com header.i=@lugatech-com.20150623.gappssmtp.com header.b=ZDji7AHl; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUgts-0003ah-Pf; Sat, 13 Feb 2016 20:34:40 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUgto-0003RI-OO for hostap@lists.infradead.org; Sat, 13 Feb 2016 20:34:38 +0000 Received: by mail-wm0-x22b.google.com with SMTP id c200so63845436wme.0 for ; Sat, 13 Feb 2016 12:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lugatech-com.20150623.gappssmtp.com; s=20150623; h=mime-version:date:message-id:subject:from:to:content-type; bh=yiTjBccYshxL3t/KCQTsTiUDUNHr60GF0r1T27eCGrA=; b=ZDji7AHli4lEZjFSrQmp4ri0WsEikL2GeuWOqiZ5nPACbu8A2Zg4DuDYQ+ShhoHHA8 FwcgGW+ODItRmfGjJ7P3defm4vArVFQNoT3Kllst+g88GZf0n4gNOI/u85Zl5AV00WRy SuDM1tL7EBTOTCtDHSA2/rgEkpK3r6uhzimlXoPT4pHWZHa0zFMZgDuNlD4FgZAKP743 Y+3kALoB/PpQGuC4BO0AV85qoQVFCV4H8MH1k7D9mIbDm8HBM9lyOdSnnL3bNojZS7TY YbLOuHpc/LzaB5YVCHI6dor/gAukUEQQU4Sxl1qKrQ85OwrWIbNTbKeFcBjrmHrk8np/ 8BmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=yiTjBccYshxL3t/KCQTsTiUDUNHr60GF0r1T27eCGrA=; b=GDi9NTqMYP84NlOisx/jciV5HJkZKsBvPHeWy3Sr9BBp4BPryHls1HY/vRMYWJFrDH cSekK/1buhm+5Y6Mf3nHv32KyDOJdn9pSA5Lu1jULAVow0XU5ksgwhtu71x5twMcfOHe qer4zGrG8YxqnLnBPiyKs/mkm3wYutdGTxCUK52sl5qMPJ6IRTOqphJ6YxgKsnbr+a/w bGQ8KwDVtYzpsyuAmV3auTnsuyg87sNzS/AOi+MWRLYAfMD0LqORZCfm8ihjyXe5sqEa leWWmOQFaEdFEVNEtVsa+4y9AVFkzndCDVgULFYuruMYr3pJe8+Tztola1Y2pe67rDXP vxig== X-Gm-Message-State: AG10YOS5y3XMZp8kSokvkwubbtIe1/ejI2k+AMwXzQcYnbohLtkpFcY+fZiMGan8cmTZlMpYscT/vAQ19D0+NQ== MIME-Version: 1.0 X-Received: by 10.28.107.140 with SMTP id a12mr4753340wmi.77.1455395654539; Sat, 13 Feb 2016 12:34:14 -0800 (PST) Received: by 10.28.64.2 with HTTP; Sat, 13 Feb 2016 12:34:14 -0800 (PST) X-Originating-IP: [77.96.75.177] Date: Sat, 13 Feb 2016 20:34:14 +0000 Message-ID: Subject: [PATCH] Acct-Session-Id and Acct-Multi-Session-Id must be printed as 64-bit values rather than 32-bit values. From: Nick Lowe To: hostap@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160213_123437_152604_D0F0C17C X-CRM114-Status: GOOD ( 10.75 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22b listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Acct-Session-Id and Acct-Multi-Session-Id must be printed as 64-bit values rather than 32-bit values. Signed-off-by: Nick Lowe --- src/ap/accounting.c | 12 ++++++------ src/ap/hostapd.c | 8 ++++---- src/ap/ieee802_1x.c | 16 ++++++++-------- src/ap/pmksa_cache_auth.c | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) match++; From f37daa47f3d2fd1c3d6ee0ea4fe510415d7e67c2 Mon Sep 17 00:00:00 2001 From: Nick Lowe Date: Sat, 13 Feb 2016 20:29:47 +0000 Subject: [PATCH] Acct-Session-Id and Acct-Multi-Session-Id must be printed as 64-bit values rather than 32-bit values. Signed-off-by: Nick Lowe --- src/ap/accounting.c | 12 ++++++------ src/ap/hostapd.c | 8 ++++---- src/ap/ieee802_1x.c | 16 ++++++++-------- src/ap/pmksa_cache_auth.c | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/ap/accounting.c b/src/ap/accounting.c index 2702356..b74b286 100644 --- a/src/ap/accounting.c +++ b/src/ap/accounting.c @@ -218,8 +218,8 @@ void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta) hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, HOSTAPD_LEVEL_INFO, - "starting accounting session %016lX", - (long unsigned int) sta->acct_session_id); + "starting accounting session %016llX", + (unsigned long long) sta->acct_session_id); os_get_reltime(&sta->acct_session_start); sta->last_rx_bytes = sta->last_tx_bytes = 0; @@ -356,8 +356,8 @@ void accounting_sta_stop(struct hostapd_data *hapd, struct sta_info *sta) eloop_cancel_timeout(accounting_interim_update, hapd, sta); hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, HOSTAPD_LEVEL_INFO, - "stopped accounting session %016lX", - (long unsigned int) sta->acct_session_id); + "stopped accounting session %016llX", + (unsigned long long) sta->acct_session_id); sta->acct_session_started = 0; } } @@ -416,8 +416,8 @@ static void accounting_report_state(struct hostapd_data *hapd, int on) if (hapd->acct_session_id) { char buf[20]; - os_snprintf(buf, sizeof(buf), "%016lX", - (long unsigned int) hapd->acct_session_id); + os_snprintf(buf, sizeof(buf), "%016llX", + (unsigned long long) hapd->acct_session_id); if (!radius_msg_add_attr(msg, RADIUS_ATTR_ACCT_SESSION_ID, (u8 *) buf, os_strlen(buf))) wpa_printf(MSG_ERROR, "Could not add Acct-Session-Id"); diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index a848f35..dd2dc17 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -683,8 +683,8 @@ static struct sta_info * hostapd_das_find_sta(struct hostapd_data *hapd, for (sta = hapd->sta_list; sta; sta = sta->next) { if (!sta->radius_das_match) continue; - os_snprintf(buf, sizeof(buf), "%016lX", - (long unsigned int) sta->acct_session_id); + os_snprintf(buf, sizeof(buf), "%016llX", + (unsigned long long) sta->acct_session_id); if (os_memcmp(attr->acct_session_id, buf, 16) != 0) sta->radius_das_match = 0; else @@ -716,8 +716,8 @@ static struct sta_info * hostapd_das_find_sta(struct hostapd_data *hapd, sta->radius_das_match = 0; continue; } - os_snprintf(buf, sizeof(buf), "%016lX", - (long unsigned int) + os_snprintf(buf, sizeof(buf), "%016llX", + (unsigned long long) sta->eapol_sm->acct_multi_session_id); if (os_memcmp(attr->acct_multi_session_id, buf, 16) != 0) diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index 7e99684..c917e29 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -446,8 +446,8 @@ static int add_common_radius_sta_attr(struct hostapd_data *hapd, } if (sta->acct_session_id) { - os_snprintf(buf, sizeof(buf), "%016lX", - (long unsigned int) sta->acct_session_id); + os_snprintf(buf, sizeof(buf), "%016llX", + (unsigned long long) sta->acct_session_id); if (!radius_msg_add_attr(msg, RADIUS_ATTR_ACCT_SESSION_ID, (u8 *) buf, os_strlen(buf))) { wpa_printf(MSG_ERROR, "Could not add Acct-Session-Id"); @@ -458,8 +458,8 @@ static int add_common_radius_sta_attr(struct hostapd_data *hapd, if ((hapd->conf->wpa & 2) && !hapd->conf->disable_pmksa_caching && sta->eapol_sm && sta->eapol_sm->acct_multi_session_id) { - os_snprintf(buf, sizeof(buf), "%016lX", - (long unsigned int) + os_snprintf(buf, sizeof(buf), "%016llX", + (unsigned long long) sta->eapol_sm->acct_multi_session_id); if (!radius_msg_add_attr( msg, RADIUS_ATTR_ACCT_MULTI_SESSION_ID, @@ -2518,12 +2518,12 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, /* TODO: dot1xAuthSessionOctetsTx */ /* TODO: dot1xAuthSessionFramesRx */ /* TODO: dot1xAuthSessionFramesTx */ - "dot1xAuthSessionId=%016lX\n" + "dot1xAuthSessionId=%016llX\n" "dot1xAuthSessionAuthenticMethod=%d\n" "dot1xAuthSessionTime=%u\n" "dot1xAuthSessionTerminateCause=999\n" "dot1xAuthSessionUserName=%s\n", - (long unsigned int) sta->acct_session_id, + (unsigned long long) sta->acct_session_id, (wpa_key_mgmt_wpa_ieee8021x( wpa_auth_sta_key_mgmt(sta->wpa_sm))) ? 1 : 2, @@ -2535,8 +2535,8 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, if (sm->acct_multi_session_id) { ret = os_snprintf(buf + len, buflen - len, - "authMultiSessionId=%016lX\n", - (long unsigned int) + "authMultiSessionId=%016llX\n", + (unsigned long long) sm->acct_multi_session_id); if (os_snprintf_error(buflen - len, ret)) return len; diff --git a/src/ap/pmksa_cache_auth.c b/src/ap/pmksa_cache_auth.c index eb37c78..5096cfa 100644 --- a/src/ap/pmksa_cache_auth.c +++ b/src/ap/pmksa_cache_auth.c @@ -471,8 +471,8 @@ static int das_attr_match(struct rsn_pmksa_cache_entry *entry, if (attr->acct_multi_session_id_len != 16) return 0; - os_snprintf(buf, sizeof(buf), "%016lX", - (long unsigned int) entry->acct_multi_session_id); + os_snprintf(buf, sizeof(buf), "%016llX", + (unsigned long long) entry->acct_multi_session_id); if (os_memcmp(attr->acct_multi_session_id, buf, 16) != 0) return 0; match++; -- 2.5.0