From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, FSL_HELO_FAKE,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 F0316C43331 for ; Mon, 30 Mar 2020 19:51:56 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE0CF20786; Mon, 30 Mar 2020 19:51:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="Ayzbwqb3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="NeosJFaF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="xIiTUT/+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE0CF20786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ0Rw-0004lo-2g; Mon, 30 Mar 2020 19:51:56 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jJ0Rv-0004lc-5F for linux-f2fs-devel@lists.sourceforge.net; Mon, 30 Mar 2020 19:51:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7mjw8Nrq5+AdWE80pGez9BP1S+Z+Lv8oRVPSmylobEU=; b=Ayzbwqb3egjQEa1YAoQNH0V0Rt 22wHPZKD5Su4jymS/4rY0Lb5vcZQWiuyvanBjnbX8EqmPQ9IdZLQFYDT595zZoqrI4KIeluwob4T5 8SFD1pFlYpeD8RYYsJUNgXjQtlfSR5KGWle8rmFrE/qgZFrkhlwh114OKG9LftI1brII=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7mjw8Nrq5+AdWE80pGez9BP1S+Z+Lv8oRVPSmylobEU=; b=NeosJFaFLYK2k3lTBDiVNKQuXM j/d43sFWrjeqmv2bv6nwHlJXwabFxVrrNwgmOq3J6zfyp1j0DLjXkFUlQ7AcgV4yh/mq8m9+m9cvr xQVfHYoRmC+grL4OWb+smtvrcnW1JEWzdmkLAGGgsDJQ/jC3MRZSYOMO8V2JkYHScb3w=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jJ0Rq-00Fgoj-L0 for linux-f2fs-devel@lists.sourceforge.net; Mon, 30 Mar 2020 19:51:55 +0000 Received: from gmail.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F18FF20786; Mon, 30 Mar 2020 19:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585597905; bh=Jrr/GMo+BoBZD5FSW+sCimxvpmPl3HTWCaIMZEJChsw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xIiTUT/+wur+4UN/FQbywwB4M7OmW8hEBOyz47L+Y/UhAa2k9747q8hm1eI28yYZB k6MKuFBVEDF6JuXaP6qPBq9/RfWQgk3a7tMNbuXlMXfIiFgmV+z3q4oXeF+TvnF/m1 98PllgCYvTbAl4P2K8lTo+DPB+0dyNyX48JTGXMU= Date: Mon, 30 Mar 2020 12:51:43 -0700 From: Eric Biggers To: Jaegeuk Kim Message-ID: <20200330195143.GB108564@gmail.com> References: <20200330192524.8931-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200330192524.8931-1-jaegeuk@kernel.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Headers-End: 1jJ0Rq-00Fgoj-L0 Subject: Re: [f2fs-dev] [PATCH] f2fscrypt: show more information of policy X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, Mar 30, 2020 at 12:25:24PM -0700, Jaegeuk Kim wrote: > From: Jaegeuk Kim > > This patch gives more information of encryption policy. > > Signed-off-by: Jaegeuk Kim > Change-Id: I04a6826aa4497554ce79d884d495b3dda1b64fac > --- > tools/f2fscrypt.c | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/tools/f2fscrypt.c b/tools/f2fscrypt.c > index fe3e0ff..bb3e70f 100644 > --- a/tools/f2fscrypt.c > +++ b/tools/f2fscrypt.c I'm a little confused why the f2fscrypt tool even exists? Who is using it? It looks like this code was all copied from e4crypt, which is no longer being maintained either as there are now better filesystem-independent tools: - https://github.com/google/fscrypt - https://github.com/google/fscryptctl - https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/io/encrypt.c Would one of those work for you instead? > @@ -63,6 +63,8 @@ > #define F2FS_ENCRYPTION_MODE_AES_256_GCM 2 > #define F2FS_ENCRYPTION_MODE_AES_256_CBC 3 > #define F2FS_ENCRYPTION_MODE_AES_256_CTS 4 > +#define F2FS_ENCRYPTION_MODE_ADIANTUM 9 > +#define F2FS_ENCRYPTION_MODE_PRIVATE 127 This doesn't match the list of encryption modes from the UAPI header. > +static const char *get_crypt_mode(int mode) > +{ > + int i; > + > + for (i = 0; i < (sizeof(enc_mode_str) / sizeof(enc_mode_str[0])); ++i) { > + if (mode == enc_mode_str[i].mode) { > + return enc_mode_str[i].name; > + } > + } > + return "N/A"; > +} If the mode number is unrecognized, it should show the number. - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel