Closed cbroglie closed 5 years ago
Thanks for flagging this.
A straight-forward fix for this is to document that the actual number of sessions opened is one greater than MaxSessions
. Then we can drop the -1
from the offending code line.
@cbroglie Do you have any use cases where only 1 session is available? If so, we may need to more thoroughly redesign this part of the library to handle that case.
No, we haven't come across any HSMs which support exactly 1 session. Simply documenting the behavior would be fine for us.
Documentation updated. The library will also return an error rather than panicking now. Release 1.2.1 contains this fix.
If
MaxSessions
is set to 1, the following panic occurs:This is due to: