Skip to content

Commit

Permalink
[#341] Attempt to manually fix const suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Donnie-Ice committed Nov 4, 2024
1 parent 28a027b commit c77aba3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions include/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ extern int32_t Crypto_Init_AOS_Unit_Test(void); // Initialize CryptoLib with uni
extern int32_t Crypto_Shutdown(void); // Free all allocated memory

// Telecommand (TC)
extern int32_t Crypto_TC_ApplySecurity(const uint8_t *p_in_frame, const uint16_t in_frame_length,
extern int32_t Crypto_TC_ApplySecurity(const uint8_t *p_in_frame, uint16_t in_frame_length,
uint8_t **pp_enc_frame, uint16_t *p_enc_frame_len);
extern int32_t Crypto_TC_ProcessSecurity(uint8_t *ingest, int *len_ingest, TC_t *tc_sdls_processed_frame);
extern int32_t Crypto_TC_ApplySecurity_Cam(const uint8_t *p_in_frame, const uint16_t in_frame_length,
extern int32_t Crypto_TC_ApplySecurity_Cam(const uint8_t *p_in_frame, uint16_t in_frame_length,
uint8_t **pp_enc_frame, uint16_t *p_enc_frame_len, char *cam_cookies);
extern int32_t Crypto_TC_ProcessSecurity_Cam(uint8_t *ingest, int *len_ingest, TC_t *tc_sdls_processed_frame,
char *cam_cookies);
Expand Down Expand Up @@ -148,7 +148,7 @@ int32_t Crypto_TC_Do_Encrypt(uint8_t sa_service_type, SecurityAssociation_t *sa_
const uint8_t *p_in_frame, char *cam_cookies, uint32_t pkcs_padding,
uint16_t new_enc_frame_header_field_length, uint16_t *new_fecf);
int32_t Crypto_TC_Check_Init_Setup(uint16_t in_frame_length);
int32_t Crypto_TC_Sanity_Setup(const uint8_t *p_in_frame, const uint16_t in_frame_length);
int32_t Crypto_TC_Sanity_Setup(const uint8_t *p_in_frame, uint16_t in_frame_length);
int32_t Crytpo_TC_Validate_TC_Temp_Header(const uint16_t in_frame_length, TC_FramePrimaryHeader_t temp_tc_header,
const uint8_t *p_in_frame, uint8_t *map_id, uint8_t *segmentation_hdr,
SecurityAssociation_t **sa_ptr);
Expand Down
14 changes: 7 additions & 7 deletions src/core/crypto_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#define CRYPTO_UNDEFINED_ERROR (char *)"CRYPTO_UNDEFINED_ERROR_CODE"

char *crypto_enum_errlist_core[] = {(char *)"CRYPTO_LIB_SUCCESS",
const char *crypto_enum_errlist_core[] = {(char *)"CRYPTO_LIB_SUCCESS",
(char *)"CRYPTO_LIB_ERROR",
(char *)"CRYPTO_LIB_ERR_NO_INIT",
(char *)"CRYPTO_LIB_ERR_INVALID_TFVN",
Expand Down Expand Up @@ -82,29 +82,29 @@ char *crypto_enum_errlist_core[] = {(char *)"CRYPTO_LIB_SUCCESS",
(char *)"CRYPTO_LIB_ERR_IV_GREATER_THAN_MAX_LENGTH",
(char *)"CRYPTO_LIB_ERR_KEY_STATE_TRANSITION_ERROR"};

char *crypto_enum_errlist_config[] = {
const char *crypto_enum_errlist_config[] = {
(char *)"CRYPTO_CONFIGURATION_NOT_COMPLETE",
(char *)"CRYPTO_MANAGED_PARAM_CONFIGURATION_NOT_COMPLETE",
(char *)"CRYPTO_MARIADB_CONFIGURATION_NOT_COMPLETE",
(char *)"MANAGED_PARAMETERS_FOR_GVCID_NOT_FOUND",
};

char *crypto_enum_errlist_sa_if[] = {
const char *crypto_enum_errlist_sa_if[] = {
(char *)"SADB_INVALID_SADB_TYPE",
(char *)"SADB_NULL_SA_USED",
};
char *crypto_enum_errlist_sa_mariadb[] = {
const char *crypto_enum_errlist_sa_mariadb[] = {
(char *)"SADB_MARIADB_CONNECTION_FAILED",
(char *)"SADB_QUERY_FAILED",
(char *)"SADB_QUERY_EMPTY_RESULTS",
(char *)"SADB_INSERT_FAILED",
};
char *crypto_enum_errlist_crypto_if[] = {
const char *crypto_enum_errlist_crypto_if[] = {
(char *)"CRYPTOGRAPHY_INVALID_CRYPTO_INTERFACE_TYPE",
(char *)"CRYPTOGRAPHY_UNSUPPORTED_OPERATION_FOR_KEY_RING",
(char *)"CRYPTOGRAPHY_LIBRARY_INITIALIZIATION_ERROR",
};
char *crypto_enum_errlist_crypto_kmc[] = {
const char *crypto_enum_errlist_crypto_kmc[] = {
(char *)"CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_CONFIGURATION_NOT_COMPLETE",
(char *)"CRYPTOGRAPHY_KMC_CURL_INITIALIZATION_FAILURE",
(char *)"CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_CONNECTION_ERROR",
Expand All @@ -123,7 +123,7 @@ char *crypto_enum_errlist_crypto_kmc[] = {
(char *)"CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_ENCRYPT_ERROR",
};

char *crypto_enum_errlist_crypto_cam[] = {
const char *crypto_enum_errlist_crypto_cam[] = {
(char *)"CAM_CONFIG_NOT_SUPPORTED_ERROR",
(char *)"CAM_INVALID_COOKIE_FILE_CONFIGURATION_NULL",
(char *)"CAM_AUTHENTICATION_FAILURE_REDIRECT",
Expand Down

0 comments on commit c77aba3

Please sign in to comment.