fscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand()
Eric Biggers
maintainerPATCH 1/1 fscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand()
From: Eric Biggers <[email protected]>
Constify the struct fscrypt_hkdf parameter to fscrypt_hkdf_expand(). This makes it clearer that struct fscrypt_hkdf contains the key only, not any per-request state.
Signed-off-by Eric Biggers <[email protected]>
--- fs/crypto/fscrypt_private.h | 2 +- fs/crypto/hkdf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/crypto/fscrypt_private.h +1 -1
@@ -287,7 +287,7 @@ extern int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key,#define HKDF_CONTEXT_DIRECT_KEY 3#define HKDF_CONTEXT_IV_INO_LBLK_64_KEY 4 -extern int fscrypt_hkdf_expand (struct fscrypt_hkdf *hkdf,u8 context, +extern int fscrypt_hkdf_expand (const struct fscrypt_hkdf *hkdf,u8 context,const u8 *info,unsigned int infolen,u8 *okm,unsigned int okmlen);
fs/crypto/hkdf.c +1 -1
@@ -112,7 +112,7 @@ int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key,* adds to its application-specific info strings to guarantee that it doesn't * accidentally repeat an info string when using HKDF for different purposes.) */ -int fscrypt_hkdf_expand (struct fscrypt_hkdf *hkdf,u8 context, +int fscrypt_hkdf_expand (const struct fscrypt_hkdf *hkdf,u8 context,const u8 *info,unsigned int infolen,u8 *okm,unsigned int okmlen) {
Signature · 1 line
2.24.0.393.g34dc348eaf-goog
Quoted 41 lines · Eric Biggers
From: Eric Biggers <[email protected]>
Constify the struct
fscrypt_hkdfparameter tofscrypt_hkdf_expand(). This makes it clearer that structfscrypt_hkdfcontains the key only, not any per-request state.Signed-off-by Eric Biggers <[email protected]>--- fs/crypto/fscrypt_private.h | 2 +- fs/crypto/hkdf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/crypto/fscrypt_private.h +1
-1@@ -287,7 +287,7 @@ extern int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key,#define HKDF_CONTEXT_DIRECT_KEY 3#define HKDF_CONTEXT_IV_INO_LBLK_64_KEY 4 -extern int fscrypt_hkdf_expand (struct fscrypt_hkdf *hkdf,u8 context, +extern int fscrypt_hkdf_expand (const struct fscrypt_hkdf *hkdf,u8 context,const u8 *info,unsigned int infolen,u8 *okm,unsigned int okmlen);fs/crypto/hkdf.c +1
-1@@ -112,7 +112,7 @@ int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key,* adds to its application-specific info strings to guarantee that it doesn't * accidentally repeat an info string when using HKDF for different purposes.) */ -int fscrypt_hkdf_expand (struct fscrypt_hkdf *hkdf,u8 context, +int fscrypt_hkdf_expand (const struct fscrypt_hkdf *hkdf,u8 context,const u8 *info,unsigned int infolen,u8 *okm,unsigned int okmlen) {Signature · 1 line
2.24.0.393.g34dc348eaf-goog
Applied to fscrypt.git#master for 5.6.
- Eric