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
791e52be
Commit
791e52be
authored
Mar 18, 2021
by
yangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the authentication bug
parent
4b4ed7f5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+8
-7
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+3
-1
No files found.
src/amf-app/amf_n1.cpp
View file @
791e52be
...
...
@@ -1394,6 +1394,7 @@ bool amf_n1::_5g_aka_confirmation_from_ausf(
try
{
ConfirmationDataResponse
confirmationdataresponse
;
nlohmann
::
json
::
parse
(
Response
.
c_str
()).
get_to
(
confirmationdataresponse
);
if
(
!
confirmationdataresponse
.
getAuthResult
())
return
false
;
unsigned
char
*
kseaf_hex
=
format_string_as_hex
(
confirmationdataresponse
.
getKseaf
());
memcpy
(
nc
.
get
()
->
_5g_av
[
0
].
kseaf
,
kseaf_hex
,
32
);
...
...
@@ -1554,13 +1555,13 @@ void amf_n1::generate_random(uint8_t* random_p, ssize_t length) {
mpz_urandomb
(
random_nb
,
random_state
.
state
,
8
*
length
);
pthread_mutex_unlock
(
&
random_state
.
lock
);
mpz_export
(
random_p
,
NULL
,
1
,
length
,
0
,
0
,
random_nb
);
int
r
=
0
,
mask
=
0
,
shift
;
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
if
((
i
%
sizeof
(
i
))
==
0
)
r
=
rand
();
shift
=
8
*
(
i
%
sizeof
(
i
));
mask
=
0xFF
<<
shift
;
random_p
[
i
]
=
(
r
&
mask
)
>>
shift
;
}
//
int r = 0, mask = 0, shift;
//
for (int i = 0; i < length; i++) {
//
if ((i % sizeof(i)) == 0) r = rand();
//
shift = 8 * (i % sizeof(i));
//
mask = 0xFF << shift;
//
random_p[i] = (r & mask) >> shift;
//
}
}
else
{
Logger
::
amf_n1
().
error
(
"AMF config random -> false"
);
pthread_mutex_lock
(
&
random_state
.
lock
);
...
...
src/amf-app/amf_n2.cpp
View file @
791e52be
...
...
@@ -618,10 +618,12 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
item
.
s_nssai
.
sd
=
"None"
;
item
.
pduSessionNAS_PDU
=
NULL
;
if
(
itti_msg
.
isn2sm_avaliable
)
{
bstring
n2sm
=
itti_msg
.
n2sm
;
//
bstring n2sm = itti_msg.n2sm;
if
(
blength
(
itti_msg
.
n2sm
)
!=
0
)
{
Logger
::
amf_n2
().
debug
(
"*** test into itti_msg.n2sm ***"
);
item
.
pduSessionResourceSetupRequestTransfer
.
buf
=
(
uint8_t
*
)
bdata
(
itti_msg
.
n2sm
);
Logger
::
amf_n2
().
debug
(
"*** test into item.pduSessionResourceSetupRequestTransfer.buf ***"
);
item
.
pduSessionResourceSetupRequestTransfer
.
size
=
blength
(
itti_msg
.
n2sm
);
}
else
{
...
...
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