Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
spbro
OpenXG-RAN
Commits
91a7dc80
Commit
91a7dc80
authored
Jul 17, 2023
by
mir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First commit to remove crypt dependency
parent
578fbfb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
25 deletions
+27
-25
CMakeLists.txt
CMakeLists.txt
+0
-4
openair3/NGAP/ngap_gNB.c
openair3/NGAP/ngap_gNB.c
+13
-10
openair3/S1AP/s1ap_eNB.c
openair3/S1AP/s1ap_eNB.c
+13
-10
openair3/SECU/kdf.h
openair3/SECU/kdf.h
+1
-1
No files found.
CMakeLists.txt
View file @
91a7dc80
...
...
@@ -300,10 +300,6 @@ target_link_libraries(lte_rrc PRIVATE nr_rrc)
add_library
(
nr_rrc
${
OPENAIR2_DIR
}
/RRC/NR/MESSAGES/asn1_msg.c
)
target_link_libraries
(
nr_rrc PUBLIC asn1_nr_rrc asn1_lte_rrc
)
# S1AP and NGAP need crypt library
pkg_check_modules
(
libcrypt REQUIRED libcrypt
)
# S1AP
##############
set
(
S1AP_DIR
${
OPENAIR3_DIR
}
/S1AP
)
...
...
openair3/NGAP/ngap_gNB.c
View file @
91a7dc80
...
...
@@ -33,7 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include
<crypt.h>
#include
"openair3/SECU/kdf.h"
#include "tree.h"
#include "queue.h"
...
...
@@ -71,17 +71,20 @@ void ngap_gNB_handle_register_gNB(instance_t instance, ngap_register_gnb_req_t *
void
ngap_gNB_handle_sctp_association_resp
(
instance_t
instance
,
sctp_new_association_resp_t
*
sctp_new_association_resp
);
uint32_t
ngap_generate_gNB_id
(
void
)
{
char
*
out
;
char
hostname
[
50
];
int
ret
;
uint32_t
gNB_id
;
uint32_t
ngap_generate_gNB_id
(
void
)
{
/* Retrieve the host name */
ret
=
gethostname
(
hostname
,
sizeof
(
hostname
));
char
hostname
[
32
]
=
{
0
};
int
const
ret
=
gethostname
(
hostname
,
sizeof
(
hostname
));
DevAssert
(
ret
==
0
);
out
=
crypt
(
hostname
,
"eurecom"
);
DevAssert
(
out
!=
NULL
);
gNB_id
=
((
out
[
0
]
<<
24
)
|
(
out
[
1
]
<<
16
)
|
(
out
[
2
]
<<
8
)
|
out
[
3
]);
uint8_t
key
[
32
]
=
{
"eurecom"
};
byte_array_t
data
=
{.
len
=
32
,
.
buf
=
(
uint8_t
*
)
hostname
};
uint8_t
out
[
32
]
=
{
0
};
kdf
(
key
,
data
,
32
,
out
);
uint32_t
const
gNB_id
=
((
out
[
0
]
<<
24
)
|
(
out
[
1
]
<<
16
)
|
(
out
[
2
]
<<
8
)
|
out
[
3
]);
return
gNB_id
;
}
...
...
openair3/S1AP/s1ap_eNB.c
View file @
91a7dc80
...
...
@@ -32,7 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include
<crypt.h>
#include
"openair3/SECU/kdf.h"
#include "tree.h"
#include "queue.h"
...
...
@@ -108,17 +108,20 @@ int s1ap_timer_remove(long timer_id)
return
ret
;
}
uint32_t
s1ap_generate_eNB_id
(
void
)
{
char
*
out
;
char
hostname
[
50
];
int
ret
;
uint32_t
eNB_id
;
uint32_t
s1ap_generate_eNB_id
(
void
)
{
/* Retrieve the host name */
ret
=
gethostname
(
hostname
,
sizeof
(
hostname
));
char
hostname
[
32
]
=
{
0
};
int
const
ret
=
gethostname
(
hostname
,
sizeof
(
hostname
));
DevAssert
(
ret
==
0
);
out
=
crypt
(
hostname
,
"eurecom"
);
DevAssert
(
out
!=
NULL
);
eNB_id
=
((
out
[
0
]
<<
24
)
|
(
out
[
1
]
<<
16
)
|
(
out
[
2
]
<<
8
)
|
out
[
3
]);
uint8_t
key
[
32
]
=
{
"eurecom"
};
byte_array_t
data
=
{.
len
=
32
,
.
buf
=
(
uint8_t
*
)
hostname
};
uint8_t
out
[
32
]
=
{
0
};
kdf
(
key
,
data
,
32
,
out
);
uint32_t
const
eNB_id
=
((
out
[
0
]
<<
24
)
|
(
out
[
1
]
<<
16
)
|
(
out
[
2
]
<<
8
)
|
out
[
3
]);
return
eNB_id
;
}
...
...
openair3/SECU/kdf.h
View file @
91a7dc80
...
...
@@ -24,7 +24,7 @@
#include <stdint.h>
#include <stdlib.h>
#include "byte_array.h"
#include "
common/utils/ds/
byte_array.h"
void
kdf
(
const
uint8_t
key
[
32
],
byte_array_t
data
,
size_t
len
,
uint8_t
out
[
len
]);
...
...
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