All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH] fscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand()
Date: Fri, 3 Jan 2020 08:58:38 -0800	[thread overview]
Message-ID: <20200103165837.GE19521@gmail.com> (raw)
In-Reply-To: <20191209204054.227736-1-ebiggers@kernel.org>

On Mon, Dec 09, 2019 at 12:40:54PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> 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 <ebiggers@google.com>
> ---
>  fs/crypto/fscrypt_private.h | 2 +-
>  fs/crypto/hkdf.c            | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/crypto/fscrypt_private.h b/fs/crypto/fscrypt_private.h
> index 130b50e5a0115..23cef4d3793a5 100644
> --- a/fs/crypto/fscrypt_private.h
> +++ b/fs/crypto/fscrypt_private.h
> @@ -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);
>  
> diff --git a/fs/crypto/hkdf.c b/fs/crypto/hkdf.c
> index f21873e1b4674..efb95bd19a894 100644
> --- a/fs/crypto/hkdf.c
> +++ b/fs/crypto/hkdf.c
> @@ -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)
>  {
> -- 
> 2.24.0.393.g34dc348eaf-goog
> 

Applied to fscrypt.git#master for 5.6.

- Eric

      reply	other threads:[~2020-01-03 16:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 20:40 [PATCH] fscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand() Eric Biggers
2020-01-03 16:58 ` Eric Biggers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200103165837.GE19521@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.