Skip to content

Commit

Permalink
Initialise the M17 LSF correctly when not initialised.
Browse files Browse the repository at this point in the history
Use a private LSF for testing the encryption.
  • Loading branch information
g4klx committed Dec 6, 2023
1 parent 3337578 commit b18aeb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions M17Control.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020,2021 Jonathan Naylor, G4KLX
* Copyright (C) 2020,2021,2023 Jonathan Naylor, G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -553,7 +553,10 @@ void CM17Control::writeNetwork()
m_networkWatchdog.start();

if (!m_allowEncryption) {
unsigned char type = m_netLSF.getEncryptionType();
CM17LSF lsf;
lsf.setNetwork(netData);

unsigned char type = lsf.getEncryptionType();
if (type != M17_ENCRYPTION_TYPE_NONE) {
LogMessage("M17 encryption rejection");
m_network->reset();
Expand Down
4 changes: 3 additions & 1 deletion M17LSF.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020,2021 by Jonathan Naylor G4KLX
* Copyright (C) 2020,2021,2023 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -38,6 +38,8 @@ m_lsf(NULL),
m_valid(false)
{
m_lsf = new unsigned char[M17_LSF_LENGTH_BYTES];

::memset(m_lsf, 0x00U, M17_LSF_LENGTH_BYTES);
}

CM17LSF::~CM17LSF()
Expand Down

0 comments on commit b18aeb5

Please sign in to comment.