linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Sheng Yong <shengyong1@huawei.com>
To: linux-f2fs-devel@lists.sourceforge.net, jaegeuk@kernel.org,
	yuchao0@huawei.com
Subject: Re: [PATCH 1/2] dump/fsck: convert encrypted file name
Date: Mon, 24 Oct 2016 11:47:06 +0800	[thread overview]
Message-ID: <580D843A.3000208@huawei.com> (raw)
In-Reply-To: <20161024021604.5218-1-shengyong1@huawei.com>

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?

thanks,
Sheng
>  }
[...]


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

  parent reply	other threads:[~2016-10-24  3:47 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 ` Sheng Yong [this message]
2016-10-26  1:18   ` [PATCH 1/2] dump/fsck: convert encrypted file name Jaegeuk Kim

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=580D843A.3000208@huawei.com \
    --to=shengyong1@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=yuchao0@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).