Whamcloud - gitweb
LU-16374 enc: align Base64 encoding with RFC 4648 base64url
authorSebastien Buisson <sbuisson@ddn.com>
Sun, 18 Jul 2021 00:01:25 +0000 (19:01 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 8 Feb 2023 05:52:52 +0000 (05:52 +0000)
commit4eee71fbf477510e5eba141526bc68e25cf3cfb4
treef339c0efd8cb53acdda0a2a4faf57102d2ff10b4
parent7c5d1ec252df0a4ca4d1e4e1acb3ad5bb3467fcf
LU-16374 enc: align Base64 encoding with RFC 4648 base64url

Lustre encryption uses a Base64 encoding to encode no-key filenames
(the filenames that are presented to userspace when a directory is
listed without its encryption key).
Make this Base64 encoding compliant with RFC 4648 base64url. And use
'+' leading character to distringuish digested names.

This is adapted from kernel commit
ba47b515f594 fscrypt: align Base64 encoding with RFC 4648 base64url

To maintain compatibility with older clients, a new llite parameter
named 'filename_enc_use_old_base64' is introduced, set to 0 by
default. When 0, Lustre uses new-fashion base64 encoding. When set to
1, Lustre uses old-style base64 encoding.

To set this parameter globally for all clients, do on the MGS:
mgs# lctl set_param -P llite.*.filename_enc_use_old_base64={0,1}

Lustre-change: https://review.whamcloud.com/49581
Lustre-commit: 583ee6911b6cac7f2867a37101cc069b4011b73f

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iaa2256da7fb591d842b5bb7aa474b2ee6de9899d
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/49900
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
libcfs/include/libcfs/crypto/llcrypt.h
libcfs/libcfs/crypto/fname.c
lustre/include/lustre_disk.h
lustre/llite/crypto.c
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c