nr pdcp: 'count' is 32 bits, use explicit type instead of generic 'int'
This commit is contained in:
@@ -155,13 +155,13 @@ typedef struct nr_pdcp_entity_t {
|
|||||||
stream_security_context_t *security_context;
|
stream_security_context_t *security_context;
|
||||||
void (*cipher)(stream_security_context_t *security_context,
|
void (*cipher)(stream_security_context_t *security_context,
|
||||||
unsigned char *buffer, int length,
|
unsigned char *buffer, int length,
|
||||||
int bearer, int count, int direction);
|
int bearer, uint32_t count, int direction);
|
||||||
void (*free_security)(stream_security_context_t *security_context);
|
void (*free_security)(stream_security_context_t *security_context);
|
||||||
stream_security_context_t *integrity_context;
|
stream_security_context_t *integrity_context;
|
||||||
void (*integrity)(stream_security_context_t *integrity_context,
|
void (*integrity)(stream_security_context_t *integrity_context,
|
||||||
unsigned char *out,
|
unsigned char *out,
|
||||||
unsigned char *buffer, int length,
|
unsigned char *buffer, int length,
|
||||||
int bearer, int count, int direction);
|
int bearer, uint32_t count, int direction);
|
||||||
void (*free_integrity)(stream_security_context_t *integrity_context);
|
void (*free_integrity)(stream_security_context_t *integrity_context);
|
||||||
/* security/integrity algorithms need to know uplink/downlink information
|
/* security/integrity algorithms need to know uplink/downlink information
|
||||||
* which is reverse for gnb and ue, so we need to know if this
|
* which is reverse for gnb and ue, so we need to know if this
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ stream_security_context_t *nr_pdcp_integrity_nia1_init(unsigned char *integrity_
|
|||||||
void nr_pdcp_integrity_nia1_integrity(stream_security_context_t *integrity_context,
|
void nr_pdcp_integrity_nia1_integrity(stream_security_context_t *integrity_context,
|
||||||
unsigned char *out,
|
unsigned char *out,
|
||||||
unsigned char *buffer, int length,
|
unsigned char *buffer, int length,
|
||||||
int bearer, int count, int direction)
|
int bearer, uint32_t count, int direction)
|
||||||
{
|
{
|
||||||
nas_stream_cipher_t *ctx = (nas_stream_cipher_t *)integrity_context;
|
nas_stream_cipher_t *ctx = (nas_stream_cipher_t *)integrity_context;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ stream_security_context_t *nr_pdcp_integrity_nia1_init(unsigned char *integrity_
|
|||||||
void nr_pdcp_integrity_nia1_integrity(stream_security_context_t *integrity_context,
|
void nr_pdcp_integrity_nia1_integrity(stream_security_context_t *integrity_context,
|
||||||
unsigned char *out,
|
unsigned char *out,
|
||||||
unsigned char *buffer, int length,
|
unsigned char *buffer, int length,
|
||||||
int bearer, int count, int direction);
|
int bearer, uint32_t count, int direction);
|
||||||
|
|
||||||
void nr_pdcp_integrity_nia1_free_integrity(stream_security_context_t *integrity_context);
|
void nr_pdcp_integrity_nia1_free_integrity(stream_security_context_t *integrity_context);
|
||||||
|
|
||||||
|
|||||||
@@ -39,14 +39,13 @@ stream_security_context_t *nr_pdcp_integrity_nia2_init(uint8_t integrity_key[16]
|
|||||||
return (stream_security_context_t *)ctx;
|
return (stream_security_context_t *)ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_pdcp_integrity_nia2_integrity(stream_security_context_t *integrity_context, unsigned char *out, unsigned char *buffer, int length, int bearer, int count, int direction)
|
void nr_pdcp_integrity_nia2_integrity(stream_security_context_t *integrity_context, unsigned char *out, unsigned char *buffer, int length, int bearer, uint32_t count, int direction)
|
||||||
{
|
{
|
||||||
DevAssert(integrity_context != NULL);
|
DevAssert(integrity_context != NULL);
|
||||||
DevAssert(out != NULL);
|
DevAssert(out != NULL);
|
||||||
DevAssert(buffer != NULL);
|
DevAssert(buffer != NULL);
|
||||||
DevAssert(length > -1);
|
DevAssert(length > -1);
|
||||||
DevAssert(bearer > 0 && bearer < 33);
|
DevAssert(bearer > 0 && bearer < 33);
|
||||||
DevAssert(count > -1);
|
|
||||||
|
|
||||||
cbc_cmac_ctx_t *ctx = (cbc_cmac_ctx_t *)integrity_context;
|
cbc_cmac_ctx_t *ctx = (cbc_cmac_ctx_t *)integrity_context;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ stream_security_context_t *nr_pdcp_integrity_nia2_init(uint8_t integrity_key[16]
|
|||||||
void nr_pdcp_integrity_nia2_integrity(stream_security_context_t *integrity_context,
|
void nr_pdcp_integrity_nia2_integrity(stream_security_context_t *integrity_context,
|
||||||
unsigned char *out,
|
unsigned char *out,
|
||||||
unsigned char *buffer, int length,
|
unsigned char *buffer, int length,
|
||||||
int bearer, int count, int direction);
|
int bearer, uint32_t count, int direction);
|
||||||
|
|
||||||
void nr_pdcp_integrity_nia2_free_integrity(stream_security_context_t *integrity_context);
|
void nr_pdcp_integrity_nia2_free_integrity(stream_security_context_t *integrity_context);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void nr_pdcp_security_nea1_cipher(stream_security_context_t *security_context,
|
|||||||
unsigned char *buffer,
|
unsigned char *buffer,
|
||||||
int length,
|
int length,
|
||||||
int bearer,
|
int bearer,
|
||||||
int count,
|
uint32_t count,
|
||||||
int direction)
|
int direction)
|
||||||
{
|
{
|
||||||
nas_stream_cipher_t *ctx = (nas_stream_cipher_t *)security_context;
|
nas_stream_cipher_t *ctx = (nas_stream_cipher_t *)security_context;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ void nr_pdcp_security_nea1_cipher(stream_security_context_t *security_context,
|
|||||||
unsigned char *buffer,
|
unsigned char *buffer,
|
||||||
int length,
|
int length,
|
||||||
int bearer,
|
int bearer,
|
||||||
int count,
|
uint32_t count,
|
||||||
int direction);
|
int direction);
|
||||||
|
|
||||||
void nr_pdcp_security_nea1_free_security(stream_security_context_t *security_context);
|
void nr_pdcp_security_nea1_free_security(stream_security_context_t *security_context);
|
||||||
|
|||||||
@@ -36,14 +36,13 @@ stream_security_context_t *nr_pdcp_security_nea2_init(unsigned char *ciphering_k
|
|||||||
return (stream_security_context_t *)ciphering_key;
|
return (stream_security_context_t *)ciphering_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_pdcp_security_nea2_cipher(stream_security_context_t *security_context, unsigned char *buffer, int length, int bearer, int count, int direction)
|
void nr_pdcp_security_nea2_cipher(stream_security_context_t *security_context, unsigned char *buffer, int length, int bearer, uint32_t count, int direction)
|
||||||
{
|
{
|
||||||
DevAssert(security_context != NULL);
|
DevAssert(security_context != NULL);
|
||||||
DevAssert(buffer != NULL);
|
DevAssert(buffer != NULL);
|
||||||
DevAssert(length > 0);
|
DevAssert(length > 0);
|
||||||
DevAssert(bearer > -1 && bearer < 32);
|
DevAssert(bearer > -1 && bearer < 32);
|
||||||
DevAssert(direction > -1 && direction < 2);
|
DevAssert(direction > -1 && direction < 2);
|
||||||
DevAssert(count > -1);
|
|
||||||
|
|
||||||
aes_128_t p = {0};
|
aes_128_t p = {0};
|
||||||
const uint8_t *ciphering_key = (uint8_t const *)security_context;
|
const uint8_t *ciphering_key = (uint8_t const *)security_context;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ stream_security_context_t *nr_pdcp_security_nea2_init(unsigned char *ciphering_k
|
|||||||
|
|
||||||
void nr_pdcp_security_nea2_cipher(stream_security_context_t *security_context,
|
void nr_pdcp_security_nea2_cipher(stream_security_context_t *security_context,
|
||||||
unsigned char *buffer, int length,
|
unsigned char *buffer, int length,
|
||||||
int bearer, int count, int direction);
|
int bearer, uint32_t count, int direction);
|
||||||
|
|
||||||
void nr_pdcp_security_nea2_free_security(stream_security_context_t *security_context);
|
void nr_pdcp_security_nea2_free_security(stream_security_context_t *security_context);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user