refactor(psa): change all occurrences of RSS to RSE

Changes all occurrences of "RSS" and "rss" in the code and build files
to "RSE" and "rse".

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I606e2663fb3719edf6372d6ffa4f1982eef45994
This commit is contained in:
Tamas Ban 2024-02-22 11:41:25 +01:00
parent 47805037a2
commit d797665cce
11 changed files with 72 additions and 72 deletions

View file

@ -15,9 +15,9 @@
#include "psa/error.h"
/* RSS Delegated Attestation message types that distinguish its services. */
#define RSS_DELEGATED_ATTEST_GET_DELEGATED_KEY 1001U
#define RSS_DELEGATED_ATTEST_GET_PLATFORM_TOKEN 1002U
/* RSE Delegated Attestation message types that distinguish its services. */
#define RSE_DELEGATED_ATTEST_GET_DELEGATED_KEY 1001U
#define RSE_DELEGATED_ATTEST_GET_PLATFORM_TOKEN 1002U
/**
* The aim of these APIs to get a derived signing key (private only) for the
@ -28,13 +28,13 @@
* key is bind to the platform token (details below).
*
* Expected usage model:
* - First rss_delegated_attest_get_delegated_key() API need to be called to
* - First rse_delegated_attest_get_delegated_key() API need to be called to
* obtain the private part of the delegated attestation key. The public part
* of key is computed by the cryptographic library when the key is
* registered.
* - Secondly the rss_delegated_attest_get_token() must be called to obtain
* - Secondly the rse_delegated_attest_get_token() must be called to obtain
* platform attestation token. The hash of the public key (computed by
* the hash_algo indicated in the rss_delegated_attest_get_delegated_key()
* the hash_algo indicated in the rse_delegated_attest_get_delegated_key()
* call) must be the input of this call. This ensures that nothing but the
* previously derived delegated key is bindable to the platform token.
*/
@ -74,7 +74,7 @@
* platform attestation token as they are cryptographically linked together.
*/
psa_status_t
rss_delegated_attest_get_delegated_key(uint8_t ecc_curve,
rse_delegated_attest_get_delegated_key(uint8_t ecc_curve,
uint32_t key_bits,
uint8_t *key_buf,
size_t key_buf_size,
@ -100,7 +100,7 @@ rss_delegated_attest_get_delegated_key(uint8_t ecc_curve,
* code will be returned.
*/
psa_status_t
rss_delegated_attest_get_token(const uint8_t *dak_pub_hash,
rse_delegated_attest_get_token(const uint8_t *dak_pub_hash,
size_t dak_pub_hash_size,
uint8_t *token_buf,
size_t token_buf_size,

View file

@ -14,7 +14,7 @@
#include <dice.h>
/* Additional defines for max size limit. These limits are set by DPE in RSS. */
/* Additional defines for max size limit. These limits are set by DPE in RSE. */
#define DICE_AUTHORITY_DESCRIPTOR_MAX_SIZE 64
#define DICE_CONFIG_DESCRIPTOR_MAX_SIZE 64
#define DICE_CODE_DESCRIPTOR_MAX_SIZE 32
@ -28,7 +28,7 @@ typedef int32_t dpe_error_t;
#define DPE_ARGUMENT_NOT_SUPPORTED ((dpe_error_t)4)
#define DPE_SESSION_EXHAUSTED ((dpe_error_t)5)
/* Custom values in RSS based DPE implementation */
/* Custom values in RSE based DPE implementation */
#define DPE_INSUFFICIENT_MEMORY ((dpe_error_t)128)
#define DPE_ERR_CBOR_FORMATTING ((dpe_error_t)129)

View file

@ -43,11 +43,11 @@
* - When the requested slot is not accessible to the caller.
*/
/* Not a standard PSA API, just an extension therefore use the 'rss_' prefix
/* Not a standard PSA API, just an extension therefore use the 'rse_' prefix
* rather than the usual 'psa_'.
*/
psa_status_t
rss_measured_boot_extend_measurement(uint8_t index,
rse_measured_boot_extend_measurement(uint8_t index,
const uint8_t *signer_id,
size_t signer_id_size,
const uint8_t *version,
@ -92,7 +92,7 @@ rss_measured_boot_extend_measurement(uint8_t index,
* PSA_ERROR_DOES_NOT_EXIST
* - The requested slot is empty, does not contain a measurement.
*/
psa_status_t rss_measured_boot_read_measurement(uint8_t index,
psa_status_t rse_measured_boot_read_measurement(uint8_t index,
uint8_t *signer_id,
size_t signer_id_size,
size_t *signer_id_len,

View file

@ -8,19 +8,19 @@
#ifndef PSA_MANIFEST_SID_H
#define PSA_MANIFEST_SID_H
/******** RSS_SP_CRYPTO ********/
#define RSS_CRYPTO_HANDLE (0x40000100U)
/******** RSE_SP_CRYPTO ********/
#define RSE_CRYPTO_HANDLE (0x40000100U)
/******** RSS_SP_PLATFORM ********/
#define RSS_PLATFORM_SERVICE_HANDLE (0x40000105U)
/******** RSE_SP_PLATFORM ********/
#define RSE_PLATFORM_SERVICE_HANDLE (0x40000105U)
/******** PSA_SP_MEASURED_BOOT ********/
#define RSS_MEASURED_BOOT_HANDLE (0x40000110U)
#define RSE_MEASURED_BOOT_HANDLE (0x40000110U)
/******** PSA_SP_DELEGATED_ATTESTATION ********/
#define RSS_DELEGATED_SERVICE_HANDLE (0x40000111U)
#define RSE_DELEGATED_SERVICE_HANDLE (0x40000111U)
/******** PSA_SP_DICE_PROTECTION_ENVIRONMENT ********/
#define RSS_DPE_SERVICE_HANDLE (0x40000112U)
#define RSE_DPE_SERVICE_HANDLE (0x40000112U)
#endif /* PSA_MANIFEST_SID_H */

View file

@ -5,8 +5,8 @@
*
*/
#ifndef RSS_CRYPTO_DEFS_H
#define RSS_CRYPTO_DEFS_H
#ifndef RSE_CRYPTO_DEFS_H
#define RSE_CRYPTO_DEFS_H
/* Declares types that encode errors, algorithms, key types, policies, etc. */
#include "psa/crypto_types.h"
@ -16,31 +16,31 @@
* to the corresponding API implementation in the Crypto service backend.
*
*/
#define RSS_CRYPTO_EXPORT_PUBLIC_KEY_SID (uint16_t)(0x701)
#define RSE_CRYPTO_EXPORT_PUBLIC_KEY_SID (uint16_t)(0x701)
/*
* The persistent key identifiers for RSS builtin keys.
* The persistent key identifiers for RSE builtin keys.
*/
enum rss_key_id_builtin_t {
RSS_BUILTIN_KEY_ID_HOST_S_ROTPK = 0x7FFF816Cu,
RSS_BUILTIN_KEY_ID_HOST_NS_ROTPK,
RSS_BUILTIN_KEY_ID_HOST_CCA_ROTPK,
enum rse_key_id_builtin_t {
RSE_BUILTIN_KEY_ID_HOST_S_ROTPK = 0x7FFF816Cu,
RSE_BUILTIN_KEY_ID_HOST_NS_ROTPK,
RSE_BUILTIN_KEY_ID_HOST_CCA_ROTPK,
};
/*
* This type is used to overcome a limitation within RSS firmware in the number of maximum
* This type is used to overcome a limitation within RSE firmware in the number of maximum
* IOVECs it can use especially in psa_aead_encrypt and psa_aead_decrypt.
*/
#define RSS_CRYPTO_MAX_NONCE_LENGTH (16u)
struct rss_crypto_aead_pack_input {
uint8_t nonce[RSS_CRYPTO_MAX_NONCE_LENGTH];
#define RSE_CRYPTO_MAX_NONCE_LENGTH (16u)
struct rse_crypto_aead_pack_input {
uint8_t nonce[RSE_CRYPTO_MAX_NONCE_LENGTH];
uint32_t nonce_length;
};
/*
* Structure used to pack non-pointer types in a call to PSA Crypto APIs
*/
struct rss_crypto_pack_iovec {
struct rse_crypto_pack_iovec {
psa_key_id_t key_id; /* !< Key id */
psa_algorithm_t alg; /* !< Algorithm */
uint32_t op_handle; /*
@ -56,7 +56,7 @@ struct rss_crypto_pack_iovec {
* AEAD
*/
struct rss_crypto_aead_pack_input aead_in; /*
struct rse_crypto_aead_pack_input aead_in; /*
* !< Packs AEAD-related
* inputs
*/
@ -64,7 +64,7 @@ struct rss_crypto_pack_iovec {
uint16_t function_id; /*
* !< Used to identify the function in the
* API dispatcher to the service backend
* See rss_crypto_func_sid for detail
* See rse_crypto_func_sid for detail
*/
uint16_t step; /* !< Key derivation step */
union {
@ -76,4 +76,4 @@ struct rss_crypto_pack_iovec {
};
};
#endif /* RSS_CRYPTO_DEFS_H */
#endif /* RSE_CRYPTO_DEFS_H */

View file

@ -5,16 +5,16 @@
*
*/
#ifndef RSS_PLATFORM_API_H
#define RSS_PLATFORM_API_H
#ifndef RSE_PLATFORM_API_H
#define RSE_PLATFORM_API_H
#include <stdint.h>
#include "psa/error.h"
#include <rss_crypto_defs.h>
#include <rse_crypto_defs.h>
#define RSS_PLATFORM_API_ID_NV_READ (1010)
#define RSS_PLATFORM_API_ID_NV_INCREMENT (1011)
#define RSE_PLATFORM_API_ID_NV_READ (1010)
#define RSE_PLATFORM_API_ID_NV_INCREMENT (1011)
/*
* Increments the given non-volatile (NV) counter by one
@ -25,7 +25,7 @@
* it returns a PSA_ERROR.
*/
psa_status_t
rss_platform_nv_counter_increment(uint32_t counter_id);
rse_platform_nv_counter_increment(uint32_t counter_id);
/*
* Reads the given non-volatile (NV) counter
@ -39,7 +39,7 @@ rss_platform_nv_counter_increment(uint32_t counter_id);
* it returns a PSA_ERROR.
*/
psa_status_t
rss_platform_nv_counter_read(uint32_t counter_id,
rse_platform_nv_counter_read(uint32_t counter_id,
uint32_t size, uint8_t *val);
/*
@ -54,7 +54,7 @@ rss_platform_nv_counter_read(uint32_t counter_id,
* it returns a PSA_ERROR.
*/
psa_status_t
rss_platform_key_read(enum rss_key_id_builtin_t key, uint8_t *data,
rse_platform_key_read(enum rse_key_id_builtin_t key, uint8_t *data,
size_t data_size, size_t *data_length);
#endif /* RSS_PLATFORM_API_H */
#endif /* RSE_PLATFORM_API_H */

View file

@ -10,7 +10,7 @@
#include <psa_manifest/sid.h>
psa_status_t
rss_delegated_attest_get_delegated_key(uint8_t ecc_curve,
rse_delegated_attest_get_delegated_key(uint8_t ecc_curve,
uint32_t key_bits,
uint8_t *key_buf,
size_t key_buf_size,
@ -31,8 +31,8 @@ rss_delegated_attest_get_delegated_key(uint8_t ecc_curve,
return PSA_ERROR_INVALID_ARGUMENT;
}
status = psa_call(RSS_DELEGATED_SERVICE_HANDLE,
RSS_DELEGATED_ATTEST_GET_DELEGATED_KEY,
status = psa_call(RSE_DELEGATED_SERVICE_HANDLE,
RSE_DELEGATED_ATTEST_GET_DELEGATED_KEY,
in_vec, IOVEC_LEN(in_vec),
out_vec, IOVEC_LEN(out_vec));
if (status == PSA_SUCCESS) {
@ -43,7 +43,7 @@ rss_delegated_attest_get_delegated_key(uint8_t ecc_curve,
}
psa_status_t
rss_delegated_attest_get_token(const uint8_t *dak_pub_hash,
rse_delegated_attest_get_token(const uint8_t *dak_pub_hash,
size_t dak_pub_hash_size,
uint8_t *token_buf,
size_t token_buf_size,
@ -61,8 +61,8 @@ rss_delegated_attest_get_token(const uint8_t *dak_pub_hash,
return PSA_ERROR_INVALID_ARGUMENT;
}
status = psa_call(RSS_DELEGATED_SERVICE_HANDLE,
RSS_DELEGATED_ATTEST_GET_PLATFORM_TOKEN,
status = psa_call(RSE_DELEGATED_SERVICE_HANDLE,
RSE_DELEGATED_ATTEST_GET_PLATFORM_TOKEN,
in_vec, IOVEC_LEN(in_vec),
out_vec, IOVEC_LEN(out_vec));
if (status == PSA_SUCCESS) {

View file

@ -258,7 +258,7 @@ static int32_t dpe_client_call(const char *cmd_input, size_t cmd_input_size,
{ cmd_output, *cmd_output_size },
};
err = psa_call(RSS_DPE_SERVICE_HANDLE, 0,
err = psa_call(RSE_DPE_SERVICE_HANDLE, 0,
in_vec, IOVEC_LEN(in_vec), out_vec, IOVEC_LEN(out_vec));
if (err == PSA_SUCCESS) {

View file

@ -63,7 +63,7 @@ static void log_measurement(uint8_t index,
}
psa_status_t
rss_measured_boot_extend_measurement(uint8_t index,
rse_measured_boot_extend_measurement(uint8_t index,
const uint8_t *signer_id,
size_t signer_id_size,
const uint8_t *version,
@ -115,13 +115,13 @@ rss_measured_boot_extend_measurement(uint8_t index,
measurement_algo, measurement_value,
measurement_value_size, lock_measurement);
return psa_call(RSS_MEASURED_BOOT_HANDLE,
RSS_MEASURED_BOOT_EXTEND,
return psa_call(RSE_MEASURED_BOOT_HANDLE,
RSE_MEASURED_BOOT_EXTEND,
in_vec, IOVEC_LEN(in_vec),
NULL, 0);
}
psa_status_t rss_measured_boot_read_measurement(uint8_t index,
psa_status_t rse_measured_boot_read_measurement(uint8_t index,
uint8_t *signer_id,
size_t signer_id_size,
size_t *signer_id_len,
@ -158,7 +158,7 @@ psa_status_t rss_measured_boot_read_measurement(uint8_t index,
{.base = measurement_value, .len = measurement_value_size}
};
status = psa_call(RSS_MEASURED_BOOT_HANDLE, RSS_MEASURED_BOOT_READ,
status = psa_call(RSE_MEASURED_BOOT_HANDLE, RSE_MEASURED_BOOT_READ,
in_vec, IOVEC_LEN(in_vec),
out_vec, IOVEC_LEN(out_vec));

View file

@ -13,8 +13,8 @@
#include <drivers/measured_boot/metadata.h>
/* Measured boot message types that distinguish its services */
#define RSS_MEASURED_BOOT_READ 1001U
#define RSS_MEASURED_BOOT_EXTEND 1002U
#define RSE_MEASURED_BOOT_READ 1001U
#define RSE_MEASURED_BOOT_EXTEND 1002U
struct measured_boot_read_iovec_in_t {
uint8_t index;

View file

@ -7,24 +7,24 @@
#include <psa/client.h>
#include <psa_manifest/sid.h>
#include <rss_crypto_defs.h>
#include <rss_platform_api.h>
#include <rse_crypto_defs.h>
#include <rse_platform_api.h>
psa_status_t
rss_platform_nv_counter_increment(uint32_t counter_id)
rse_platform_nv_counter_increment(uint32_t counter_id)
{
struct psa_invec in_vec[1];
in_vec[0].base = &counter_id;
in_vec[0].len = sizeof(counter_id);
return psa_call(RSS_PLATFORM_SERVICE_HANDLE,
RSS_PLATFORM_API_ID_NV_INCREMENT,
return psa_call(RSE_PLATFORM_SERVICE_HANDLE,
RSE_PLATFORM_API_ID_NV_INCREMENT,
in_vec, 1, NULL, 0);
}
psa_status_t
rss_platform_nv_counter_read(uint32_t counter_id,
rse_platform_nv_counter_read(uint32_t counter_id,
uint32_t size, uint8_t *val)
{
struct psa_invec in_vec[1];
@ -36,30 +36,30 @@ rss_platform_nv_counter_read(uint32_t counter_id,
out_vec[0].base = val;
out_vec[0].len = size;
return psa_call(RSS_PLATFORM_SERVICE_HANDLE,
RSS_PLATFORM_API_ID_NV_READ,
return psa_call(RSE_PLATFORM_SERVICE_HANDLE,
RSE_PLATFORM_API_ID_NV_READ,
in_vec, 1, out_vec, 1);
}
psa_status_t
rss_platform_key_read(enum rss_key_id_builtin_t key, uint8_t *data,
rse_platform_key_read(enum rse_key_id_builtin_t key, uint8_t *data,
size_t data_size, size_t *data_length)
{
psa_status_t status;
struct rss_crypto_pack_iovec iov = {
.function_id = RSS_CRYPTO_EXPORT_PUBLIC_KEY_SID,
struct rse_crypto_pack_iovec iov = {
.function_id = RSE_CRYPTO_EXPORT_PUBLIC_KEY_SID,
.key_id = key,
};
psa_invec in_vec[] = {
{.base = &iov, .len = sizeof(struct rss_crypto_pack_iovec)},
{.base = &iov, .len = sizeof(struct rse_crypto_pack_iovec)},
};
psa_outvec out_vec[] = {
{.base = data, .len = data_size}
};
status = psa_call(RSS_CRYPTO_HANDLE, PSA_IPC_CALL,
status = psa_call(RSE_CRYPTO_HANDLE, PSA_IPC_CALL,
in_vec, IOVEC_LEN(in_vec),
out_vec, IOVEC_LEN(out_vec));