Short answer: No, the OpenSSL library is not able to do this AS-IS. Long answer: 1) This would require serialization/deserialization of the SSL structure, which is opaque. The process is similar to how the SSL_SESSION is serialized in ssl/ssl_asn1.c, but is much more complicated. It requires internal knowledge of the handshake process and the SSL data structure. It can be done in a separate source file (i.e. there’s very little integration required with the rest of the system), but it’s fragile. I have done this in another job, and it took a while (months) to get right. 2) This would require both processes to have the exact same data, including private keys and even the random data stream. The second process could glean the connection, gathering most of this data, but it may still require additional information from the first process, which may not be exportable. (But see 3 below.) 3) I believe the symmetric keys can be exported, but I’m not sure it can be easily imported into OpenSSL. Even so, there’s A LOT more state involved, especially when transferring the connection between processes in the middle of the connection. This is trying to minimize the amount of data from 1, which is difficult. The exported keys are meant for tools that can decrypt a connection given the WHOLE data stream (and symmetric keys), but they are building the state as they process the data stream (e.g. Wireshark). The easiest out-of-the-box solution (i.e. no changes to OpenSSL or reliance on internal data structures) is to continue to decrypt in process 1, and use another encrypted back-haul connection from process 1 to process 2. Alternatively, another process (process 0) would accept and decrypt the connection and create separate encrypted back-haul connections to process 1 and process 2; depending on the data and algorithm requirements. If the goal here is to have process 1 be the protected public/private keystore from the data-processing process 2, then you might want to consider using your own Provider in process 2 to send data to process 1 for public/private key operations; not dissimilar to a SmartCard or other crypto hardware that stores keys. Option 2 above would not be viable here, as it would require both process 1 and 2 to have the public/private keypair.
--
-Todd Short // todd.short@xxxxxx // "One if by land, two if by sea, three if by the Internet."
|
Attachment:
signature.asc
Description: Message signed with OpenPGP