Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions openssl-dynamic/src/main/c/sslcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,11 @@ static int current_session_key(tcn_ssl_ctxt_t *c, tcn_ssl_ticket_key_t *key) {
apr_thread_rwlock_rdlock(c->mutex);
if (c->ticket_keys_len > 0) {
*key = c->ticket_keys[0];
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
// mac_params[0].data still points into the original ticket_keys array; repoint it at
// this copy's own hmac_key so it stays valid after the array is freed/replaced.
key->mac_params[0].data = key->hmac_key;
#endif
result = JNI_TRUE;
}
apr_thread_rwlock_unlock(c->mutex);
Expand All @@ -1323,6 +1328,11 @@ static int find_session_key(tcn_ssl_ctxt_t *c, unsigned char key_name[16], tcn_s
// Check if we have a match for tickets.
if (memcmp(c->ticket_keys[i].key_name, key_name, 16) == 0) {
*key = c->ticket_keys[i];
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
// mac_params[0].data still points into the original ticket_keys array; repoint it at
// this copy's own hmac_key so it stays valid after the array is freed/replaced.
key->mac_params[0].data = key->hmac_key;
#endif
result = JNI_TRUE;
*is_current_key = (i == 0);
break;
Expand Down
Loading