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

Detect if token is write protected #159

Merged
merged 1 commit into from
Jan 5, 2023
Merged

Detect if token is write protected #159

merged 1 commit into from
Jan 5, 2023

Conversation

simo5
Copy link
Member

@simo5 simo5 commented Jan 4, 2023

In which case return early and do not even try to login and go through operations that will fail.

In which case return early and do not even try to login and go through
operations that will fail.

Signed-off-by: Simo Sorce <[email protected]>
@simo5
Copy link
Member Author

simo5 commented Jan 4, 2023

@rjrelyea can you review?

Copy link
Collaborator

@beldmit beldmit left a comment

Choose a reason for hiding this comment

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

LGTM, but wonder how we can test it

@simo5
Copy link
Member Author

simo5 commented Jan 5, 2023

@beldmit NSS softokn by default always exposes two slots and one is always write protected because it is not intended for storing data, so this is implicitly tested in CI.

@simo5 simo5 merged commit 966f12a into latchset:main Jan 5, 2023
@rjrelyea
Copy link

rjrelyea commented Jan 6, 2023

Yes, it looks good. This will also return read only in softoken if the the DB's are openned read only. Also smart card are often read only as they are provisioned outside of PKCS #11, so this is a good general solution.

@simo5
Copy link
Member Author

simo5 commented Jan 7, 2023

Thanks Bob

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.

3 participants