Storage module implementation file. More...
#include "storage.h"
#include "definitions.h"
#include "memory.h"
#include "log_util.h"
#include "file_util.h"
#include "string_util.h"
Go to the source code of this file.
Functions | |
static E_MCL_ERROR_CODE | _get_public_key (char *buffer, mcl_size_t buffer_size, void *file_descriptor) |
static E_MCL_ERROR_CODE | _get_private_key (char *buffer, mcl_size_t buffer_size, void *file_descriptor) |
E_MCL_ERROR_CODE | storage_save_shared_secret_registration_information (string_t *path, string_t *client_id, string_t *client_secret, string_t *registration_access_token, string_t *registration_uri) |
E_MCL_ERROR_CODE | storage_save_rsa_registration_information (string_t *path, string_t *client_id, char *public_key, char *private_key, string_t *registration_access_token, string_t *registration_uri) |
E_MCL_ERROR_CODE | storage_load_shared_secret_registration_information (string_t *path, string_t **client_id, string_t **client_secret, string_t **registration_access_token, string_t **registration_uri) |
E_MCL_ERROR_CODE | storage_load_rsa_registration_information (string_t *path, string_t **client_id, char **public_key, char **private_key, string_t **registration_access_token, string_t **registration_uri) |
Storage module implementation file.
Definition in file storage.c.
|
static |
Definition at line 369 of file storage.c.
References DEBUG_ENTRY, DEBUG_LEAVE, file_util_fgets(), MCL_FAIL, MCL_OK, string_util_strlen(), and string_util_strncmp().
Referenced by storage_load_rsa_registration_information().
|
static |
Definition at line 306 of file storage.c.
References DEBUG_ENTRY, DEBUG_LEAVE, file_util_fgets(), MCL_FAIL, MCL_OK, string_util_strlen(), and string_util_strncmp().
Referenced by storage_load_rsa_registration_information().
E_MCL_ERROR_CODE storage_load_rsa_registration_information | ( | string_t * | path, |
string_t ** | client_id, | ||
char ** | public_key, | ||
char ** | private_key, | ||
string_t ** | registration_access_token, | ||
string_t ** | registration_uri | ||
) |
This function is used to load registration information from the storage for RSA security profile.
[in] | path | File path of the saved registration information. |
[out] | client_id | Client ID. |
[out] | public_key | Public key. |
[out] | private_key | Private key. |
[out] | registration_access_token | Registration access token. |
[out] | registration_uri | Registration URI. |
Definition at line 210 of file storage.c.
References _get_private_key(), _get_public_key(), ASSERT_CODE_MESSAGE, ASSERT_STATEMENT_CODE_MESSAGE, string_t::buffer, DEBUG_ENTRY, DEBUG_LEAVE, file_util_fclose(), file_util_fgets(), file_util_fopen(), MCL_DEBUG, MCL_FREE, MCL_INFO, MCL_MALLOC, MCL_NO_FILE_SUPPORT, MCL_NO_STORAGE_MEDIUM, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_REGISTRATION_INFO_IS_NOT_LOADED, string_destroy(), string_initialize_new(), string_util_strdup(), and string_util_strlen().
Referenced by http_processor_initialize(), and http_processor_update_security_information().
E_MCL_ERROR_CODE storage_load_shared_secret_registration_information | ( | string_t * | path, |
string_t ** | client_id, | ||
string_t ** | client_secret, | ||
string_t ** | registration_access_token, | ||
string_t ** | registration_uri | ||
) |
This function is used to load registration information from the storage for Shared Secret security profile.
[in] | path | File path of the saved registration information. |
[out] | client_id | Client ID. |
[out] | client_secret | Client secret. |
[out] | registration_access_token | Registration access token. |
[out] | registration_uri | Registration URI. |
Definition at line 129 of file storage.c.
References ASSERT_CODE_MESSAGE, ASSERT_STATEMENT_CODE_MESSAGE, string_t::buffer, DEBUG_ENTRY, DEBUG_LEAVE, file_util_fclose(), file_util_fgets(), file_util_fopen(), MCL_DEBUG, MCL_FREE, MCL_INFO, MCL_MALLOC, MCL_NO_FILE_SUPPORT, MCL_NO_STORAGE_MEDIUM, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_REGISTRATION_INFO_IS_NOT_LOADED, string_destroy(), string_initialize_new(), and string_util_strlen().
Referenced by http_processor_initialize(), and http_processor_update_security_information().
E_MCL_ERROR_CODE storage_save_rsa_registration_information | ( | string_t * | path, |
string_t * | client_id, | ||
char * | public_key, | ||
char * | private_key, | ||
string_t * | registration_access_token, | ||
string_t * | registration_uri | ||
) |
This function is used to save registration information for rsa security profile to a file.
[in] | path | File path to save registration information. |
[in] | client_id | Client ID. |
[in] | public_key | Public key. |
[in] | private_key | Private key. |
[in] | registration_access_token | Registration access token. |
[in] | registration_uri | Registration URI. |
Definition at line 78 of file storage.c.
References string_t::buffer, DEBUG_ENTRY, DEBUG_LEAVE, file_util_fclose(), file_util_fopen(), file_util_fputs(), MCL_INFO, MCL_NULL, MCL_OK, MCL_REGISTRATION_INFO_IS_NOT_SAVED, and MCL_WARN.
Referenced by _save_registration_information().
E_MCL_ERROR_CODE storage_save_shared_secret_registration_information | ( | string_t * | path, |
string_t * | client_id, | ||
string_t * | client_secret, | ||
string_t * | registration_access_token, | ||
string_t * | registration_uri | ||
) |
This function is used to save registration information for shared secret security profile to a file.
[in] | path | File path to save registration information. |
[in] | client_id | Client ID. |
[in] | client_secret | Client secret. |
[in] | registration_access_token | Registration access token. |
[in] | registration_uri | Registration URI. |
Definition at line 27 of file storage.c.
References string_t::buffer, DEBUG_ENTRY, DEBUG_LEAVE, file_util_fclose(), file_util_fopen(), file_util_fputs(), MCL_INFO, MCL_NULL, MCL_OK, MCL_REGISTRATION_INFO_IS_NOT_SAVED, and MCL_WARN.
Referenced by _save_registration_information().