Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
6cd3f6be
Commit
6cd3f6be
authored
May 25, 2021
by
yangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix UESecurityCapability
parent
4961ab02
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
5 deletions
+39
-5
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+5
-0
src/contexts/nas_context.cpp
src/contexts/nas_context.cpp
+2
-0
src/contexts/nas_context.hpp
src/contexts/nas_context.hpp
+2
-0
src/nas/ies/UESecurityCapability.cpp
src/nas/ies/UESecurityCapability.cpp
+24
-5
src/nas/ies/UESecurityCapability.hpp
src/nas/ies/UESecurityCapability.hpp
+6
-0
No files found.
src/amf-app/amf_n1.cpp
View file @
6cd3f6be
...
...
@@ -954,6 +954,9 @@ void amf_n1::registration_request_handle(bool isNasSig,
}
else
{
nc
.
get
()
->
ueSecurityCaplen
=
regReq
->
ie_ue_security_capability
->
getLenght
();
nc
.
get
()
->
ueSecurityCapEEnc
=
regReq
->
ie_ue_security_capability
->
getEEASel
();
nc
.
get
()
->
ueSecurityCapEInt
=
regReq
->
ie_ue_security_capability
->
getEIASel
();
}
nc
.
get
()
->
ueSecurityCapEnc
=
encrypt_alg
;
nc
.
get
()
->
ueSecurityCapInt
=
integrity_alg
;
...
...
@@ -2033,6 +2036,8 @@ bool amf_n1::start_security_mode_control_procedure(
nc
.
get
()
->
ueSecurityCapInt
);
if
(
smc
->
ie_ue_security_capability
!=
NULL
)
{
smc
->
ie_ue_security_capability
->
setLenght
(
nc
.
get
()
->
ueSecurityCaplen
);
smc
->
ie_ue_security_capability
->
setEEASel
(
nc
.
get
()
->
ueSecurityCapEEnc
);
smc
->
ie_ue_security_capability
->
setEIASel
(
nc
.
get
()
->
ueSecurityCapEInt
);
}
else
{
Logger
::
amf_n1
().
error
(
"smc->ie_ue_security_capability is NULL"
);
}
...
...
src/contexts/nas_context.cpp
View file @
6cd3f6be
...
...
@@ -43,6 +43,8 @@ nas_context::nas_context() {
is_common_procedure_for_nas_transport_running
=
false
;
auts
=
NULL
;
ueSecurityCaplen
=
2
;
ueSecurityCapEEnc
=
0
;
ueSecurityCapEInt
=
0
;
}
//------------------------------------------------------------------------------
...
...
src/contexts/nas_context.hpp
View file @
6cd3f6be
...
...
@@ -76,6 +76,8 @@ class nas_context {
uint8_t
ueSecurityCaplen
;
uint8_t
ueSecurityCapEnc
;
uint8_t
ueSecurityCapInt
;
uint8_t
ueSecurityCapEEnc
;
uint8_t
ueSecurityCapEInt
;
std
::
vector
<
nas
::
SNSSAI_t
>
requestedNssai
;
std
::
string
serving_network
;
bstring
auts
;
...
...
src/nas/ies/UESecurityCapability.cpp
View file @
6cd3f6be
...
...
@@ -61,6 +61,18 @@ uint8_t UESecurityCapability::getEASel() { return _5g_EASel; }
//------------------------------------------------------------------------------
uint8_t
UESecurityCapability
::
getIASel
()
{
return
_5g_IASel
;
}
//------------------------------------------------------------------------------
void
UESecurityCapability
::
setEEASel
(
uint8_t
sel
)
{
_5g_EEASel
=
sel
;
}
//------------------------------------------------------------------------------
void
UESecurityCapability
::
setEIASel
(
uint8_t
sel
)
{
_5g_EIASel
=
sel
;
}
//------------------------------------------------------------------------------
uint8_t
UESecurityCapability
::
getEEASel
()
{
return
_5g_EEASel
;
}
//------------------------------------------------------------------------------
uint8_t
UESecurityCapability
::
getEIASel
()
{
return
_5g_EIASel
;
}
//------------------------------------------------------------------------------
void
UESecurityCapability
::
setLenght
(
uint8_t
len
)
{
if
((
len
>
0
)
&&
(
len
<=
4
))
{
...
...
@@ -93,9 +105,9 @@ int UESecurityCapability::encode2buffer(uint8_t *buf, int len) {
*
(
buf
+
encoded_size
)
=
_5g_IASel
;
encoded_size
++
;
if
(
length
==
4
)
{
*
(
buf
+
encoded_size
)
=
0xf0
;
*
(
buf
+
encoded_size
)
=
_5g_EEASel
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
0xf0
;
*
(
buf
+
encoded_size
)
=
_5g_EIASel
;
encoded_size
++
;
}
...
...
@@ -107,9 +119,9 @@ int UESecurityCapability::encode2buffer(uint8_t *buf, int len) {
*
(
buf
+
encoded_size
)
=
_5g_IASel
;
encoded_size
++
;
if
(
length
==
4
)
{
*
(
buf
+
encoded_size
)
=
0xf0
;
*
(
buf
+
encoded_size
)
=
_5g_EEASel
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
0xf0
;
*
(
buf
+
encoded_size
)
=
_5g_EIASel
;
encoded_size
++
;
}
}
...
...
@@ -132,7 +144,14 @@ int UESecurityCapability::decodefrombuffer(uint8_t *buf, int len,
_5g_IASel
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
if
(
length
==
4
)
decoded_size
+=
2
;
// to do: decoding EEA EIA
{
//decoded_size += 2; // to do: decoding EEA EIA
_5g_EEASel
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
_5g_EIASel
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
}
Logger
::
nas_mm
().
debug
(
"UESecurityCapability EA 0x%d,IA 0x%d"
,
_5g_EASel
,
_5g_IASel
);
return
decoded_size
;
...
...
src/nas/ies/UESecurityCapability.hpp
View file @
6cd3f6be
...
...
@@ -44,6 +44,10 @@ public:
void
setIASel
(
uint8_t
sel
);
uint8_t
getEASel
();
uint8_t
getIASel
();
void
setEEASel
(
uint8_t
sel
);
void
setEIASel
(
uint8_t
sel
);
uint8_t
getEEASel
();
uint8_t
getEIASel
();
void
setLenght
(
uint8_t
len
);
uint8_t
getLenght
();
int
encode2buffer
(
uint8_t
*
buf
,
int
len
);
...
...
@@ -54,6 +58,8 @@ private:
uint8_t
length
;
uint8_t
_5g_EASel
;
uint8_t
_5g_IASel
;
uint8_t
_5g_EEASel
;
uint8_t
_5g_EIASel
;
};
}
// namespace nas
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment