pull/9529/head
Oren Cohen 2019-01-29 13:02:21 +02:00
parent 20478ba654
commit 5d448d758c
3 changed files with 16 additions and 16 deletions

View File

@ -35,7 +35,7 @@ struct psa_hash_operation_s {
static inline struct psa_hash_operation_s psa_hash_operation_init(void)
{
const struct psa_hash_operation_s v = PSA_HASH_OPERATION_INIT;
return(v);
return (v);
}
struct psa_mac_operation_s {
@ -46,7 +46,7 @@ struct psa_mac_operation_s {
static inline struct psa_mac_operation_s psa_mac_operation_init(void)
{
const struct psa_mac_operation_s v = PSA_MAC_OPERATION_INIT;
return(v);
return (v);
}
struct psa_cipher_operation_s {
@ -57,7 +57,7 @@ struct psa_cipher_operation_s {
static inline struct psa_cipher_operation_s psa_cipher_operation_init(void)
{
const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
return(v);
return (v);
}
struct psa_crypto_generator_s {
@ -80,7 +80,7 @@ struct psa_key_policy_s {
static inline struct psa_key_policy_s psa_key_policy_init(void)
{
const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT;
return(v);
return (v);
}
#endif /* PSA_CRYPTO_STRUCT_H */

View File

@ -806,8 +806,8 @@ psa_status_t psa_open_key(psa_key_lifetime_t lifetime,
psa_key_mng_ipc.func = PSA_OPEN_KEY;
psa_handle_t handle = PSA_NULL_HANDLE;
psa_invec in_vec[2] = {
{ &psa_key_mng_ipc, sizeof(psa_key_mng_ipc) },
{ &id, sizeof(id) }
{ &psa_key_mng_ipc, sizeof(psa_key_mng_ipc) },
{ &id, sizeof(id) }
};
psa_outvec out_vec[1] = { {
key_handle, sizeof(*key_handle)
@ -816,14 +816,14 @@ psa_status_t psa_open_key(psa_key_lifetime_t lifetime,
handle = psa_connect(PSA_KEY_MNG_ID, MINOR_VER);
if (handle <= 0) {
return (PSA_ERROR_COMMUNICATION_FAILURE);
return (PSA_ERROR_COMMUNICATION_FAILURE);
}
err_call = psa_call(handle, in_vec, 2, out_vec, 1);
psa_close(handle);
if (err_call < 0) {
err_call = (psa_status_t) PSA_ERROR_COMMUNICATION_FAILURE;
err_call = (psa_status_t) PSA_ERROR_COMMUNICATION_FAILURE;
}
return ((psa_status_t) err_call);
}
@ -836,19 +836,19 @@ psa_status_t psa_close_key(psa_key_handle_t key_handle)
psa_key_mng_ipc.func = PSA_CLOSE_KEY;
psa_handle_t handle = PSA_NULL_HANDLE;
psa_invec in_vec[1] = {
{ &psa_key_mng_ipc, sizeof(psa_key_mng_ipc) }
{ &psa_key_mng_ipc, sizeof(psa_key_mng_ipc) }
};
handle = psa_connect(PSA_KEY_MNG_ID, MINOR_VER);
if (handle <= 0) {
return (PSA_ERROR_COMMUNICATION_FAILURE);
return (PSA_ERROR_COMMUNICATION_FAILURE);
}
err_call = psa_call(handle, in_vec, 1, NULL, 0);
psa_close(handle);
if (err_call < 0) {
err_call = (psa_status_t) PSA_ERROR_COMMUNICATION_FAILURE;
err_call = (psa_status_t) PSA_ERROR_COMMUNICATION_FAILURE;
}
return ((psa_status_t) err_call);
}

View File

@ -38,7 +38,7 @@ static inline psa_status_t reserve_hash_clone(int32_t partition_id, void *source
{
for (*index = 0; *index < MAX_CONCURRENT_HASH_CLONES; (*index)++) {
if (psa_spm_hash_clones[*index].partition_id == partition_id &&
psa_spm_hash_clones[*index].source_operation == source_operation) {
psa_spm_hash_clones[*index].source_operation == source_operation) {
psa_spm_hash_clones[*index].ref_count++;
return PSA_SUCCESS;
}
@ -46,7 +46,7 @@ static inline psa_status_t reserve_hash_clone(int32_t partition_id, void *source
for (*index = 0; *index < MAX_CONCURRENT_HASH_CLONES; (*index)++) {
if (psa_spm_hash_clones[*index].partition_id == 0 &&
psa_spm_hash_clones[*index].source_operation == NULL) {
psa_spm_hash_clones[*index].source_operation == NULL) {
psa_spm_hash_clones[*index].partition_id = partition_id;
psa_spm_hash_clones[*index].source_operation = source_operation;
psa_spm_hash_clones[*index].ref_count++;
@ -79,11 +79,11 @@ static void destroy_hash_clone(void *source_operation)
}
static inline psa_status_t get_hash_clone(size_t index, int32_t partition_id,
psa_spm_hash_clone_t **hash_clone)
psa_spm_hash_clone_t **hash_clone)
{
if (index >= MAX_CONCURRENT_HASH_CLONES ||
psa_spm_hash_clones[index].partition_id != partition_id ||
psa_spm_hash_clones[index].source_operation == NULL) {
psa_spm_hash_clones[index].partition_id != partition_id ||
psa_spm_hash_clones[index].source_operation == NULL) {
return PSA_ERROR_BAD_STATE;
}