Mark driver-specific global sc_atr_table structures as const

As most of the drivers do not modify these, we can mark them as const.
Two drivers that we cannot convert are dnie and masktech.

section                 size
.data                  35232 ->   25472
.data.rel.ro           36928 ->   46688
This commit is contained in:
Priit Laes 2018-08-22 18:01:51 +03:00 committed by Frank Morgner
parent 2eae5e70f5
commit 45f407c021
29 changed files with 29 additions and 29 deletions

View File

@ -27,7 +27,7 @@
#include "internal.h"
#include "cardctl.h"
static struct sc_atr_table acos5_atrs[] = {
static const struct sc_atr_table acos5_atrs[] = {
{"3b:be:96:00:00:41:05:20:00:00:00:00:00:00:00:00:00:90:00", NULL, NULL,
SC_CARD_TYPE_ACOS5_GENERIC, 0, NULL},
{"3b:be:18:00:00:41:05:10:00:00:00:00:00:00:00:00:00:90:00", NULL, NULL,

View File

@ -43,7 +43,7 @@ static struct sc_card_driver akis_drv = {
NULL, 0, NULL
};
static struct sc_atr_table akis_atrs[] = {
static const struct sc_atr_table akis_atrs[] = {
{ "3b:ba:11:00:81:31:fe:4d:55:45:4b:41:45:20:56:31:2e:30:ae", NULL, NULL, SC_CARD_TYPE_AKIS_GENERIC, 0, NULL },
{ NULL, NULL, NULL, 0, 0, NULL }
};

View File

@ -37,7 +37,7 @@ static struct sc_card_driver asepcos_drv = {
NULL, 0, NULL
};
static struct sc_atr_table asepcos_atrs[] = {
static const struct sc_atr_table asepcos_atrs[] = {
{ "3b:d6:18:00:81:b1:80:7d:1f:03:80:51:00:61:10:30:8f", NULL, NULL, SC_CARD_TYPE_ASEPCOS_GENERIC, 0, NULL},
{ "3b:d6:18:00:81:b1:fe:7d:1f:03:41:53:45:37:35:35:01", NULL, NULL, SC_CARD_TYPE_ASEPCOS_JAVA, 0, NULL},
{ NULL, NULL, NULL, 0, 0, NULL }

View File

@ -80,7 +80,7 @@ struct authentic_private_data {
struct sc_cplc cplc;
};
static struct sc_atr_table authentic_known_atrs[] = {
static const struct sc_atr_table authentic_known_atrs[] = {
{ "3B:DD:18:00:81:31:FE:45:80:F9:A0:00:00:00:77:01:00:70:0A:90:00:8B", NULL,
"Oberthur AuthentIC 3.2.2", SC_CARD_TYPE_OBERTHUR_AUTHENTIC_3_2, 0, NULL },
{ NULL, NULL, NULL, 0, 0, NULL }

View File

@ -145,7 +145,7 @@ static long t1, t2, tot_read = 0, tot_dur = 0, dur;
/* Used for a trick in select file and read binary */
static size_t next_idx = (size_t)-1;
static struct sc_atr_table belpic_atrs[] = {
static const struct sc_atr_table belpic_atrs[] = {
/* Applet V1.1 */
{ "3B:98:13:40:0A:A5:03:01:01:01:AD:13:11", NULL, NULL, SC_CARD_TYPE_BELPIC_EID, 0, NULL },
/* Applet V1.0 with new EMV-compatible ATR */

View File

@ -42,7 +42,7 @@ static struct sc_card_driver cardos_drv = {
NULL, 0, NULL
};
static struct sc_atr_table cardos_atrs[] = {
static const struct sc_atr_table cardos_atrs[] = {
/* 4.0 */
{ "3b:e2:00:ff:c1:10:31:fe:55:c8:02:9c", NULL, NULL, SC_CARD_TYPE_CARDOS_GENERIC, 0, NULL },
/* Italian eID card, postecert */

View File

@ -78,7 +78,7 @@ extern int dnie_read_file(
* Override APDU response error codes from iso7816.c to allow
* handling of SM specific error
*/
static struct sc_card_error dnie_errors[] = {
static const struct sc_card_error dnie_errors[] = {
{0x6688, SC_ERROR_SM, "Cryptographic checksum invalid"},
{0x6987, SC_ERROR_SM, "Expected SM Data Object missing"},
{0x6988, SC_ERROR_SM, "SM Data Object incorrect"},

View File

@ -30,7 +30,7 @@
#include "asn1.h"
#include "cardctl.h"
static struct sc_atr_table entersafe_atrs[] = {
static const struct sc_atr_table entersafe_atrs[] = {
{
"3b:0f:00:65:46:53:05:19:05:71:df:00:00:00:00:00:00",
"ff:ff:ff:ff:ff:ff:ff:00:ff:ff:ff:00:00:00:00:00:00",

View File

@ -46,7 +46,7 @@
#include "asn1.h"
#include "cardctl.h"
static struct sc_atr_table epass2003_atrs[] = {
static const struct sc_atr_table epass2003_atrs[] = {
/* This is a FIPS certified card using SCP01 security messaging. */
{"3B:9F:95:81:31:FE:9F:00:66:46:53:05:10:00:11:71:df:00:00:00:6a:82:5e",
"FF:FF:FF:FF:FF:00:FF:FF:FF:FF:FF:FF:00:00:00:ff:00:ff:ff:00:00:00:00",

View File

@ -31,7 +31,7 @@
#define FLAG_KEYGEN 0x80000000
#define IS_CYBERFLEX(card) (card->type == SC_CARD_TYPE_FLEX_CYBER)
static struct sc_atr_table flex_atrs[] = {
static const struct sc_atr_table flex_atrs[] = {
/* Cryptoflex */
/* 8k win2000 */
{ "3b:95:15:40:20:68:01:02:00:00", NULL, "Cryptoflex 8K", SC_CARD_TYPE_FLEX_CRYPTO, 0, NULL },

View File

@ -44,7 +44,7 @@ static struct sc_card_driver gemsafe_drv = {
};
/* Known ATRs */
static struct sc_atr_table gemsafe_atrs[] = {
static const struct sc_atr_table gemsafe_atrs[] = {
/* standard version */
{"3B:7B:94:00:00:80:65:B0:83:01:01:74:83:00:90:00", NULL, NULL, SC_CARD_TYPE_GEMSAFEV1_GENERIC, 0, NULL},
{"3B:6B:00:00:80:65:B0:83:01:01:74:83:00:90:00", NULL, NULL, SC_CARD_TYPE_GEMSAFEV1_GENERIC, 0, NULL},

View File

@ -86,7 +86,7 @@ static int gpk_get_info(sc_card_t *, int, int, u8 *, size_t);
/*
* ATRs of GPK4000 cards courtesy of libscez
*/
static struct sc_atr_table gpk_atrs[] = {
static const struct sc_atr_table gpk_atrs[] = {
{ "3B:27:00:80:65:A2:04:01:01:37", NULL, "GPK 4K", SC_CARD_TYPE_GPK_GPK4000_s, 0, NULL },
{ "3B:27:00:80:65:A2:05:01:01:37", NULL, "GPK 4K", SC_CARD_TYPE_GPK_GPK4000_sp, 0, NULL },
{ "3B:27:00:80:65:A2:0C:01:01:37", NULL, "GPK 4K", SC_CARD_TYPE_GPK_GPK4000_su256, 0, NULL },

View File

@ -70,7 +70,7 @@ static struct sc_card_driver iasecc_drv = {
NULL, 0, NULL
};
static struct sc_atr_table iasecc_known_atrs[] = {
static const struct sc_atr_table iasecc_known_atrs[] = {
{ "3B:7F:96:00:00:00:31:B8:64:40:70:14:10:73:94:01:80:82:90:00",
"FF:FF:FF:FF:FF:FF:FF:FE:FF:FF:00:00:FF:FF:FF:FF:FF:FF:FF:FF",
"IAS/ECC Gemalto", SC_CARD_TYPE_IASECC_GEMALTO, 0, NULL },

View File

@ -47,7 +47,7 @@ static struct sc_card_driver incrypto34_drv = {
NULL, 0, NULL
};
static struct sc_atr_table incrypto34_atrs[] = {
static const struct sc_atr_table incrypto34_atrs[] = {
{ "3b:ff:18:00:ff:81:31:fe:55:00:6b:02:09:02:00:01:01:01:44:53:44:10:31:80:92", NULL, NULL, SC_CARD_TYPE_INCRYPTO34_GENERIC, 0, NULL },
{ NULL, NULL, NULL, 0, 0, NULL }
};

View File

@ -51,7 +51,7 @@ static struct sc_card_driver itacns_drv = {
/* List of ATR's for "hard" matching. */
static struct sc_atr_table itacns_atrs[] = {
static const struct sc_atr_table itacns_atrs[] = {
{ "3b:f4:18:00:ff:81:31:80:55:00:31:80:00:c7", NULL, NULL,
SC_CARD_TYPE_ITACNS_CIE_V1, 0, NULL},
{ NULL, NULL, NULL, 0, 0, NULL}

View File

@ -28,7 +28,7 @@
#include "internal.h"
#include "cardctl.h"
static struct sc_atr_table jcop_atrs[] = {
static const struct sc_atr_table jcop_atrs[] = {
{ "3B:E6:00:FF:81:31:FE:45:4A:43:4F:50:33:31:06", NULL, NULL, SC_CARD_TYPE_JCOP_GENERIC, 0, NULL },
{ NULL, NULL, NULL, 0, 0, NULL }
};

View File

@ -28,7 +28,7 @@
#include "internal.h"
#include "jpki.h"
static struct sc_atr_table jpki_atrs[] = {
static const struct sc_atr_table jpki_atrs[] = {
{"3b:e0:00:ff:81:31:fe:45:14", NULL, NULL,
SC_CARD_TYPE_JPKI_BASE, 0, NULL},
{NULL, NULL, NULL, 0, 0, NULL}

View File

@ -35,7 +35,7 @@
#include "cardctl.h"
#include "esteid.h"
static struct sc_atr_table mcrd_atrs[] = {
static const struct sc_atr_table mcrd_atrs[] = {
{"3B:FF:94:00:FF:80:B1:FE:45:1F:03:00:68:D2:76:00:00:28:FF:05:1E:31:80:00:90:00:23", NULL,
"Micardo 2.1/German BMI/D-Trust", SC_CARD_TYPE_MCRD_GENERIC, 0, NULL},
{"3b:6f:00:ff:00:68:d2:76:00:00:28:ff:05:1e:31:80:00:90:00", NULL,

View File

@ -29,7 +29,7 @@
#include "asn1.h"
#include "cardctl.h"
static struct sc_atr_table miocos_atrs[] = {
static const struct sc_atr_table miocos_atrs[] = {
/* Test card with 32 kB memory */
{ "3B:9D:94:40:23:00:68:10:11:4D:69:6F:43:4F:53:00:90:00", NULL, NULL, SC_CARD_TYPE_MIOCOS_GENERIC, 0, NULL },
/* Test card with 64 kB memory */

View File

@ -42,7 +42,7 @@ static struct sc_card_driver muscle_drv = {
NULL, 0, NULL
};
static struct sc_atr_table muscle_atrs[] = {
static const struct sc_atr_table muscle_atrs[] = {
/* Tyfone JCOP 242R2 cards */
{ "3b:6d:00:00:ff:54:79:66:6f:6e:65:20:32:34:32:52:32", NULL, NULL, SC_CARD_TYPE_MUSCLE_JCOP242R2_NO_EXT_APDU, 0, NULL },
/* Aladdin eToken PRO USB 72K Java */

View File

@ -55,7 +55,7 @@
#define DES_ecb_encrypt(a,b,c,d) des_ecb_encrypt(a,b,*c,d)
#endif
static struct sc_atr_table oberthur_atrs[] = {
static const struct sc_atr_table oberthur_atrs[] = {
{ "3B:7D:18:00:00:00:31:80:71:8E:64:77:E3:01:00:82:90:00", NULL,
"Oberthur 64k v4/2.1.1", SC_CARD_TYPE_OBERTHUR_64K, 0, NULL },
{ "3B:7D:18:00:00:00:31:80:71:8E:64:77:E3:02:00:82:90:00", NULL,

View File

@ -56,7 +56,7 @@ static const char default_cardname_v1[] = "OpenPGP card v1.x";
static const char default_cardname_v2[] = "OpenPGP card v2.x";
static const char default_cardname_v3[] = "OpenPGP card v3.x";
static struct sc_atr_table pgp_atrs[] = {
static const struct sc_atr_table pgp_atrs[] = {
{ "3b:fa:13:00:ff:81:31:80:45:00:31:c1:73:c0:01:00:00:90:00:b1", NULL, default_cardname_v1, SC_CARD_TYPE_OPENPGP_V1, 0, NULL },
{ "3b:da:18:ff:81:b1:fe:75:1f:03:00:31:c5:73:c0:01:40:00:90:00:0c", NULL, default_cardname_v2, SC_CARD_TYPE_OPENPGP_V2, 0, NULL },
{ "3b:da:11:ff:81:b1:fe:55:1f:03:00:31:84:73:80:01:80:00:90:00:e4", NULL, "Gnuk v1.0.x (OpenPGP v2.0)", SC_CARD_TYPE_OPENPGP_GNUK, 0, NULL },

View File

@ -41,7 +41,7 @@ static struct sc_card_driver rtecp_drv = {
NULL, 0, NULL
};
static struct sc_atr_table rtecp_atrs[] = {
static const struct sc_atr_table rtecp_atrs[] = {
/* Rutoken ECP */
{ "3B:8B:01:52:75:74:6F:6B:65:6E:20:45:43:50:A0",
NULL, "Rutoken ECP", SC_CARD_TYPE_GENERIC_BASE, 0, NULL },

View File

@ -84,7 +84,7 @@ static struct sc_card_driver rutoken_drv = {
NULL, 0, NULL
};
static struct sc_atr_table rutoken_atrs[] = {
static const struct sc_atr_table rutoken_atrs[] = {
{ "3b:6f:00:ff:00:56:72:75:54:6f:6b:6e:73:30:20:00:00:90:00", NULL, NULL, SC_CARD_TYPE_GENERIC_BASE, 0, NULL }, /* Aktiv Rutoken S */
{ "3b:6f:00:ff:00:56:75:61:54:6f:6b:6e:73:30:20:00:00:90:00", NULL, NULL, SC_CARD_TYPE_GENERIC_BASE, 0, NULL }, /* Aktiv uaToken S */
{ NULL, NULL, NULL, 0, 0, NULL }

View File

@ -60,7 +60,7 @@ struct sc_aid sc_hsm_aid = { { 0xE8,0x2B,0x06,0x01,0x04,0x01,0x81,0xC3,0x1F,0x02
/* Known ATRs for SmartCard-HSMs */
static struct sc_atr_table sc_hsm_atrs[] = {
static const struct sc_atr_table sc_hsm_atrs[] = {
/* standard version */
{"3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA", NULL, NULL, SC_CARD_TYPE_SC_HSM, 0, NULL},
{"3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18", NULL, NULL, SC_CARD_TYPE_SC_HSM, 0, NULL},

View File

@ -33,7 +33,7 @@
#define _FINEID_BROKEN_SELECT_FLAG 1
static struct sc_atr_table setcos_atrs[] = {
static const struct sc_atr_table setcos_atrs[] = {
/* some Nokia branded SC */
{ "3B:1F:11:00:67:80:42:46:49:53:45:10:52:66:FF:81:90:00", NULL, NULL, SC_CARD_TYPE_SETCOS_GENERIC, 0, NULL },
/* RSA SecurID 3100 */

View File

@ -31,7 +31,7 @@
#include "internal.h"
#include "iso7816.h"
static struct sc_atr_table starcos_atrs[] = {
static const struct sc_atr_table starcos_atrs[] = {
{ "3B:B7:94:00:c0:24:31:fe:65:53:50:4b:32:33:90:00:b4", NULL, NULL, SC_CARD_TYPE_STARCOS_GENERIC, 0, NULL },
{ "3B:B7:94:00:81:31:fe:65:53:50:4b:32:33:90:00:d1", NULL, NULL, SC_CARD_TYPE_STARCOS_GENERIC, 0, NULL },
{ "3b:b7:18:00:c0:3e:31:fe:65:53:50:4b:32:34:90:00:25", NULL, NULL, SC_CARD_TYPE_STARCOS_GENERIC, 0, NULL },

View File

@ -33,7 +33,7 @@
#include "asn1.h"
#include "cardctl.h"
static struct sc_atr_table tcos_atrs[] = {
static const struct sc_atr_table tcos_atrs[] = {
/* Infineon SLE44 */
{ "3B:BA:13:00:81:31:86:5D:00:64:05:0A:02:01:31:80:90:00:8B", NULL, NULL, SC_CARD_TYPE_TCOS_V2, 0, NULL },
/* Infineon SLE66S */

View File

@ -152,7 +152,7 @@ static int westcos_check_sw(sc_card_t * card, unsigned int sw1,
return iso_ops->check_sw(card, sw1, sw2);
}
static struct sc_atr_table westcos_atrs[] = {
static const struct sc_atr_table westcos_atrs[] = {
/* westcos 2ko */
{ "3F:69:00:00:00:64:01:00:00:00:80:90:00", "ff:ff:ff:ff:ff:ff:ff:00:00:00:f0:ff:ff", NULL, 0x00, 0, NULL },
/* westcos applet */