-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement all miekg/pkcs11 Ctx functions #7
Conversation
ddc455a
to
fc4d6e5
Compare
Hi. Sorry, totally forgot about making a MR for the changes I made. The changes have been pretty thoroughly tested. I just pushed the last bit of changes that we still outstanding. I needed to implement Trying to tidy up a last bit of my stuff before pushing what I have done with the library, but two main things are: If you give me a few days, I will try and get documentation together about how to test with miekg and softhsm. Test framework: |
No worries.
Ah, excellent!
Oh wow, those are quite exciting!
Yeah that sounds great. Thanks for all your work on this. |
@bernard-wagner Maybe I'm missing something obvious, but what's the origin of |
Miekg does not implement those, but they are part of the PKCS11 spec. https://www.cryptsoft.com/pkcs11doc/v220/group__SEC__11__2__CONVENTIONS__FOR__FUNCTIONS__RETURNING__OUTPUT__IN__A__VARIABLE__LENGTH__BUFFER.html Welcome to remove them again, but I needed to extend pkcs11.Ctx to work for all operations. |
Ah, I see, they're not separate functions in the PKCS11 spec, but rather a different usage of the same functions, which doesn't map to A quick search of Miek's repo suggests no one has suggested adding those. Would it be feasible to submit your |
https://github.com/bernard-wagner/pkcs11mod-testing Not cleanest solution, would be great if we can bring in the testing into the actual pkcs11mod package. |
@bernard-wagner Okay cool. Let's see, is it okay to split this PR into 2 PR's, with this PR not including the |
fc4d6e5
to
84c8751
Compare
Removed the additional Backend methods. Will need to consider how to test all the changes without the additional methods. |
@JeremyRand thoughts on the current state of the MR and possible testing plan solutions? |
@bernard-wagner Sorry for the delay on this. So here's a question. I'm not very familiar with the |
@JeremyRand this would be pretty tricky. For example, the behaviour of |
@bernard-wagner If I understand correctly, the problem is that passing the non-null variant of
AFAICT the behavior that the user sees should be end-to-end consistent regardless of whether pkcs11mod is in the middle. Am I missing something? |
@bernard-wagner I just gave this testing framework a quick glance-over, and it looks okay to me. I'd have no objection to adding that framework to pkcs11mod, maybe running on Cirrus CI. Can you update your testing repo to add the LGPLv3+ license, so that it can be added here without any conflicts? (I don't see any license on your repo right now, so it's technically All Rights Reserved.) |
This PR doesn't build with latest miekg/pkcs11 due to some minor cgo refactors that Miek made. I've fixed those errors, and also implemented the Null solution from #7 (comment) ; new PR is #31 . Closing this PR in favor of the new one. |
0ec8883 Cirrus: Add OpenDNSSEC tests (Jeremy Rand) 020e80f types: Add getOAEPSourceData (Jeremy Rand) 0a827eb types: Add getMechanismParam (Jeremy Rand) 5dc27f5 Improve Encrypt/Decrypt/Sign/Digest caching (Jeremy Rand) e71d391 Cache Encrypt/Decrypt/Sign/Digest instead of null passthrough (Jeremy Rand) 5fa53ee Implement all miekg/pkcs11 Ctx functions (Bernard Wagner) Pull request description: Refactorization of #7 Fixes #1 Top commit has no ACKs. Tree-SHA512: d2e0077ed013476c232d97d0b3eec723cee9a8d018df8a94e20f94c7efd99def8516367c7d8335f89dafb0e6aec4e05a5de60e4dbc1e337c1a8d462e25f562f5
I noticed today that @bernard-wagner forked this repo last year and added a bunch of missing functions from the pkcs11 spec. That's awesome! I'd really like to merge these changes, assuming they pass a cursory review. Bernard, can you comment on how well-tested these changes are? Are there any known issues that should give us pause in merging them? Is there a recommended way to test them? (Maybe with SoftHSM?) May I ask what you're using pkcs11mod for? (Always curious to hear what my code is being used for in the wild.)