Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PKI command documentation and minor changes #713

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion include/os_pki.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#define CERTIFICATE_STRUCTURE_TYPE_CERTIFICATE (0x01)
/** Maximum certificate trusted name length */
#define CERTIFICATE_TRUSTED_NAME_MAXLEN (32)
/** Certificate depth maximum value */
#define CERTIFICATE_DEPTH_MAX_VALUE (0xFF)

/** Certificate tags associated to each certificate field */
typedef enum {
Expand Down Expand Up @@ -88,6 +90,7 @@ enum {
CERTIFICATE_TARGET_DEVICE_NANOX,
CERTIFICATE_TARGET_DEVICE_NANOSP,
CERTIFICATE_TARGET_DEVICE_STAX,
CERTIFICATE_TARGET_DEVICE_FLEX,
CERTIFICATE_TARGET_DEVICE_UNKNOWN
};

Expand Down Expand Up @@ -137,7 +140,7 @@ static const os_pki_certificate_tag_info_t C_os_pki_certificate_tag_info[] = {
[CERTIFICATE_INFO_INDEX_PK_SIGN_ALGO_ID] = {CERTIFICATE_SIGN_ALGO_ID_UNKNOWN, 0x01 },
[CERTIFICATE_INFO_INDEX_TARGET_DEVICE] = {CERTIFICATE_TARGET_DEVICE_UNKNOWN, 0x01 },
[CERTIFICATE_INFO_INDEX_SIGNATURE] = {CERTIFICATE_FIELD_UNKNOWN_VALUE, CERTIFICATE_FIELD_VAR_LEN},
[CERTIFICATE_INFO_INDEX_DEPTH] = {CERTIFICATE_FIELD_UNKNOWN_VALUE, 0x01 },
[CERTIFICATE_INFO_INDEX_DEPTH] = {CERTIFICATE_DEPTH_MAX_VALUE, 0x01 },
};

static const cx_md_t C_os_sign_algo_hash_info[] = {
Expand Down
10 changes: 3 additions & 7 deletions include/sdk_apdu_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,9 @@
* |DATA |CERT_LEN|CERT |Certificate |
*
* - Response APDU
* |DATA |LENGTH | DESCRIPTION |
* |-----------------|-----------------|---------------------------------|
* |TRUSTED_NAME_LEN |0x01 | Certificate trusted name length |
* |TRUSTED_NAME |TRUSTED_NAME_LEN | Certificate trusted name |
* |PUBLIC_KEY_LEN |0x01 | Certificate public key length |
* |PUBLIC_KEY |PUBLIC_KEY_LEN | Certificate public key |
* |STATUS_WORD |0x02 | 0x9000 on success |
* |DATA |LENGTH | DESCRIPTION |
* |-----------------|-----------------|-------------------|
* |STATUS_WORD |0x02 | 0x9000 on success |
*/
#define DEFAULT_APDU_INS_LOAD_CERTIFICATE 0x06
#endif // HAVE_LEDGER_PKI
Expand Down
Loading