From 2eae5e70f5c2daeab1926141f5078d1405776650 Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Wed, 22 Aug 2018 17:54:42 +0300 Subject: [PATCH] Mark atr table argument as const in match_atr_table and _sc_match_atr functions This allows us to mark driver-specific atr tables as constants. --- src/libopensc/card.c | 4 ++-- src/libopensc/internal.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libopensc/card.c b/src/libopensc/card.c index 73532cc4..b4ab2395 100644 --- a/src/libopensc/card.c +++ b/src/libopensc/card.c @@ -1070,7 +1070,7 @@ sc_algorithm_info_t * sc_card_find_gostr3410_alg(sc_card_t *card, return sc_card_find_alg(card, SC_ALGORITHM_GOSTR3410, key_length, NULL); } -static int match_atr_table(sc_context_t *ctx, struct sc_atr_table *table, struct sc_atr *atr) +static int match_atr_table(sc_context_t *ctx, const struct sc_atr_table *table, struct sc_atr *atr) { u8 *card_atr_bin; size_t card_atr_bin_len; @@ -1133,7 +1133,7 @@ static int match_atr_table(sc_context_t *ctx, struct sc_atr_table *table, struct return -1; } -int _sc_match_atr(sc_card_t *card, struct sc_atr_table *table, int *type_out) +int _sc_match_atr(sc_card_t *card, const struct sc_atr_table *table, int *type_out) { int res; diff --git a/src/libopensc/internal.h b/src/libopensc/internal.h index 33f64cfe..9d6a77ff 100644 --- a/src/libopensc/internal.h +++ b/src/libopensc/internal.h @@ -125,7 +125,7 @@ scconf_block *_sc_match_atr_block(sc_context_t *ctx, struct sc_card_driver *driv /* Returns an index number if a match was found, -1 otherwise. table has to * be null terminated. */ -int _sc_match_atr(struct sc_card *card, struct sc_atr_table *table, int *type_out); +int _sc_match_atr(struct sc_card *card, const struct sc_atr_table *table, int *type_out); int _sc_card_add_algorithm(struct sc_card *card, const struct sc_algorithm_info *info); int _sc_card_add_symmetric_alg(sc_card_t *card, unsigned int algorithm,