Whamcloud - gitweb
LU-16374 enc: align Base64 encoding with RFC 4648 base64url 81/49581/3
authorSebastien Buisson <sbuisson@ddn.com>
Sun, 18 Jul 2021 00:01:25 +0000 (19:01 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 31 Jan 2023 02:34:01 +0000 (02:34 +0000)
commit583ee6911b6cac7f2867a37101cc069b4011b73f
tree53c75ccadcca3dc73b92455847c41fb0de356ea0
parentab816f081ab4f59ed8c44658516b7cf1771fc04d
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}

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iaa2256da7fb591d842b5bb7aa474b2ee6de9899d
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49581
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@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