mirror of
https://github.com/LedgerHQ/openpgp-card-app
synced 2024-11-09 07:10:30 +00:00
PRODUCT: Remove deprecated RSA1024
This commit is contained in:
parent
9f3130e88b
commit
56c0ece628
@ -407,10 +407,6 @@ int gpg_apdu_put_data(unsigned int ref) {
|
|||||||
rsa_pub = (cx_rsa_public_key_t *) &G_gpg_vstate.work.rsa.public;
|
rsa_pub = (cx_rsa_public_key_t *) &G_gpg_vstate.work.rsa.public;
|
||||||
rsa_priv = (cx_rsa_private_key_t *) &G_gpg_vstate.work.rsa.private;
|
rsa_priv = (cx_rsa_private_key_t *) &G_gpg_vstate.work.rsa.private;
|
||||||
switch (ksz) {
|
switch (ksz) {
|
||||||
case 1024 / 8:
|
|
||||||
pkey_size = sizeof(cx_rsa_1024_private_key_t);
|
|
||||||
pq = G_gpg_vstate.work.rsa.public1024.n;
|
|
||||||
break;
|
|
||||||
case 2048 / 8:
|
case 2048 / 8:
|
||||||
pkey_size = sizeof(cx_rsa_2048_private_key_t);
|
pkey_size = sizeof(cx_rsa_2048_private_key_t);
|
||||||
pq = G_gpg_vstate.work.rsa.public2048.n;
|
pq = G_gpg_vstate.work.rsa.public2048.n;
|
||||||
|
@ -87,9 +87,6 @@ static int gpg_gen_rsa_kyey(gpg_key_t *keygpg, uint8_t *name) {
|
|||||||
rsa_pub = (cx_rsa_public_key_t *) &G_gpg_vstate.work.rsa.public;
|
rsa_pub = (cx_rsa_public_key_t *) &G_gpg_vstate.work.rsa.public;
|
||||||
rsa_priv = (cx_rsa_private_key_t *) &G_gpg_vstate.work.rsa.private;
|
rsa_priv = (cx_rsa_private_key_t *) &G_gpg_vstate.work.rsa.private;
|
||||||
switch (ksz) {
|
switch (ksz) {
|
||||||
case 1024 / 8:
|
|
||||||
pkey_size = sizeof(cx_rsa_1024_private_key_t);
|
|
||||||
break;
|
|
||||||
case 2048 / 8:
|
case 2048 / 8:
|
||||||
pkey_size = sizeof(cx_rsa_2048_private_key_t);
|
pkey_size = sizeof(cx_rsa_2048_private_key_t);
|
||||||
break;
|
break;
|
||||||
@ -155,12 +152,6 @@ static int gpg_read_rsa_kyey(gpg_key_t *keygpg) {
|
|||||||
ksz = U2BE(keygpg->attributes.value, 1) >> 3;
|
ksz = U2BE(keygpg->attributes.value, 1) >> 3;
|
||||||
gpg_io_mark();
|
gpg_io_mark();
|
||||||
switch (ksz) {
|
switch (ksz) {
|
||||||
case 1024 / 8:
|
|
||||||
if (keygpg->priv_key.rsa1024.size == 0) {
|
|
||||||
return SW_REFERENCED_DATA_NOT_FOUND;
|
|
||||||
}
|
|
||||||
gpg_io_insert_tlv(0x81, ksz, (unsigned char *) &keygpg->priv_key.rsa1024.n);
|
|
||||||
break;
|
|
||||||
case 2048 / 8:
|
case 2048 / 8:
|
||||||
if (keygpg->priv_key.rsa2048.size == 0) {
|
if (keygpg->priv_key.rsa2048.size == 0) {
|
||||||
return SW_REFERENCED_DATA_NOT_FOUND;
|
return SW_REFERENCED_DATA_NOT_FOUND;
|
||||||
|
@ -72,9 +72,6 @@ static int gpg_sign(gpg_key_t *sigkey) {
|
|||||||
unsigned int ksz, l;
|
unsigned int ksz, l;
|
||||||
ksz = U2BE(sigkey->attributes.value, 1) >> 3;
|
ksz = U2BE(sigkey->attributes.value, 1) >> 3;
|
||||||
switch (ksz) {
|
switch (ksz) {
|
||||||
case 1024 / 8:
|
|
||||||
key = (cx_rsa_private_key_t *) &sigkey->priv_key.rsa1024;
|
|
||||||
break;
|
|
||||||
case 2048 / 8:
|
case 2048 / 8:
|
||||||
key = (cx_rsa_private_key_t *) &sigkey->priv_key.rsa2048;
|
key = (cx_rsa_private_key_t *) &sigkey->priv_key.rsa2048;
|
||||||
break;
|
break;
|
||||||
@ -262,9 +259,6 @@ int gpg_apdu_pso() {
|
|||||||
ksz = U2BE(G_gpg_vstate.mse_dec->attributes.value, 1) >> 3;
|
ksz = U2BE(G_gpg_vstate.mse_dec->attributes.value, 1) >> 3;
|
||||||
key = NULL;
|
key = NULL;
|
||||||
switch (ksz) {
|
switch (ksz) {
|
||||||
case 1024 / 8:
|
|
||||||
key = (cx_rsa_private_key_t *) &G_gpg_vstate.mse_dec->priv_key.rsa1024;
|
|
||||||
break;
|
|
||||||
case 2048 / 8:
|
case 2048 / 8:
|
||||||
key = (cx_rsa_private_key_t *) &G_gpg_vstate.mse_dec->priv_key.rsa2048;
|
key = (cx_rsa_private_key_t *) &G_gpg_vstate.mse_dec->priv_key.rsa2048;
|
||||||
break;
|
break;
|
||||||
|
@ -75,12 +75,8 @@ typedef struct gpg_key_s {
|
|||||||
/* C1 C2 C3 */
|
/* C1 C2 C3 */
|
||||||
LV(attributes, GPG_KEY_ATTRIBUTES_LENGTH);
|
LV(attributes, GPG_KEY_ATTRIBUTES_LENGTH);
|
||||||
/* key value */
|
/* key value */
|
||||||
/* WARN: changing the cx_<key>_t structures breaks backup/restore. Adapt backup/restore code
|
|
||||||
* to ensure backward compatibility.
|
|
||||||
*/
|
|
||||||
union {
|
union {
|
||||||
cx_rsa_private_key_t rsa;
|
cx_rsa_private_key_t rsa;
|
||||||
cx_rsa_1024_private_key_t rsa1024;
|
|
||||||
cx_rsa_2048_private_key_t rsa2048;
|
cx_rsa_2048_private_key_t rsa2048;
|
||||||
cx_rsa_3072_private_key_t rsa3072;
|
cx_rsa_3072_private_key_t rsa3072;
|
||||||
cx_rsa_4096_private_key_t rsa4096;
|
cx_rsa_4096_private_key_t rsa4096;
|
||||||
@ -212,14 +208,12 @@ struct gpg_v_state_s {
|
|||||||
struct {
|
struct {
|
||||||
union {
|
union {
|
||||||
cx_rsa_public_key_t public;
|
cx_rsa_public_key_t public;
|
||||||
cx_rsa_1024_public_key_t public1024;
|
|
||||||
cx_rsa_2048_public_key_t public2048;
|
cx_rsa_2048_public_key_t public2048;
|
||||||
cx_rsa_3072_public_key_t public3072;
|
cx_rsa_3072_public_key_t public3072;
|
||||||
cx_rsa_4096_public_key_t public4096;
|
cx_rsa_4096_public_key_t public4096;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
cx_rsa_private_key_t private;
|
cx_rsa_private_key_t private;
|
||||||
cx_rsa_1024_private_key_t private1024;
|
|
||||||
cx_rsa_2048_private_key_t private2048;
|
cx_rsa_2048_private_key_t private2048;
|
||||||
cx_rsa_3072_private_key_t private3072;
|
cx_rsa_3072_private_key_t private3072;
|
||||||
cx_rsa_4096_private_key_t private4096;
|
cx_rsa_4096_private_key_t private4096;
|
||||||
|
Loading…
Reference in New Issue
Block a user