General fixes of spelling, newline, un needed code

-Correct spelling errors
-Add newline at end of file
-Remove un needed code
pull/9668/head
Moran Peker 2019-02-25 10:28:11 +02:00
parent de3ee8e376
commit 41bd381462
5 changed files with 11 additions and 11 deletions

View File

@ -89,6 +89,8 @@ static void check_initial_attestation_get_token()
enum psa_attest_err_t attest_err = PSA_ATTEST_ERR_SUCCESS;
uint32_t token_size;
status = psa_crypto_init();
TEST_ASSERT_EQUAL(status, PSA_SUCCESS);
status = psa_attestation_inject_key(private_key_data,
sizeof(private_key_data),
PSA_KEY_TYPE_ECC_KEYPAIR(PSA_ECC_CURVE_SECP256R1),
@ -139,12 +141,12 @@ int main()
{
#if (defined(COMPONENT_PSA_SRV_IPC) || defined(MBEDTLS_ENTROPY_NV_SEED))
uint8_t seed[MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE] = {0};
/* inject some a seed for test*/
/* inject some seed for test*/
for (int i = 0; i < MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE; ++i) {
seed[i] = i;
}
/* don't really care if this succeed this is just to make crypto init pass*/
/* don't really care if this succeeds this is just to make crypto init pass*/
mbedtls_psa_inject_entropy(seed, MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE);
#endif
return !Harness::run(specification);

View File

@ -75,12 +75,12 @@ attest_get_boot_data(uint8_t major_type, void *ptr, uint32_t len) {
{
tlv_entry = (struct shared_data_tlv_entry *)offset;
if (GET_MAJOR(tlv_entry->tlv_type) == major_type) {
if (len < ptr_tlv_header->tlv_tot_len + tlv_entry->tlv_len) {
return PSA_ATTEST_ERR_INIT_FAILED;
}
memcpy(ptr, (const void *)tlv_entry, tlv_entry->tlv_len);
ptr += tlv_entry->tlv_len;
ptr_tlv_header->tlv_tot_len += tlv_entry->tlv_len;
if (len < ptr_tlv_header->tlv_tot_len) {
return PSA_ATTEST_ERR_INIT_FAILED;
}
}
if (tlv_entry->tlv_len == 0) {
break;
@ -89,4 +89,4 @@ attest_get_boot_data(uint8_t major_type, void *ptr, uint32_t len) {
shared_data_init_done = SHARED_DATA_INITIALZED;
return PSA_ATTEST_ERR_SUCCESS;
}
}

View File

@ -202,7 +202,7 @@ t_cose_crypto_hash_start(struct t_cose_crypto_hash *hash_ctx,
* failure.
*/
cose_ret = check_hash_sizes();
if (cose_ret)
if (cose_ret != T_COSE_SUCCESS)
{
return cose_ret;
}
@ -239,8 +239,6 @@ void t_cose_crypto_hash_update(struct t_cose_crypto_hash *hash_ctx,
psa_hash_ctx->status = psa_hash_update(&psa_hash_ctx->operation,
data_to_hash.ptr,
data_to_hash.len);
} else {
/* Intentionally do nothing, just computing the size of the token */
}
}
}

View File

@ -18,7 +18,7 @@
#include "attestation_bootloader_data.h"
/* Temporary Boodloader data - conatians temp mandatory claims */
/* Temporary Boodloader data - contains temp mandatory claims */
__attribute__((aligned(4)))
const uint8_t temp_ram_page_data[] = {
0x16, 0x20, 0x8C, 0x00, //shared_data_tlv_header

View File

@ -28,4 +28,4 @@ attest_check_memory_access(void *addr,
return PSA_ATTEST_ERR_INVALID_INPUT;
}
return PSA_ATTEST_ERR_SUCCESS;
}
}