-
Notifications
You must be signed in to change notification settings - Fork 45
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
Improve URI management #230
Conversation
@mouse07410 you may want to try this PR and execute:
This way you will see exactly what URI the pkcs11-provider reconstruct from looking at keys. |
Note that although I added support for recognizing these additional pkcs11 URI attributes:
At the moment they are ignored and can't be used to filter down keys. I am on the fence on whether I should allow all them to be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
Maybe notes regarding test coverage:
- the uri parsing functions would be grate candidate for some extensive unit tests
- can we have some automated tests with the
openssl storeutl
to check the reported uri as a whole is sensible?
Yeah, I will hold on merging until I have a test specific to URIs. |
I would go ahead with some corner cases, percent encoding, non-printable bytes when using the |
@Jakuje could @simo5 use the https://github.com/dengert/openssh-portable/blob/pkcs11-URI/regress/unittests/pkcs11/tests.c |
Sure. Thats a good idea. I would not say it is complete coverage or it is perfect, but it can be certainly used as a start or at least for ideas for some weird uris I could think of back in that time. |
CID 452340, CID 452341, CID 452342 Signed-off-by: Simo Sorce <simo@redhat.com>
Add all RFC defined attributes Signed-off-by: Simo Sorce <simo@redhat.com>
Any other parameter of the attribute is not appropriate to check if there is a valid value. Signed-off-by: Simo Sorce <simo@redhat.com>
This replaces showing just ID and Label on their own as it is a more useful tool to exactly identify a key for future use. Signed-off-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
We do not really have unit tests at this stage yet, mostly because the vast majority of the code requires a configured token to work at this time. So I'll add some testing just to make sure the convesion back and forth works. |
The OpenSSH and OpenSC sets up a virtual PIV token https://github.com/OpenSC/OpenSC/blob/master/.github/test-piv.sh @Jakuje is familiar with the OpenSC actions. I only look at them if something fails. |
Signed-off-by: Simo Sorce <simo@redhat.com>
@Jakuje I did what I could using just openssl storeutl as a proxy to probe URIs. Perhaps in future we'll be able to add more complete unit tests, but it looks fine for nopw, and this test will catch simple regressions. |
Signed-off-by: Simo Sorce <simo@redhat.com>
I think I am happy with this the way it is for now |
Overhaul how URI are parsed.
Add missing attributes specified in RFC 7512
Print URIs instead of ID/Label in text encoders