Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70D63C432C0 for ; Thu, 21 Nov 2019 03:11:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D97820721 for ; Thu, 21 Nov 2019 03:11:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="jSQRp8Ql" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726333AbfKUDLW (ORCPT ); Wed, 20 Nov 2019 22:11:22 -0500 Received: from linux.microsoft.com ([13.77.154.182]:42906 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfKUDLW (ORCPT ); Wed, 20 Nov 2019 22:11:22 -0500 Received: from [10.137.112.108] (unknown [131.107.174.108]) by linux.microsoft.com (Postfix) with ESMTPSA id BB23820B7185; Wed, 20 Nov 2019 19:11:21 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BB23820B7185 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1574305881; bh=gTFGVwIweV1rSl+0K4uxrvsQYK2nyN8aEGlIR9MKgV0=; h=Subject:To:References:From:Date:In-Reply-To:From; b=jSQRp8Qlr0Z+080phAZU/poDFshC1wW4Q5gy0b7vwdikQZyT/3ouS0p3UxIYj77M4 CgBDKbTerQyk0O5+sIVveKVmtl0kMBHkAnJxLc5UTEk4N90WXAcXR3MoSWgJXq6h3f aVihKY6ND0bmIZZIlfB0OaLepBLJGLTFLu5gdOt0= Subject: Re: [PATCH v8 4/5] IMA: Add support to limit measuring keys To: Mimi Zohar , linux-integrity@vger.kernel.org, dhowells@redhat.com References: <20191118223818.3353-1-nramas@linux.microsoft.com> <20191118223818.3353-5-nramas@linux.microsoft.com> <1574291957.4793.144.camel@linux.ibm.com> <1574297611.4793.154.camel@linux.ibm.com> From: Lakshmi Ramasubramanian Message-ID: <9ed2c456-c959-06d8-7e4c-34662d60b169@linux.microsoft.com> Date: Wed, 20 Nov 2019 19:11:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1574297611.4793.154.camel@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org Adding David Howells@Redhat Hi David, On 11/20/19 4:53 PM, Mimi Zohar wrote: > I would very much like for a regression test to be included in this > patch set, but it isn't a requirement, as long as everything needed > for verifying a signature is included in the key measurement. /* * Cryptographic data for the public-key subtype of * the asymmetric key type. * * Note that this may include private part of the key as well * as the public part. */ struct public_key { void *key; u32 keylen; enum OID algo; void *params; u32 paramlen; bool key_is_private; const char *id_type; const char *pkey_algo; }; From the "struct key" the public_key is being retrieved like this: struct public_key *pk = key->payload.data[asym_crypto]; The buffer being measured currently includes the data pointed to by "key" only (in struct public_key). The function that verifies signature using public key takes public_key and public_key_signature as input: /* * Verify a signature using a public key. */ int public_key_verify_signature(const struct public_key *pkey, const struct public_key_signature *sig) Just wanted to confirm: For verifying "struct public_key_signature" would it be sufficient if I include all the fields in "struct public_key" structure? thanks, -lakshmi