Skip to content

Commit

Permalink
fscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand()
Browse files Browse the repository at this point in the history
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.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Eric Biggers <[email protected]>
  • Loading branch information
ebiggers committed Dec 31, 2019
1 parent c64cfb9 commit 2a5831b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/crypto/fscrypt_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion fs/crypto/hkdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 2a5831b

Please sign in to comment.