| Hanno Becker | d5c9cc7 | 2021-05-24 11:12:43 +0100 | [diff] [blame] | 1 | SSL key export interface change |
| 2 | ------------------------------- |
| 3 | |
| 4 | This affects users of the SSL key export APIs: |
| 5 | ``` |
| 6 | mbedtls_ssl_conf_export_keys_cb() |
| 7 | mbedtls_ssl_conf_export_keys_ext_cb() |
| 8 | ``` |
| 9 | |
| Hanno Becker | 7e6c178 | 2021-06-08 09:24:55 +0100 | [diff] [blame] | 10 | Those APIs have been removed and replaced by the new API |
| 11 | `mbedtls_ssl_set_export_keys_cb()`. This API differs from |
| 12 | the previous key export API in the following ways: |
| 13 | |
| 14 | - It is no longer bound to an SSL configuration, but to an |
| 15 | SSL context. This allows users to more easily identify the |
| 16 | connection an exported key belongs to. |
| Hanno Becker | d5c9cc7 | 2021-05-24 11:12:43 +0100 | [diff] [blame] | 17 | - It no longer exports raw keys and IV. |
| 18 | - A secret type parameter has been added to identify which key |
| 19 | is being exported. For TLS 1.2, only the master secret is |
| 20 | exported, but upcoming TLS 1.3 support will add other kinds of keys. |
| Dave Rodgman | 5ec5003 | 2021-06-22 13:41:56 +0100 | [diff] [blame] | 21 | - The callback now specifies a void return type, rather than |
| 22 | returning an error code. It is the responsibility of the application |
| 23 | to handle failures in the key export callback, for example by |
| 24 | shutting down the TLS connection. |
| Hanno Becker | d5c9cc7 | 2021-05-24 11:12:43 +0100 | [diff] [blame] | 25 | |
| 26 | For users which do not rely on raw keys and IV, adjusting to the new |
| 27 | callback type should be straightforward - see the example programs |
| 28 | programs/ssl/ssl_client2 and programs/ssl/ssl_server2 for callbacks |
| 29 | for NSSKeylog, EAP-TLS and DTLS-SRTP. |
| 30 | |
| 31 | Users which require access to the raw keys used to secure application |
| 32 | traffic may derive those by hand based on the master secret and the |
| 33 | handshake transcript hashes which can be obtained from the raw data |
| 34 | on the wire. Such users are also encouraged to reach out to the |
| 35 | Mbed TLS team on the mailing list, to let the team know about their |
| 36 | use case. |