diff --git a/src/libopensc/libopensc.exports b/src/libopensc/libopensc.exports index da6b074b..902b33e3 100644 --- a/src/libopensc/libopensc.exports +++ b/src/libopensc/libopensc.exports @@ -249,6 +249,7 @@ sc_pkcs15init_delete_object sc_pkcs15init_erase_card sc_pkcs15init_erase_card_recursively sc_pkcs15init_finalize_card +sc_pkcs15init_finalize_profile sc_pkcs15init_fixup_file sc_pkcs15init_generate_key sc_pkcs15init_get_asepcos_ops @@ -287,3 +288,4 @@ sc_pkcs15init_verify_secret sc_pkcs15init_sanity_check sc_card_find_rsa_alg sc_print_cache +sc_find_app diff --git a/src/libopensc/opensc.h b/src/libopensc/opensc.h index 6e421967..f8c27543 100644 --- a/src/libopensc/opensc.h +++ b/src/libopensc/opensc.h @@ -1148,6 +1148,7 @@ int sc_get_cache_dir(sc_context_t *ctx, char *buf, size_t bufsize); int sc_make_cache_dir(sc_context_t *ctx); int sc_enum_apps(sc_card_t *card); +struct sc_app_info *sc_find_app(struct sc_card *card, struct sc_aid *aid); void sc_free_apps(sc_card_t *card); int sc_parse_ef_atr(sc_card_t *card); void sc_free_ef_atr(sc_card_t *card); diff --git a/src/libopensc/pkcs15.c b/src/libopensc/pkcs15.c index 1bab39b5..9efe2f84 100644 --- a/src/libopensc/pkcs15.c +++ b/src/libopensc/pkcs15.c @@ -370,7 +370,6 @@ static int parse_ddo(struct sc_pkcs15_card *p15card, const u8 * buf, size_t bufl } if (asn1_ddo[5].flags & SC_ASN1_PRESENT) { sc_debug(ctx, SC_LOG_DEBUG_ASN1, "DDO.AID '%s'", sc_dump_hex(aid.value, aid.len)); - sc_debug(ctx, SC_LOG_DEBUG_ASN1, "p15card.app '%p'", p15card->app); memcpy(&p15card->app->ddo.aid, &aid, sizeof(struct sc_aid)); } @@ -675,10 +674,10 @@ void sc_pkcs15_card_clear(sc_pkcs15_card_t *p15card) } } -const sc_app_info_t * sc_find_app(sc_card_t *card, struct sc_aid *aid) +struct sc_app_info * sc_find_app(struct sc_card *card, struct sc_aid *aid) { int ii; - + if (card->app_count <= 0) return NULL; diff --git a/src/libopensc/sc.c b/src/libopensc/sc.c index b10a04af..34039743 100644 --- a/src/libopensc/sc.c +++ b/src/libopensc/sc.c @@ -303,7 +303,7 @@ int sc_path_print(char *buf, size_t buflen, const sc_path_t *path) for (i = 0; i < path->len; i++) snprintf(buf + strlen(buf), buflen - strlen(buf), "%02x", path->value[i]); - if (path->type == SC_PATH_TYPE_DF_NAME) + if (!path->aid.len && path->type == SC_PATH_TYPE_DF_NAME) snprintf(buf + strlen(buf), buflen - strlen(buf), "::"); return SC_SUCCESS; diff --git a/src/pkcs15init/authentic.profile b/src/pkcs15init/authentic.profile index 290de74c..c4748646 100644 --- a/src/pkcs15init/authentic.profile +++ b/src/pkcs15init/authentic.profile @@ -105,7 +105,8 @@ filesystem { } BSO template-private-key { - ACL = UPDATE=CHV1, DELETE=CHV1, PSO-DECRYPT=CHV1, INTERNAL-AUTHENTICATE=CHV1, GENERATE=CHV1, PSO-COMPUTE-SIGNATURE=NEVER; + ACL = UPDATE=CHV1, DELETE=CHV1; + ACL = PSO-DECRYPT=CHV1, INTERNAL-AUTHENTICATE=CHV1, GENERATE=CHV1, PSO-COMPUTE-SIGNATURE=NEVER; } BSO template-public-key {