From patchwork Sat Feb 13 12:26:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Lowe X-Patchwork-Id: 582390 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 090CF1402EC for ; Sat, 13 Feb 2016 23:28:31 +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=nzg1NOr1; 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 1aUZHs-0001sF-Al; Sat, 13 Feb 2016 12:26:56 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUZHp-0001oe-FK for hostap@lists.infradead.org; Sat, 13 Feb 2016 12:26:54 +0000 Received: by mail-wm0-x235.google.com with SMTP id p63so54383484wmp.1 for ; Sat, 13 Feb 2016 04:26:31 -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=gUsgP25EhVoT1Ww/3jNg+etr9yC0m1uhkWcfZ3vIzW8=; b=nzg1NOr1AK5n59Fz7w+A13+7BWUPwOgm9nrEqzbCIjlKObh1JZ0LimzL10q2TNtd1n erXbHWCjXRrX17Hopl/XoLOxURwaX/BxwzI59TTCpsKFkXcc1+gbwTqbaa9Hom3E4ks9 90chqFakn/81ccSJCikrHoan6RgaQOQTRAqPADIKiQ+mYeHZMpnFCy8N1aqNf6EIrhMn o2t89QBJBTfx4mgPiWhd3Se+23TlnLc6NZif9hx8ec2GrQqnlTeWtyLvQwn+JkmN5vw8 mivitrXeKXS3LTWviBjJI7Q/NMlMNlsqMUNVLXMXIo+NGRPYe/hG0tr6NIL5jyHO1576 xL+A== 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=gUsgP25EhVoT1Ww/3jNg+etr9yC0m1uhkWcfZ3vIzW8=; b=hRpWiZUQPhhirEou5bxwlh7qa+YYsS5OBEcBy33sGENtDSp4MONoWO88MR8qimgV8e t/27ZGQEYXwHFYpeGAd6+hpAVLKXg1cG3riq/AuqTpU/GnkzRG900wOOakCX/4u2iII/ iBRpK3sW226iNKpkinJmJvbfy0Fy6mtctERaozobn5NEEdEPZQmPj8xmuDJPCDyXR4Jm 2tQKVRkOca4zw7KJ11GxRJcFmeChFOPsSTO4PevPTj6PLy9afpIcTjS0+ELPypU8PEIF MnNW5KmLGLkg1JRAiZdVABrE0dEVQlzEvhb0Cb0Cc3q8OnkBgUu2mPnRbTVln4Ust3CJ EYxA== X-Gm-Message-State: AG10YOTx28vKkZzWp/U3pwHIdlwogBf40xB17pz2IxHnbyaWyLg4OAXSAufOxeN4Hx9+Z5jjWg3dg8PRFIulFw== MIME-Version: 1.0 X-Received: by 10.194.189.231 with SMTP id gl7mr6606685wjc.162.1455366390446; Sat, 13 Feb 2016 04:26:30 -0800 (PST) Received: by 10.28.64.2 with HTTP; Sat, 13 Feb 2016 04:26:30 -0800 (PST) X-Originating-IP: [77.96.75.177] Date: Sat, 13 Feb 2016 12:26:30 +0000 Message-ID: Subject: [PATCH] Define and make use of the Service-Type RADIUS attribute with a value of Framed. 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_042653_719438_6A7DBD0F X-CRM114-Status: UNSURE ( 8.81 ) X-CRM114-Notice: Please train this message. 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:235 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 Define and make use of the Service-Type RADIUS attribute with a value of Framed. Signed-off-by: Nick Lowe --- src/ap/ieee802_1x.c | 7 +++++++ src/radius/radius.h | 4 ++++ wpa_supplicant/eapol_test.c | 7 +++++++ 3 files changed, 18 insertions(+) !radius_msg_add_attr(msg, RADIUS_ATTR_CONNECT_INFO, From db38d26fb771a2d68a2992ad9ee2e9fd3ed32b5f Mon Sep 17 00:00:00 2001 From: Nick Lowe Date: Sat, 13 Feb 2016 12:20:12 +0000 Subject: [PATCH] Define and make use of the Service-Type RADIUS attribute with a value of Framed. Signed-off-by: Nick Lowe --- src/ap/ieee802_1x.c | 7 +++++++ src/radius/radius.h | 4 ++++ wpa_supplicant/eapol_test.c | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index d399b1e..7e99684 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -405,6 +405,13 @@ static int add_common_radius_sta_attr(struct hostapd_data *hapd, char buf[128]; if (!hostapd_config_get_radius_attr(req_attr, + RADIUS_ATTR_SERVICE_TYPE) && + !radius_msg_add_attr_int32(msg, RADIUS_ATTR_SERVICE_TYPE, RADIUS_SERVICE_TYPE_FRAMED)) { + wpa_printf(MSG_ERROR, "Could not add Service-Type"); + return -1; + } + + if (!hostapd_config_get_radius_attr(req_attr, RADIUS_ATTR_NAS_PORT) && !radius_msg_add_attr_int32(msg, RADIUS_ATTR_NAS_PORT, sta->aid)) { wpa_printf(MSG_ERROR, "Could not add NAS-Port"); diff --git a/src/radius/radius.h b/src/radius/radius.h index 313fc65..e641cfc 100644 --- a/src/radius/radius.h +++ b/src/radius/radius.h @@ -52,6 +52,7 @@ enum { RADIUS_ATTR_USER_NAME = 1, RADIUS_ATTR_USER_PASSWORD = 2, RADIUS_ATTR_NAS_IP_ADDRESS = 4, RADIUS_ATTR_NAS_PORT = 5, + RADIUS_ATTR_SERVICE_TYPE = 6, RADIUS_ATTR_FRAMED_IP_ADDRESS = 8, RADIUS_ATTR_FRAMED_MTU = 12, RADIUS_ATTR_REPLY_MESSAGE = 18, @@ -109,6 +110,9 @@ enum { RADIUS_ATTR_USER_NAME = 1, }; +/* Service-Type */ +#define RADIUS_SERVICE_TYPE_FRAMED 2 + /* Termination-Action */ #define RADIUS_TERMINATION_ACTION_DEFAULT 0 #define RADIUS_TERMINATION_ACTION_RADIUS_REQUEST 1 diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c index 1aede79..6548bd1 100644 --- a/wpa_supplicant/eapol_test.c +++ b/wpa_supplicant/eapol_test.c @@ -258,6 +258,13 @@ static void ieee802_1x_encapsulate_radius(struct eapol_test_data *e, goto fail; } + if (!find_extra_attr(e->extra_attrs, RADIUS_ATTR_SERVICE_TYPE) && + !radius_msg_add_attr_int32(msg, RADIUS_ATTR_SERVICE_TYPE, + RADIUS_SERVICE_TYPE_FRAMED)) { + printf("Could not add Service-Type\n"); + goto fail; + } + os_snprintf(buf, sizeof(buf), "%s", e->connect_info); if (!find_extra_attr(e->extra_attrs, RADIUS_ATTR_CONNECT_INFO) && !radius_msg_add_attr(msg, RADIUS_ATTR_CONNECT_INFO, -- 2.5.0