From patchwork Thu Aug 17 19:47:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 802901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rS8c9ocs"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xYGyV6hhCz9t2K for ; Fri, 18 Aug 2017 05:49:54 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4VVFrqMb3lKAodoSlZ6QKDMyX+zQhQzChObcpYDfQ4U=; b=rS8c9ocsUEZpGZbdRxcXR2FAiJ akCjIpY+lhpvy0CjLzAy8QcNgJ/QBX2DxWCpILkktMza0etF3gU9KdlDCQDmt0hGGSqjHni+ZUiSd AMlwQ5zUr10m+JdgdrxM968MobPKC9TEYDPa0KjObxSSczrsmzxmZTr2c5gM9CjrghPJVdmqAA2Tx QcMO5Kz1HIPZY+VTPVPQke5CT3IzWTvrZ4qXught6jt7zbk5PpFHTOU3Ya7EE80hjY7MAvsyF/ENb MyH5CarqODvsDRTQ2xHmExDiV7mlq0lDxlI2U0ZL/TENbWE53UTiO9OPRFbNyeD4T6Y80bEFiwszg PapdEiNA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1diQn9-0007XM-Ru; Thu, 17 Aug 2017 19:49:19 +0000 Received: from mail.fem.tu-ilmenau.de ([141.24.220.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1diQn6-0007Tk-JF for hostap@lists.infradead.org; Thu, 17 Aug 2017 19:49:18 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.fem.tu-ilmenau.de (Postfix) with ESMTP id 5F12C667C; Thu, 17 Aug 2017 21:48:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at fem.tu-ilmenau.de Received: from mail.fem.tu-ilmenau.de ([127.0.0.1]) by localhost (mail.fem.tu-ilmenau.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3upl1e8fbkya; Thu, 17 Aug 2017 21:48:51 +0200 (CEST) Received: from a234.fem.tu-ilmenau.de (ray-controller.net.fem.tu-ilmenau.de [10.42.51.234]) by mail.fem.tu-ilmenau.de (Postfix) with ESMTP; Thu, 17 Aug 2017 21:48:51 +0200 (CEST) Received: by a234.fem.tu-ilmenau.de (Postfix, from userid 1000) id 36AF630B5C73; Thu, 17 Aug 2017 21:47:03 +0200 (CEST) From: Michael Braun To: hostap@lists.infradead.org Subject: [PATCH 1/1] MKA: fix basic set body encoding Date: Thu, 17 Aug 2017 21:47:01 +0200 Message-Id: <1502999221-11842-1-git-send-email-michael-dev@fami-braun.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1502810463-10845-1-git-send-email-michael-dev@fami-braun.de> References: <1502810463-10845-1-git-send-email-michael-dev@fami-braun.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170817_124916_791429_524BC88A X-CRM114-Status: UNSURE ( 8.12 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [141.24.220.54 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: projekt-wlan@fem.tu-ilmenau.de, Michael Braun MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Michael Braun IEEE 802.1X-2010 Figure 11-7 explaines that "Parameter set body length" is exclusive of the suffix padding. This fixes variable length encoding when ckn length is not a multiple of 4 bytes. Signed-off-by: Michael Braun --- src/pae/ieee802_1x_kay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c index ff55f88..20451bf 100644 --- a/src/pae/ieee802_1x_kay.c +++ b/src/pae/ieee802_1x_kay.c @@ -694,7 +694,8 @@ ieee802_1x_mka_encode_basic_body( { struct ieee802_1x_mka_basic_body *body; struct ieee802_1x_kay *kay = participant->kay; - unsigned int length = ieee802_1x_mka_basic_body_length(participant); + unsigned int length = sizeof(struct ieee802_1x_mka_basic_body); + length += participant->ckn.len; body = wpabuf_put(buf, length);