From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Sheng Yong <shengyong1@huawei.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/2] dump/fsck: convert encrypted file name
Date: Wed, 26 Oct 2016 10:18:01 +0900 [thread overview]
Message-ID: <20161026011801.GB4173@jaegeuk> (raw)
In-Reply-To: <580D843A.3000208@huawei.com>
Hi,
On Mon, Oct 24, 2016 at 11:47:06AM +0800, Sheng Yong wrote:
> Hi, Jaegeuk,
>
> On 10/24/2016 10:16 AM, Sheng Yong wrote:
> > If fscrypt is enabled, we need to convert the encrypted file name before
> > printing it. So let's export convert_encrypted_name for other functions,
> > and make it returns the length of converted string.
> > This patch also changes the parameter of file_is_encrypt to f2fs_inode.
> >
> [...]
> > -static void convert_encrypted_name(unsigned char *name, int len,
> > +int convert_encrypted_name(unsigned char *name, int len,
> > unsigned char *new, int encrypted)
> > {
> > if (!encrypted) {
> > memcpy(new, name, len);
> > new[len] = 0;
> > - return;
> > + return len;
> > }
> >
> > *new = '_';
> > - digest_encode((const char *)name, 24, (char *)new + 1);
> > + return digest_encode((const char *)name, 24, (char *)new + 1);
> I'm confused about the parameter "24" here. Why it is not the length of
> the cipher text?
It's just to sync with fscrypt_fname_disk_to_usr which uses 24 bytes for the
encrypted name without a key.
>
> thanks,
> Sheng
> > }
> [...]
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
prev parent reply other threads:[~2016-10-26 1:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 2:16 [PATCH 1/2] dump/fsck: convert encrypted file name Sheng Yong
2016-10-24 2:16 ` [PATCH 2/2] fsck.f2fs: do not check the first seg in a sec in find_next_free_block Sheng Yong
2016-10-24 3:47 ` [PATCH 1/2] dump/fsck: convert encrypted file name Sheng Yong
2016-10-26 1:18 ` Jaegeuk Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161026011801.GB4173@jaegeuk \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=shengyong1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).