oxidecomputer / offline-keystore

yubihsm-setup replacing the yubico cruft with our own cruft!
Mozilla Public License 2.0
10 stars 1 forks source link

Use session close function from oxide fork of yubihsm.rs. #193

Closed flihp closed 8 months ago

flihp commented 8 months ago

The Client type previously had a Drop implementation that closed the session if the Client had an open one. This seems to have caused problems in other downstream projects and was subsequently removed: https://github.com/iqlusioninc/tmkms/issues/37 https://github.com/iqlusioninc/yubihsm.rs/pull/265

The replacement was to provide a session() function that returns an Arc / MutexGuard wrapped reference to the optional session. This isn't useful for us here because we don't and AFAIK can't take ownership of the session which we need because the Sesison::close function consumes the session (it can't be reopened). Our solution requires an upstream change to the Client type adding a close_session function that just closes the session if one is open.

This resolves #190