Fix compilation with gcc-11.

Closes #17281
This commit is contained in:
Constantine Gavrilov 2021-03-10 12:54:33 +02:00 committed by Pascal Quantin
parent 6341257fae
commit 5db4d2c0c9
5 changed files with 13 additions and 13 deletions

View File

@ -963,9 +963,9 @@ static const gchar* get_pid_name( gint ot, gint pid )
*/
static const guint8* decrypt_data_security_data_with_key( const guint8* key, const guint8* encrypted, gint encrypted_size, const guint8* cemi, gint cemi_size )
{
guint8 ctr_0[ 16 ];
guint8 b_0[ 16 ];
guint8 mac[ 16 ];
guint8 ctr_0[ KNX_KEY_LENGTH ];
guint8 b_0[ KNX_KEY_LENGTH ];
guint8 mac[ KNX_KEY_LENGTH ];
guint8* a_bytes = 0;
const guint8* p_bytes = NULL;
gint a_length = 0;

View File

@ -2585,7 +2585,7 @@ static guint8* decrypt_secure_wrapper( const guint8* key, const guint8* data, gi
if( decrypted )
{
/* Calculate MAC */
guint8 mac[ 16 ];
guint8 mac[ KNX_KEY_LENGTH ];
p_length -= 16;
knxip_ccm_calc_cbc_mac( mac, key, data, a_length, decrypted, p_length, nonce, 14 );
@ -2809,7 +2809,7 @@ static guint8 check_timer_sync_mac( const guint8* key, const guint8* data, gint
{
// Calculate and encrypt MAC
const guint8* nonce = data + header_length;
guint8 mac[ 16 ];
guint8 mac[ KNX_KEY_LENGTH ];
knxip_ccm_calc_cbc_mac( mac, key, data, header_length, NULL, 0, nonce, 14 );
knxip_ccm_encrypt( mac, key, NULL, 0, mac, nonce, 14 );

View File

@ -57,7 +57,7 @@ static void build_ctr0( guint8 p_result[ KNX_KEY_LENGTH ], const guint8* nonce,
}
// Calculate MAC for KNX IP Security or KNX Data Security
void knx_ccm_calc_cbc_mac( guint8* p_mac, const guint8 key[ KNX_KEY_LENGTH ],
void knx_ccm_calc_cbc_mac(guint8 p_mac[ KNX_KEY_LENGTH ], const guint8 key[ KNX_KEY_LENGTH ],
const guint8* a_bytes, gint a_length, const guint8* p_bytes, gint p_length,
const guint8 b_0[ KNX_KEY_LENGTH ] )
{
@ -103,7 +103,7 @@ void knx_ccm_calc_cbc_mac( guint8* p_mac, const guint8 key[ KNX_KEY_LENGTH ],
}
// Calculate MAC for KNX IP Security, using 6-byte Sequence ID
void knxip_ccm_calc_cbc_mac( guint8* p_mac, const guint8 key[ KNX_KEY_LENGTH ],
void knxip_ccm_calc_cbc_mac( guint8 p_mac[ KNX_KEY_LENGTH ], const guint8 key[ KNX_KEY_LENGTH ],
const guint8* a_bytes, gint a_length, const guint8* p_bytes, gint p_length,
const guint8* nonce, guint8 nonce_length )
{
@ -183,7 +183,7 @@ guint8* knx_ccm_encrypt( guint8* p_result, const guint8 key[ KNX_KEY_LENGTH ], c
// Encrypt for KNX IP Security (with 16-byte MAC and Nonce based on 6-byte Sequence ID)
guint8* knxip_ccm_encrypt( guint8* p_result, const guint8 key[ KNX_KEY_LENGTH ], const guint8* p_bytes, gint p_length,
const guint8* mac, const guint8* nonce, guint8 nonce_length )
const guint8 mac[KNX_KEY_LENGTH], const guint8* nonce, guint8 nonce_length )
{
guint8 ctr_0[ KNX_KEY_LENGTH ];
build_ctr0( ctr_0, nonce, nonce_length );

View File

@ -10189,7 +10189,7 @@ hfinfo_number_value_format(const header_field_info *hfinfo, char buf[32], guint3
}
static const char *
hfinfo_number_value_format64(const header_field_info *hfinfo, char buf[64], guint64 value)
hfinfo_number_value_format64(const header_field_info *hfinfo, char buf[48], guint64 value)
{
int display = hfinfo->display;
@ -10250,7 +10250,7 @@ hfinfo_numeric_value_format(const header_field_info *hfinfo, char buf[32], guint
}
static const char *
hfinfo_numeric_value_format64(const header_field_info *hfinfo, char buf[64], guint64 value)
hfinfo_numeric_value_format64(const header_field_info *hfinfo, char buf[48], guint64 value)
{
/* Get the underlying BASE_ value */
int display = FIELD_DISPLAY(hfinfo->display);
@ -10307,7 +10307,7 @@ hfinfo_number_vals_format(const header_field_info *hfinfo, char buf[32], guint32
}
static const char *
hfinfo_number_vals_format64(const header_field_info *hfinfo, char buf[64], guint64 value)
hfinfo_number_vals_format64(const header_field_info *hfinfo, char buf[48], guint64 value)
{
/* Get the underlying BASE_ value */
int display = FIELD_DISPLAY(hfinfo->display);

View File

@ -338,7 +338,7 @@ gen_poly(void)
*/
int
encode_rs(dtype data[KK], dtype bb[NN-KK])
encode_rs(dtype data[], dtype bb[])
{
register int i, j;
gf feedback;
@ -406,7 +406,7 @@ encode_rs(dtype data[KK], dtype bb[NN-KK])
*/
int
eras_dec_rs(dtype data[NN], int eras_pos[NN-KK], int no_eras)
eras_dec_rs(dtype data[], int eras_pos[], int no_eras)
{
int deg_lambda, el, deg_omega;
int i, j, r,k;