storage.c File Reference

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"
Include dependency graph for storage.c:

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)
 

Detailed Description

Storage module implementation file.


Date
Oct 6, 2016

Definition in file storage.c.

Function Documentation

static E_MCL_ERROR_CODE _get_private_key ( char *  buffer,
mcl_size_t  buffer_size,
void *  file_descriptor 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static E_MCL_ERROR_CODE _get_public_key ( char *  buffer,
mcl_size_t  buffer_size,
void *  file_descriptor 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]pathFile path of the saved registration information.
[out]client_idClient ID.
[out]public_keyPublic key.
[out]private_keyPrivate key.
[out]registration_access_tokenRegistration access token.
[out]registration_uriRegistration URI.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]pathFile path of the saved registration information.
[out]client_idClient ID.
[out]client_secretClient secret.
[out]registration_access_tokenRegistration access token.
[out]registration_uriRegistration URI.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]pathFile path to save registration information.
[in]client_idClient ID.
[in]public_keyPublic key.
[in]private_keyPrivate key.
[in]registration_access_tokenRegistration access token.
[in]registration_uriRegistration URI.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]pathFile path to save registration information.
[in]client_idClient ID.
[in]client_secretClient secret.
[in]registration_access_tokenRegistration access token.
[in]registration_uriRegistration URI.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function: