Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2558691ybb; Mon, 30 Mar 2020 08:28:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs/92Du1N3IMuOhgWj3nemo2Xoqxc+/QBQLLyJQF+3yUFVNy8I81UDogLtFA4ii0y4dEb8X X-Received: by 2002:aca:5454:: with SMTP id i81mr8096850oib.23.1585582125517; Mon, 30 Mar 2020 08:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585582125; cv=none; d=google.com; s=arc-20160816; b=YbxsQx29RyMKpueSJUx4Bug1y3N7xLGuY8RcHedAktYrxp5eV5FtMZGAlwprf6p7Gx MMVOt+TBeLZJOCmVE3t/VFbdXLOfTjuYPt0RmTr8rxzAg0insZ1LhNTz+01u1LVZ9RRo 6ayIU8bS3rXnMxYBnpquZknDPYWqYKkP0blECMJ+e2RxzuaxYf9MWPkfb+uW4Urs8rUe BlDD8jeMxY2+lNFYCDpSJl6THv+GfxRAgtuL07zSpdxWmaUbFhS9CQC2VmuTNuedym+6 dw8lhxK0ZRZZsA//Ord1NqtpINY/4MR2RLK7aC3auEy5Dld9XbnXjnc4sEjw5axV1H02 A/3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-disposition:mime-version:mail-followup-to:message-id :subject:cc:to:date:from:dkim-signature; bh=Fgyu8ufq07oSeLrKaaKhlZAT6jOHp+NEXbUV1i5WIIo=; b=vxU6jRajY6IhE9Tcw3dFxW+9j+IBLyrgIfVwXE0s/ym4SjnsP/zNo1vvMXA2+vU5YP sJy1ejfw/9GYIc4qD6ehB8FnjMvPyWuZWIg+3WqHpsQpuYNljookXO+VUApdjRoOel/w rt4J5zb/bdYgbPXAPRZ3+ZHsKoHgg3nZE+SKwORoKxhw4My7W2z2yLcHwtGbqGuaBLtV 1mBaCoUV084aVGRqY7QCdHcdHiipxs3kNFgbgLeW3J7Joqg3DK4WYjsbHkPFgMyE1S+6 e7B66rc+z+e0g3Vt8EezOsTckBIs0TePPX044zMI+rpFqcujeLY8sNuGQAT4jKgNLBWC MrQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=Zfnok1UH; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si1547486oie.144.2020.03.30.08.28.33; Mon, 30 Mar 2020 08:28:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=Zfnok1UH; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728972AbgC3P1d (ORCPT + 99 others); Mon, 30 Mar 2020 11:27:33 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:38707 "EHLO mail-lj1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbgC3P1d (ORCPT ); Mon, 30 Mar 2020 11:27:33 -0400 Received: by mail-lj1-f173.google.com with SMTP id w1so18509125ljh.5 for ; Mon, 30 Mar 2020 08:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:content-transfer-encoding; bh=Fgyu8ufq07oSeLrKaaKhlZAT6jOHp+NEXbUV1i5WIIo=; b=Zfnok1UHFEXMbco4kme33sAGI7MAEf+XExWeLeBtVmlzzRfARI1veGcxNc41FYkliv U5q1ZFVmYfqUFWdD/XOsY6FOtF9UmGGsIbz8jCM2P+Hr2ggPRh3piZ45nftMGGuMHbZ4 75EKoVCpDcvcuAwSeWXgGS+7K/bMTt1YCK4gbpQmtd2HkWmNU7sY5atMno4lLYGXIpaA wbI9M3GVyFy13upjUcP1QOzFO11sBw7aaZGPe84ZgFMQDughICyyPsS6pXZMsbXsKYWq G7ehLnv8voao7ghvBZHnQspypfDdbHEJB1ZLGjspuOki6RyHT2k6JOOhJJ0nJkDbQRWp aj0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition :content-transfer-encoding; bh=Fgyu8ufq07oSeLrKaaKhlZAT6jOHp+NEXbUV1i5WIIo=; b=DidYS02GIv75cxqqe77+wA50znsqlRHDZqy/jeofs+jmysWSUr6lFhWuAMV6ur2K8k T+xjM9jqHnLWWFlrAOKhfnX7r25NRmpP+sIbkWpqq3Jo8qytWM1hVOu3J6YxYQ4fluQd 9KtFtHApi0uVFQem5zqbC15pRfbOCGkAkTbLtjEtDdFqZoGpyq06R8Z5ktsOW193YHBq cOmvkTqcreNTcZvcWSyXJ9tRD0Oaufq8HoMvdjEO4hHBU3q8KsDB8tTftOS4Eu6DGo3o tH635BJ7N+PbLK7bXvUXyH3TAOLmtFht00zgQtbXFVsDFOmxBsoF+CDX5EKknh4n6SvQ hNWQ== X-Gm-Message-State: AGi0Puanz7sudMK0vTTw25D/8M/DaGcrQyfCqcdwNMgJw3HXMhdlHr1R 2Bd/AGDit18psju4q6wdYh7zlRA9kb8= X-Received: by 2002:a2e:9247:: with SMTP id v7mr4933880ljg.215.1585582049415; Mon, 30 Mar 2020 08:27:29 -0700 (PDT) Received: from kynes (apn-37-7-76-34.dynamic.gprs.plus.pl. [37.7.76.34]) by smtp.gmail.com with ESMTPSA id l132sm2740916lfd.13.2020.03.30.08.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 08:27:28 -0700 (PDT) From: "=?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek" X-Google-Original-From: =?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek Date: Mon, 30 Mar 2020 17:27:26 +0200 To: linux-bluetooth@vger.kernel.org Cc: Brian Gix , =?utf-8?Q?Przemys=C5=82aw?= Fierek Subject: Application vs Network nonce in segmented messages Message-ID: <20200330152130.gf5jkgalya34mj2e@kynes> Mail-Followup-To: linux-bluetooth@vger.kernel.org, Brian Gix , =?utf-8?Q?Przemys=C5=82aw?= Fierek MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Brian, A question: when poking around the code looking for places where I should fix the net key index, I've noticed a peculiar thing in mesh/net.c: if (msg->segmented) { /* Send each segment on unique seq_num */ seq_num = mesh_net_next_seq_num(net); ... This means that for segmented messages, if sequence number used on the transport layer is, say, N, then the first segment is encrypted with sequence number N + 1 on *network* layer. While I think it's legal from the spec point of view, I can't think of a reason to do so. Can you please shed some light on that line? regards -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND