Skip to content

Commit

Permalink
fix nistp256 template
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Feb 29, 2024
1 parent 7205e9d commit 69532fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gpg_ux_nanos.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ void ui_menu_tmpl_set_action(unsigned int value) {
attributes.value[0] = KEY_ID_ECDSA;
}
oid = gpg_curve2oid(G_gpg_vstate.ux_type, &oid_len);
memmove(attributes.value + 1, oid, sizeof(oid_len));
memmove(attributes.value + 1, oid, oid_len);
attributes.length = 1 + oid_len;
break;

Expand Down
7 changes: 5 additions & 2 deletions src/gpg_ux_nanox.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,13 +607,16 @@ void ui_menu_tmpl_set_action(unsigned int value) {
break;

case CX_CURVE_SECP256R1:
oid = gpg_curve2oid(G_gpg_vstate.ux_type, &oid_len);
if (oid == NULL) {
break;
}
if (G_gpg_vstate.ux_key == 2) {
attributes.value[0] = KEY_ID_ECDH;
} else {
attributes.value[0] = KEY_ID_ECDSA;
}
oid = gpg_curve2oid(G_gpg_vstate.ux_type, &oid_len);
memmove(attributes.value + 1, oid, sizeof(oid_len));
memmove(attributes.value + 1, oid, oid_len);
attributes.length = 1 + oid_len;
break;

Expand Down

0 comments on commit 69532fd

Please sign in to comment.