-
Notifications
You must be signed in to change notification settings - Fork 65
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Question: How to correctly handle a Session
#235
Comments
If there's one active this may be problematic 🤔 can you have a reference to the Session in your struct? CCing @baloo since they've also designed a RustCrypto wrapper around this. |
My unfinished prototype can be found here: #192 but essentially, my approach was for the signer to carry a
I don't think the thread-safety garantees or uniqueness of the session are defined at the spec level. I know the two implementation I worked with in the past had varying behavior. One of them you had to opt-in to have thread-safety. |
On my case, the Signer trait in defined insite |
Ack. But |
I get this error, but I'll check further
|
Hmm... sounds like it may need wrapping in an |
Unfortunately it's not, I could try to make a small example but it will take me some time. I tried to put Session in an Arc Mutex some time ago but I couldn't manage as Session isn't clonable |
Completely understandable 👍
Hmm... As far as I know neither Arc nor Mutex requires the thing to be cloneable? 🤔 (Arc has a |
I checked in Parsec and we open and close sessions just to perform one single operation. I think it's fine to open sessions in parallel but I think that the Login and Logout status of all sessions are affected at the same time |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi !
It's more a best practice question than an issue.
I have historical code which I'm updating from rust-pkcs11 to rust-cryptoki.
The usage of cryptoki is to extract certificates and sign some data but also implements the rustls
sign
capacity :What is be the best practice to handle a session here ?
Create a new one just inside this implementation while there is already one active in the function calling rustls ?
Thanks a lot for your feedback 🙏
The text was updated successfully, but these errors were encountered: