Skip to content

Commit

Permalink
Protection of initial NAS messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aligungr committed May 8, 2021
1 parent bbd585c commit 7286e62
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/ue/nas/mm/transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
#include <ue/nas/sm/sm.hpp>
#include <ue/rrc/task.hpp>

// See https://github.com/aligungr/UERANSIM/issues/316 for details about this behaviour.
#define NAS_CONTAINER_NOT_CIPHERED 1

namespace nr::ue
{

Expand Down Expand Up @@ -129,13 +126,7 @@ void NasMm::sendNasMessage(const nas::PlainMmMessage &msg)
if (HasNonCleartext(msg))
{
OctetString originalPdu;

#if NAS_CONTAINER_NOT_CIPHERED
nas::EncodeNasMessage(msg, originalPdu);
#else
auto originalSecured = nas_enc::Encrypt(*m_usim->m_currentNsCtx, msg, false);
nas::EncodeNasMessage(*originalSecured, originalPdu);
#endif

auto copy = nas::utils::DeepCopyMsg(msg);
RemoveCleartextIEs((nas::PlainMmMessage &)*copy, std::move(originalPdu));
Expand Down

0 comments on commit 7286e62

Please sign in to comment.