IASECC/CPX: set default flags
The CPX has the standard capabilities of the IASECC standard.
Let's be carefull with memory leakage, see the
previous commit 83162c5c8
Fix: issue #2270
This commit is contained in:
parent
4912f05701
commit
396cbc46cf
|
@ -630,22 +630,24 @@ static int
|
||||||
iasecc_init_cpx(struct sc_card *card)
|
iasecc_init_cpx(struct sc_card *card)
|
||||||
{
|
{
|
||||||
struct sc_context *ctx = card->ctx;
|
struct sc_context *ctx = card->ctx;
|
||||||
unsigned int flags; /* TBC it is not IASECC_CARD_DEFAULT_FLAGS */
|
unsigned int flags;
|
||||||
|
int rv = 0;
|
||||||
|
|
||||||
LOG_FUNC_CALLED(ctx);
|
LOG_FUNC_CALLED(ctx);
|
||||||
|
|
||||||
card->caps = SC_CARD_CAP_RNG; /* TBC it is not IASECC_CARD_DEFAULT_CAPS */
|
card->caps = IASECC_CARD_DEFAULT_CAPS;
|
||||||
|
|
||||||
flags = SC_ALGORITHM_RSA_PAD_PKCS1;
|
flags = IASECC_CARD_DEFAULT_FLAGS;
|
||||||
flags |= SC_ALGORITHM_RSA_RAW;
|
|
||||||
|
|
||||||
flags |= SC_ALGORITHM_RSA_HASH_SHA1 |
|
|
||||||
SC_ALGORITHM_RSA_HASH_SHA256;
|
|
||||||
|
|
||||||
_sc_card_add_rsa_alg(card, 512, flags, 0);
|
_sc_card_add_rsa_alg(card, 512, flags, 0);
|
||||||
_sc_card_add_rsa_alg(card, 1024, flags, 0);
|
_sc_card_add_rsa_alg(card, 1024, flags, 0);
|
||||||
_sc_card_add_rsa_alg(card, 2048, flags, 0);
|
_sc_card_add_rsa_alg(card, 2048, flags, 0);
|
||||||
|
|
||||||
|
rv = iasecc_parse_ef_atr(card);
|
||||||
|
if (rv)
|
||||||
|
sc_invalidate_cache(card); /* avoid memory leakage */
|
||||||
|
LOG_TEST_RET(ctx, rv, "Parse EF.ATR");
|
||||||
|
|
||||||
LOG_FUNC_RETURN(ctx, SC_SUCCESS);
|
LOG_FUNC_RETURN(ctx, SC_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue