Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p11-kit list-tokens: New subcommand #581

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

ueno
Copy link
Member

@ueno ueno commented Sep 30, 2023

This adds a new subcommand "list-tokens" to the p11-kit command, which
is similar to "list-modules" but only prints tokens. This would make
scripting tasks easier.

Fixes: #554

@coveralls
Copy link

coveralls commented Sep 30, 2023

Coverage Status

coverage: 69.334% (+0.08%) from 69.251% when pulling a502faa on ueno:wip/dueno/list-tokens into aedbab2 on p11-glue:master.

@ueno ueno force-pushed the wip/dueno/list-tokens branch 4 times, most recently from 8c746de to a502faa Compare October 3, 2023 19:33
@ueno ueno requested a review from ZoltanFridrich October 3, 2023 22:04
p11-kit/list-tokens.c Show resolved Hide resolved
p11-kit/list-tokens.c Outdated Show resolved Hide resolved
p11-kit/list-tokens.c Outdated Show resolved Hide resolved
p11-kit/list-tokens.c Outdated Show resolved Hide resolved
p11-kit/list-tokens.c Outdated Show resolved Hide resolved
This splits the logic to iterate over modules and tokens and print the
details into two functions: the iteration and printing of CK_INFO and
CK_TOKEN_INFO structures, so that the printing
function (print_token_info) can be used for `p11-kit list-tokens`.

This also makes slot listing more flexible to allow more than 256
slots.

Signed-off-by: Daiki Ueno <[email protected]>
@ueno ueno force-pushed the wip/dueno/list-tokens branch from a502faa to 6de40fc Compare October 4, 2023 08:13
@ueno ueno requested a review from ZoltanFridrich October 4, 2023 08:14
This adds a new subcommand "list-tokens" to the p11-kit command, which
is similar to "list-modules" but only prints tokens.  This would make
scripting tasks easier.

Signed-off-by: Daiki Ueno <[email protected]>
@ueno ueno force-pushed the wip/dueno/list-tokens branch from 6de40fc to c94d6fa Compare October 4, 2023 08:25
Copy link
Contributor

@ZoltanFridrich ZoltanFridrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ueno
Copy link
Member Author

ueno commented Oct 4, 2023

Thank you for the review!

@ueno ueno merged commit e2c9320 into p11-glue:master Oct 4, 2023
14 checks passed
@ZoltanFridrich ZoltanFridrich added this to the 0.25.1 milestone Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

p11-kit command: add means to list token information only
3 participants