Skip to content

Commit 096f97d

Browse files
committed
bootutil: Replace uint16_t with size_t in hkdf
Allows to reuse size_t variables. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
1 parent 4992f07 commit 096f97d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

boot/bootutil/src/encrypted.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ parse_x25519_enckey(uint8_t **p, uint8_t *end, uint8_t *private_key)
239239
* @param okm_len On input the requested length; on output the generated length
240240
*/
241241
static int
242-
hkdf(uint8_t *ikm, uint16_t ikm_len, uint8_t *info, uint16_t info_len,
243-
uint8_t *okm, uint16_t *okm_len)
242+
hkdf(const uint8_t *ikm, size_t ikm_len, const uint8_t *info, size_t info_len,
243+
uint8_t *okm, size_t *okm_len)
244244
{
245245
bootutil_hmac_sha256_context hmac;
246246
uint8_t salt[BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE];
247247
uint8_t prk[BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE];
248248
uint8_t T[BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE];
249-
uint16_t off;
250-
uint16_t len;
249+
size_t off;
250+
size_t len;
251251
uint8_t counter;
252252
bool first;
253253
int rc;
@@ -393,7 +393,7 @@ boot_decrypt_key(const uint8_t *buf, uint8_t *enckey)
393393
bootutil_key_xchange_ctx pk_ctx;
394394
uint8_t *cp;
395395
uint8_t *cpend;
396-
uint16_t len;
396+
size_t len;
397397
#endif
398398
struct bootutil_key *bootutil_enc_key = NULL;
399399
int rc = -1;

0 commit comments

Comments
 (0)