(&mut self)
| 570 | } |
| 571 | |
| 572 | fn decrypt_f_opts_mac_commands(&mut self) -> Result<()> { |
| 573 | trace!("Decrypting mac-commands"); |
| 574 | let ds = self.device.as_ref().unwrap().get_device_session()?; |
| 575 | if ds.mac_version().to_string().starts_with("1.0") { |
| 576 | if let Err(e) = self.phy_payload.decode_f_opts_to_mac_commands() { |
| 577 | // This avoids failing in case of a corrupted mac-command in the frm_payload. |
| 578 | warn!(error = %e.full(), "Decoding f_opts mac-commands failed"); |
| 579 | } |
| 580 | } else { |
| 581 | let nwk_s_enc_key = AES128Key::from_slice(&ds.nwk_s_enc_key)?; |
| 582 | if let Err(e) = self.phy_payload.decrypt_f_opts(&nwk_s_enc_key) { |
| 583 | // This avoids failing in case of a corrupted mac-command in the frm_payload. |
| 584 | warn!(error = %e.full(), "Decrypting f_opts mac-commands failed"); |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | Ok(()) |
| 589 | } |
| 590 | |
| 591 | fn decrypt_frm_payload(&mut self) -> Result<()> { |
| 592 | trace!("Decrypting FRMPayload"); |
no test coverage detected