]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More bounds checks
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 6 Jan 2019 08:31:27 +0000 (16:31 +0800)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 6 Jan 2019 08:31:41 +0000 (16:31 +0800)
src/lib/sim/base.h
src/lib/sim/crypto.c

index c06cd8b9e0a99cd9abe7dcc8cac366fd0cdd33d7..e5e7911f9723d6fb6d1b34f16feffb08ce6c882f 100644 (file)
@@ -257,7 +257,8 @@ int         fr_sim_crypto_update_checkcode(fr_sim_checkcode_t *checkcode, eap_packet_t
 
 ssize_t                fr_sim_crypto_finalise_checkcode(uint8_t *out, fr_sim_checkcode_t **checkcode);
 
-ssize_t                fr_sim_crypto_sign_packet(uint8_t out[SIM_MAC_DIGEST_SIZE], eap_packet_t *eap_packet, bool zero_mac,
+ssize_t                fr_sim_crypto_sign_packet(uint8_t out[static SIM_MAC_DIGEST_SIZE],
+                                         eap_packet_t *eap_packet, bool zero_mac,
                                          EVP_MD const *md, uint8_t const *key, size_t const key_len,
                                          uint8_t const *hmac_extra, size_t const hmac_extra_len);
 
@@ -266,7 +267,7 @@ int         fr_sim_crypto_kdf_0_gsm(fr_sim_keys_t *keys);
 int            fr_sim_crypto_kdf_0_umts(fr_sim_keys_t *keys);
 
 void           fr_sim_crypto_keys_init_kdf_0_reauth(fr_sim_keys_t *keys,
-                                                    uint8_t const master_key[SIM_MK_SIZE], uint16_t counter);
+                                                    uint8_t const master_key[static SIM_MK_SIZE], uint16_t counter);
 
 int            fr_sim_crypto_kdf_0_reauth(fr_sim_keys_t *keys);
 
index 3c1dea40a934f4af9dbee207bdc6865c29ac6724..ec58efd7a367a4409e2534a6e472225bfa16617c 100644 (file)
@@ -230,7 +230,8 @@ static int fr_sim_find_mac(uint8_t const **out, uint8_t *data, size_t data_len)
  *     - 0 if there's no MAC attribute to verify.
  *     - > 0 the number of bytes written to out.
  */
-ssize_t fr_sim_crypto_sign_packet(uint8_t out[16], eap_packet_t *eap_packet, bool zero_mac,
+ssize_t fr_sim_crypto_sign_packet(uint8_t out[static SIM_MAC_DIGEST_SIZE],
+                                  eap_packet_t *eap_packet, bool zero_mac,
                                  EVP_MD const *md, uint8_t const *key, size_t const key_len,
                                  uint8_t const *hmac_extra, size_t const hmac_extra_len)
 {
@@ -574,7 +575,7 @@ int fr_sim_crypto_kdf_0_umts(fr_sim_keys_t *keys)
  * @param[in] counter          re-authentication counter.
  */
 void fr_sim_crypto_keys_init_kdf_0_reauth(fr_sim_keys_t *keys,
-                                         uint8_t const master_key[SIM_MK_SIZE], uint16_t counter)
+                                         uint8_t const master_key[static SIM_MK_SIZE], uint16_t counter)
 {
        uint32_t nonce_s[4];