@@ -553,6 +553,7 @@ bool mesh_crypto_packet_build(bool ctl, uint8_t ttl,
if (seq > SEQ_MASK)
return false;
+ packet[0] = 0;
l_put_be32(seq, packet + 1);
packet[1] = (ctl ? CTL : 0) | (ttl & TTL_MASK);
@@ -1596,6 +1596,8 @@ static void get_managed_objects_cb(struct l_dbus_message *msg, void *user_data)
/* Generate device and primary network keys */
l_getrandom(dev_key, sizeof(dev_key));
l_getrandom(net_key.old_key, sizeof(net_key.old_key));
+ memcpy(net_key.new_key, net_key.old_key,
+ sizeof(net_key.old_key));
net_key.net_idx = PRIMARY_NET_IDX;
net_key.phase = KEY_REFRESH_PHASE_NONE;