From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754764AbdERJi6 (ORCPT ); Thu, 18 May 2017 05:38:58 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:26854 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbdERJiz (ORCPT ); Thu, 18 May 2017 05:38:55 -0400 Subject: Re: [Linux-ima-devel] [PATCH 0/7] IMA: new parser for ima_restore_measurement_list() To: Ken Goldman , References: <20170516125347.10574-1-roberto.sassu@huawei.com> <4f5bc289-92cb-1ce2-4496-387efbb11769@linux.vnet.ibm.com> <42b629dd-0d1f-b066-03e4-c013d0891ba7@huawei.com> <4b536b04-0e61-aea4-fc27-8dd12f2e3a1b@linux.vnet.ibm.com> CC: , From: Roberto Sassu Message-ID: <3b204e09-c1c0-b3bc-90fe-a8dfb86baadc@huawei.com> Date: Thu, 18 May 2017 11:38:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <4b536b04-0e61-aea4-fc27-8dd12f2e3a1b@linux.vnet.ibm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.220.96.113] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.591D6BA3.0018,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6abf97a76eba173f1d63697363d9aa4d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/17/2017 6:28 PM, Ken Goldman wrote: > On 5/17/2017 3:25 AM, Roberto Sassu wrote: >> >> The format of digestN is: :\0, the same used >> for the file digest. > > Since the format is changing from the SHA-1 log format anyway ... > > How do people feel about the colon and null terminated string format for > algorithm identifiers? > > The TCG standard enumerations are uint16_t, and there is a registry of > hash algorithms. > > As a consuming parser, it feels nice to know it's always 2 bytes and not > have to worry about a missing colon or a missing nul terminator risking > a buffer overflow. There cannot be buffer overflow, because the length of each digest field is known. Roberto