From edd65fb13229755f67b4c496ecce5156c0f2966d Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sat, 16 Jul 2016 05:17:31 +0200 Subject: [PATCH] Const-correct HKDF_expand. prk should be a const parameter. Change-Id: I2369ed9f87fc3c59afc07d3b667b86aec340052e Reviewed-on: https://boringssl-review.googlesource.com/8810 Reviewed-by: Steven Valdez Reviewed-by: David Benjamin Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/hkdf/hkdf.c | 2 +- include/openssl/hkdf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/hkdf/hkdf.c b/crypto/hkdf/hkdf.c index d80834d8..f21cb42d 100644 --- a/crypto/hkdf/hkdf.c +++ b/crypto/hkdf/hkdf.c @@ -55,7 +55,7 @@ int HKDF_extract(uint8_t *out_key, size_t *out_len, const EVP_MD *digest, } int HKDF_expand(uint8_t *out_key, size_t out_len, const EVP_MD *digest, - uint8_t *prk, size_t prk_len, const uint8_t *info, + const uint8_t *prk, size_t prk_len, const uint8_t *info, size_t info_len) { /* https://tools.ietf.org/html/rfc5869#section-2.3 */ const size_t digest_len = EVP_MD_size(digest); diff --git a/include/openssl/hkdf.h b/include/openssl/hkdf.h index a484a309..bffb01ec 100644 --- a/include/openssl/hkdf.h +++ b/include/openssl/hkdf.h @@ -50,7 +50,7 @@ OPENSSL_EXPORT int HKDF_extract(uint8_t *out_key, size_t *out_len, * |out_len| from the PRK |prk| and info |info| using |digest|, and outputs * the result to |out_key|. It returns one on success and zero on error. */ OPENSSL_EXPORT int HKDF_expand(uint8_t *out_key, size_t out_len, - const EVP_MD *digest, uint8_t *prk, + const EVP_MD *digest, const uint8_t *prk, size_t prk_len, const uint8_t *info, size_t info_len);