-
Notifications
You must be signed in to change notification settings - Fork 20
Description
NSS expects to be able to store the state of hashing operations and then restore it later.
This is used to deal with the TLS transaction hash as the store/restore operation operates effectively like a context duplication in OpenSSL.
Ideally OpenSSL would provide a way to export the dgest state so we could actually save it, that request is tracked openssl/openssl#14222 but currently unimplemented.
So we'll need to address is in a different way unless we find the bandwidth to contribute a way to serialize data in OpenSSL.
One way is to re-implement digest functions so we can directly access and serialize the state ourselves.
A different way to approach this could be to hand on a session a list of "duplicated" contexts with a unique id, and when an application "restores" a context, we can search for the unique id, and duplicate again the OpenSSL context in the new session operation.
The reason why we'd hang these context on a session is that we need a way to free these OpenSSL contexts eventually.
This would allow simulating store/restore without having to leak memory completely, however if would depend on the original session to stay open until the restore operation is called.