Skip to content

Add support for (re)storing state for Digest operations #349

@simo5

Description

@simo5

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions