fix nistp256 template

This commit is contained in:
Charles-Edouard de la Vergne 2024-02-29 16:40:43 +01:00
parent 7205e9dcb5
commit 69532fde5a
No known key found for this signature in database
GPG Key ID: F12296941B7BB9C6
2 changed files with 6 additions and 3 deletions

View File

@ -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;

View File

@ -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;