Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp706736imm; Fri, 12 Oct 2018 05:32:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60r1V7o3CP3fd+OLcnzQyqmZl5vVWeZgiWIRNuM81welghRIAIoGIC4xncZG4xyhF3/15lk X-Received: by 2002:a65:41c6:: with SMTP id b6-v6mr5475637pgq.421.1539347522385; Fri, 12 Oct 2018 05:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539347522; cv=none; d=google.com; s=arc-20160816; b=CO8GXGM9WkrgEpwu0DLj4uwoJ21Ufx9L6q+P/A/l1RDHVKR38paEBxymhrUl0jZnlH R4ruvZaIXBP5S31F0I05mA+Azvbue1r/r4sz2v7+3uWPWRPkZhLejxwH4O5WHESnzx8M 3kYO+a6oDGWQJYmp24kuw7BKAvYUkAO6zR8GB+RpgCofKiMaXLPpyTUvkZGfUM6cBtQP CnpycrGXHlfT5djYmUesUQj/kXzfgRBveUgq3hIQ2H1DMoPq3V4eSwyBzr+8VCxLiXuC 9YNoH0aqyiD1b8VHhyOPk55YbpFh0czYdo8BJ8oJhBRjiaHjtLZ783mYIaoBQJmk0zRE Mrpw== 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-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:dkim-signature; bh=x4X39BeHTmskD+Gyf1Bj7680OjQKEVSVl8c2DfHIMuc=; b=D+WzRor/AxjA0hnwd7QfUimZRz3Fo5yk5RFyYsaTfHXBtJ2BRHws/oL/QTDChyyCK7 apM7et/9qRzE9N+cRDUiKpS1jHwbZdcIpMdTb8vwRDUN9uA/WqT7abSIKsNcevAhOZzy YdBh3lPnvHNOhzaXb4TdKqjqa+rREWkaOpC6bbMir8bkET39oerQTPW+qAyYxDUvPXad oRXm8w3rQ+VsQNDm0CymfzJ33/qLtCkxmdB1gHPFtHkFsPAC9x9XxavGRptC3F3/awpU P0SONaRTbZk7K0KpVP8EcwAgI9diIZMrH5v8nPnAuZ1DhCQeAE0R5/PfZZsz3JbdmP8+ POhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ohznU5El; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si1361178pln.51.2018.10.12.05.31.47; Fri, 12 Oct 2018 05:32:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@gmail.com header.s=20161025 header.b=ohznU5El; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728713AbeJLUCL (ORCPT + 99 others); Fri, 12 Oct 2018 16:02:11 -0400 Received: from mail-io1-f42.google.com ([209.85.166.42]:44217 "EHLO mail-io1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728131AbeJLUCL (ORCPT ); Fri, 12 Oct 2018 16:02:11 -0400 Received: by mail-io1-f42.google.com with SMTP id x26-v6so9065466iog.11; Fri, 12 Oct 2018 05:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=x4X39BeHTmskD+Gyf1Bj7680OjQKEVSVl8c2DfHIMuc=; b=ohznU5El1+5Ct2oI+6XOnqQkkQCLuvBmXFf0MM/ZEkO055bM4rqdjt0f3V7AdZ/FE1 wvv+eQ9qWJGcNTrkL45ZNBYmq5u7MxLTEleRE7O4fhjCPLPf4yBUTagf4S7UnZ8iMAum 14+K4kHuePAtwfXB8pytcWbBb29kKysw3cUN+1EjOQfpVh7TdJF85x+c69PUb4cxq0hx tALfOA7Qut/V7YZ8u2RBFEtCx/y01d01tNh5tLRLqMYC3V8f/r3G5aHjoCEoPjcQcXSF zRC3/Oo4cH17aqwS7HmV9dPBhWmNpOXjfssgIUkugRCptmTpZ9GuPfcIIsq1W8fG1c3w 8H8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=x4X39BeHTmskD+Gyf1Bj7680OjQKEVSVl8c2DfHIMuc=; b=sKb4e6hjB9jjPjCCn+Mxcx4MrVgrBudbHtVQNTVx2LkPDbNcBof9sFYeysm9uXzd9L BEs1iGngURljvc88ZvxGiSKKkhCO3zJ7K9w2br5TVUe8qEqOM/ZCdFgQBDqb52Gg3pAK yiCxY6it4eY6YzGxBis4QcLyKlpR9alg3+uBhXEUaIXK8WxOzLkR4MBZo0vZq8GQ8G2U TUhih4rTLwWyxurB8KJ+n0KpBAXsUUbeUh0VNgzhJVf3ttQcT6tPCKYsgM4MMCARacfK 1hKMuETfatuflhjP8ajFMQn8PCKOkcnbt0fnsnr44tO61IKoYkKCq0h6CkTyPjbKRTn/ 1pvw== X-Gm-Message-State: ABuFfohSQ4A7ER/zhEBjM6XRZo5tdJ/jzJdVquXfAwyh0l9CTd15xeX7 f9Zd62SPcDtLr6a2II0c7BOZdFOHxPk= X-Received: by 2002:a6b:b249:: with SMTP id b70-v6mr4118048iof.252.1539347395638; Fri, 12 Oct 2018 05:29:55 -0700 (PDT) Received: from [192.168.1.249] (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.googlemail.com with ESMTPSA id v13-v6sm232934iom.54.2018.10.12.05.29.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 05:29:54 -0700 (PDT) From: Denis Kenzior Subject: Re: [PATCH] KEYS: trusted: fix -Wvarags warning To: ndesaulniers@google.com, jejb@linux.vnet.ibm.com, dhowells@redhat.com Cc: natechancellor@gmail.com, ebiggers@google.com, Mimi Zohar , James Morris , "Serge E. Hallyn" , linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <1539274203.2623.56.camel@linux.vnet.ibm.com> <20181011203126.15338-1-ndesaulniers@google.com> Message-ID: Date: Fri, 12 Oct 2018 07:29:53 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20181011203126.15338-1-ndesaulniers@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nick, > @@ -123,7 +123,7 @@ static int TSS_rawhmac(unsigned char *digest, const unsigned char *key, > */ > static int TSS_authhmac(unsigned char *digest, const unsigned char *key, > unsigned int keylen, unsigned char *h1, > - unsigned char *h2, unsigned char h3, ...) > + unsigned char h2, unsigned char *h3, ...) > { > unsigned char paramdigest[SHA1_DIGEST_SIZE]; > struct sdesc *sdesc; So my concern here is that this actually breaks the natural argument order compared to what the specification uses. This in turn requires one to perform some mental gymnastics and I'm not sure that this is such a good idea. Refer to https://trustedcomputinggroup.org/wp-content/uploads/TPM-Main-Part-3-Commands_v1.2_rev116_01032011.pdf for details. Note that H3 is really the 'continueAuthSession' variable which is a bool. In the above specification BOOL has a size of 1, and TSS_authhmac already assigns a h3 to 'c' which is used for the actual hashing. So can't we simply use 'bool' or uint32 as the type for h3 instead of re-ordering everything? Regards, -Denis