openssl/openssl — pull request #162 by indutny (2014-08-23 17:58:10+00:00)
Title: ssl: introduce async sign/decrypt APIs

This patch is introducing `async_key_ex_cb` member of both `SSL_CTX` and
`SSL`, and `SSL_supply()`. If `async_key_ex_cb` is present:

* Server will ignore dummy RSA key, assuming that it is matching the
certificate.
* Server will invoke this callback with either:
* `SSL_KEY_EX_RSA`
* `SSL_KEY_EX_RSA_SIGN`
as a `type` argument, and some data for signature or decryption in
`p`/`n` pair.

At that time the sign/decryption may be performed on any thread, or even
remotely, and the result should be supplied with `SSL_supply()`. Calling
`SSL_supply()` will continue the handshake process without even touching
the real private key.