[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aMPQ/sJJmgpZvDsY@wu-Pro-E500-G6-WS720T>
Date: Fri, 12 Sep 2025 15:51:26 +0800
From: Guan-Chun Wu <409411716@....tku.edu.tw>
To: Eric Biggers <ebiggers@...nel.org>
Cc: akpm@...ux-foundation.org, axboe@...nel.dk, ceph-devel@...r.kernel.org,
hch@....de, home7438072@...il.com, idryomov@...il.com,
jaegeuk@...nel.org, kbusch@...nel.org,
linux-fscrypt@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-nvme@...ts.infradead.org, sagi@...mberg.me, tytso@....edu,
visitorckw@...il.com, xiubli@...hat.com
Subject: Re: [PATCH v2 4/5] fscrypt: replace local base64url helpers with
generic lib/base64 helpers
Hi Eric,
On Thu, Sep 11, 2025 at 11:47:05AM -0700, Eric Biggers wrote:
> On Thu, Sep 11, 2025 at 03:45:56PM +0800, Guan-Chun Wu wrote:
> > Replace the existing local base64url encoding and decoding functions in
> > fscrypt with the generic base64_encode_custom and base64_decode_custom
> > helpers from the kernel's lib/base64 library.
>
> But those aren't the functions that are actually used.
>
I'll update the commit message. I meant base64_encode and base64_decode.
> > This removes custom implementations in fscrypt, reduces code duplication,
> > and leverages the well-maintained,
>
> Who is maintaining lib/base64.c? I guess Andrew?
>
Yes, Andrew is maintaining lib/base64.c.
> > standard base64 code within the kernel.
>
> fscrypt uses "base64url", not "base64".
>
You're right, I'll update the commit message in the next version.
> > /* Encoded size of max-size no-key name */
> > #define FSCRYPT_NOKEY_NAME_MAX_ENCODED \
> > - FSCRYPT_BASE64URL_CHARS(FSCRYPT_NOKEY_NAME_MAX)
> > + BASE64_CHARS(FSCRYPT_NOKEY_NAME_MAX)
>
> Does BASE64_CHARS() include '=' padding or not?
>
> - Eric
No, BASE64_CHARS() doesn't include the '=' padding; it's defined as #define BASE64_CHARS(nbytes) DIV_ROUND_UP((nbytes) * 4, 3).
Best regards,
Guan-chun
Powered by blists - more mailing lists