Re: [PATCH v2 4/5] fscrypt: replace local base64url helpers with generic lib/base64 helpers

From: Eric Biggers

Date: Thu Sep 11 2025 - 14:48:27 EST


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.

> This removes custom implementations in fscrypt, reduces code duplication,
> and leverages the well-maintained,

Who is maintaining lib/base64.c? I guess Andrew?

> standard base64 code within the kernel.

fscrypt uses "base64url", not "base64".

> /* 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