Skip to content

Commit 0e434a2

Browse files
committed
stub set tls ext ticket callbacks
The `SSL_CTX_set_tlsext_ticket_key_cb` and `SSL_CTX_set_tlsext_ticket_key_evp_cb` API functions can be used to set up callbacks for managing TLS session tickets. Implementing this properly will be challenging as they take `EVP_CIPHER_CTX` and `EVP_MAC_CTX` arguments and expect the caller to do a lot of the heavy-lifting. For now let's stub it and see how far we can get by just opaquely handling TLS session tickets internal to Rustls w/ our own ticketer.
1 parent 1b096a7 commit 0e434a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rustls-libssl/src/entry.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ entry! {
218218
C_INT_SUCCESS as c_long
219219
}
220220
Ok(SslCtrl::GetMaxProtoVersion) => ctx.get().get_max_protocol_version().into(),
221-
Ok(SslCtrl::SetTlsExtHostname) | Ok(SslCtrl::SetTlsExtServerNameCallback) => {
221+
Ok(SslCtrl::SetTlsExtHostname)
222+
| Ok(SslCtrl::SetTlsExtServerNameCallback)
223+
| Ok(SslCtrl::SetTlsExtTicketKeyCallback) => {
222224
// not a defined operation in the OpenSSL API
223225
0
224226
}
@@ -635,6 +637,10 @@ entry! {
635637
ctx.get_mut().set_servername_callback(fp);
636638
C_INT_SUCCESS as c_long
637639
}
640+
Ok(SslCtrl::SetTlsExtTicketKeyCallback) => {
641+
log::warn!("ignoring tls ext ticket key callback");
642+
C_INT_SUCCESS as c_long
643+
}
638644
_ => 0,
639645
}
640646
}
@@ -855,6 +861,7 @@ entry! {
855861
}
856862
// not a defined operation in the OpenSSL API
857863
Ok(SslCtrl::SetTlsExtServerNameCallback)
864+
| Ok(SslCtrl::SetTlsExtTicketKeyCallback)
858865
| Ok(SslCtrl::SetTlsExtServerNameArg)
859866
| Ok(SslCtrl::SetSessCacheSize)
860867
| Ok(SslCtrl::GetSessCacheSize)
@@ -1885,6 +1892,7 @@ num_enum! {
18851892
SetTlsExtServerNameCallback = 53,
18861893
SetTlsExtServerNameArg = 54,
18871894
SetTlsExtHostname = 55,
1895+
SetTlsExtTicketKeyCallback = 72,
18881896
SetChain = 88,
18891897
SetMinProtoVersion = 123,
18901898
SetMaxProtoVersion = 124,

0 commit comments

Comments
 (0)