Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp193458ybe; Wed, 4 Sep 2019 17:54:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzl8WpVKGHT6d40AU5xbhLOsXcjnA0zfhRJ1qP/neg+C5rh14TIA51jSoVmcIiyQaDh8bh9 X-Received: by 2002:a63:d741:: with SMTP id w1mr735582pgi.155.1567644894668; Wed, 04 Sep 2019 17:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567644894; cv=none; d=google.com; s=arc-20160816; b=HNmqJciGI/0yC7IZO8+gW7lXyDB4gA16Xmiwt89iYopgryT9hnGoLm9NLtdlpEkNYo +64oM3SErdZLyFD1M+lWu/fJFYHLr2ihq8GPom6I2o9Ro/EN0IescfIPALFThtnharyt LL/MHDSKLBqS9AzzMItG5NB6IclUMbcbZcEg9tJEHChGFQ1i4V9SlT9BF2uDurSu/BxK 6wNoesLoTiVaHARWw8zL59/IMiI1Q4NetByyNL6y8j1W5QrStj83Cc5jvw/7odWxwztc khScy/eJ5E+2m3yoHRG1+kSNsN3Rp7G6CetKW1AjPdWF1I7Fl+bXj3D992/664xUspVz 2jdg== 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:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id; bh=t0sInpCsNwjKx/WOE9j8WaMUQfPU3XRP+6Fq8GvJlLU=; b=gym/yQpKVw5DZSfqATj//ccGdUtzSACq1kMWz5EeczxDI/nyBN7iCAWVV5HVrKLuuw 4z9slali6AdRWcsmU/r516/DeWFTolLE+SFeyuWhuq+G4pZwiwVogbTzFuhVd2vPTJEL HyBlwyG78E3SMwTldGKIwRx4vVT1pdjQ1SK2I9VX2XZkdeW5DxvKMDKQbeOpNkyOhlmy iXKY6HuVGcmVKxe4qn405qt5l2K6S9PkD/RDVW6XxxnGeRw3AOlGT+A2UF+93xsQZs04 EB0PT+7A2N4JWXq+YQMoNCS7SewrSmNpHdDrJSmU8PJlK1W/YWkjRg0PAQqwEWAoYtjF VPrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si443549plr.388.2019.09.04.17.54.21; Wed, 04 Sep 2019 17:54:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727900AbfIEAuE (ORCPT + 99 others); Wed, 4 Sep 2019 20:50:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55844 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbfIEAuD (ORCPT ); Wed, 4 Sep 2019 20:50:03 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7315307D96D; Thu, 5 Sep 2019 00:50:03 +0000 (UTC) Received: from ovpn-116-252.phx2.redhat.com (ovpn-116-252.phx2.redhat.com [10.3.116.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4302A5D71C; Thu, 5 Sep 2019 00:50:02 +0000 (UTC) Message-ID: <90d43fc29c623aef70609bf02ef3eba54652c8ce.camel@redhat.com> Subject: Re: [PATCH 0/2] nfsd: add principal to the data being tracked by nfsdcld From: Simo Sorce To: Scott Mayhew Cc: Chuck Lever , Bruce Fields , Linux NFS Mailing List Date: Wed, 04 Sep 2019 20:50:01 -0400 In-Reply-To: <20190904205826.GH11980@coeurl.usersys.redhat.com> References: <20190830162631.13195-1-smayhew@redhat.com> <4598a6617fcb0123fb8c5c19e0ed2e489b242bcf.camel@redhat.com> <20190904205826.GH11980@coeurl.usersys.redhat.com> Organization: Red Hat, Inc. Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 05 Sep 2019 00:50:03 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 2019-09-04 at 16:58 -0400, Scott Mayhew wrote: > > While thinking about this I wondered, why not simply hash (SHA-256 for > > example) the principal name and store the hash instead? > > > > It will make the length fixed and uniform and probably often shorter > > than the real principal names, so saving space in the general case. > > > > I am not against truncating to 1024, but a hash would be more elegant > > and correct. > > I can do that. Is there any reason I would want to convert the hash to > to a human-readable format (i.e. something that would match the > sha256sum command-line tool's output) or can I just use the raw buffer? > Note that if we wanted to print the hash in an error message or > something, I can just use printk's %*phN format specifier... I do not see a reason to waste time turning to ascii before the time you really need to. A byte buffer is perfectly fine. Simo. -- Simo Sorce RHEL Crypto Team Red Hat, Inc