Skip to content

Commit

Permalink
Update PKI command documentation and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
srasoamiaramanana-ledger committed Jul 1, 2024
1 parent 9145aa6 commit 9701ea6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
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

0 comments on commit 9701ea6

Please sign in to comment.