@@ -264,15 +264,15 @@ parse_x25519_enckey(uint8_t **p, uint8_t *end, uint8_t *private_key)
264
264
* @param okm_len On input the requested length; on output the generated length
265
265
*/
266
266
static int
267
- hkdf (uint8_t * ikm , uint16_t ikm_len , uint8_t * info , uint16_t info_len ,
268
- uint8_t * okm , uint16_t * okm_len )
267
+ hkdf (const uint8_t * ikm , size_t ikm_len , const uint8_t * info , size_t info_len ,
268
+ uint8_t * okm , size_t * okm_len )
269
269
{
270
270
bootutil_hmac_sha256_context hmac ;
271
271
uint8_t salt [BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE ];
272
272
uint8_t prk [BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE ];
273
273
uint8_t T [BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE ];
274
- uint16_t off ;
275
- uint16_t len ;
274
+ size_t off ;
275
+ size_t len ;
276
276
uint8_t counter ;
277
277
bool first ;
278
278
int rc ;
@@ -407,7 +407,6 @@ boot_decrypt_key(const uint8_t *buf, uint8_t *enckey)
407
407
{
408
408
#if defined(MCUBOOT_ENCRYPT_RSA )
409
409
bootutil_rsa_context pk_ctx ;
410
- size_t olen ;
411
410
#endif
412
411
#if defined(MCUBOOT_ENCRYPT_EC256 )
413
412
bootutil_ecdh_p256_context pk_ctx ;
@@ -423,11 +422,11 @@ boot_decrypt_key(const uint8_t *buf, uint8_t *enckey)
423
422
uint8_t derived_key [BOOT_ENC_KEY_SIZE + BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE ];
424
423
uint8_t private_key [PRIV_KEY_LEN ];
425
424
uint8_t counter [BOOT_ENC_BLOCK_SIZE ];
426
- uint16_t len ;
427
425
#endif
428
426
#if !defined(MCUBOOT_ENCRYPT_KW )
429
427
uint8_t * cp ;
430
428
uint8_t * cpend ;
429
+ size_t len ;
431
430
#endif
432
431
struct bootutil_key * bootutil_enc_key = NULL ;
433
432
int rc = -1 ;
@@ -456,7 +455,7 @@ boot_decrypt_key(const uint8_t *buf, uint8_t *enckey)
456
455
return rc ;
457
456
}
458
457
459
- rc = bootutil_rsa_oaep_decrypt (& pk_ctx , & olen , buf , enckey , BOOT_ENC_KEY_SIZE );
458
+ rc = bootutil_rsa_oaep_decrypt (& pk_ctx , & len , buf , enckey , BOOT_ENC_KEY_SIZE );
460
459
bootutil_rsa_drop (& pk_ctx );
461
460
if (rc ) {
462
461
return rc ;
0 commit comments