nghttpx: Fix crash in SSL_CTX_set_tlsext_ticket_key_cb
It seems that returning 0 when enc == 0 crashes OpenSSL.
This commit is contained in:
parent
5dce9501a6
commit
5d3544185c
|
@ -465,7 +465,6 @@ void renew_ticket_key_cb(struct ev_loop *loop, ev_timer *w, int revents) {
|
||||||
if (LOG_ENABLED(INFO)) {
|
if (LOG_ENABLED(INFO)) {
|
||||||
LOG(INFO) << "failed to renew ticket key";
|
LOG(INFO) << "failed to renew ticket key";
|
||||||
}
|
}
|
||||||
mod_config()->ticket_keys.reset();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,8 +160,8 @@ int ticket_key_cb(SSL *ssl, unsigned char *key_name, unsigned char *iv,
|
||||||
#endif // NOTHREADS
|
#endif // NOTHREADS
|
||||||
|
|
||||||
if (!ticket_keys) {
|
if (!ticket_keys) {
|
||||||
/* No ticket keys available. Perform full handshake */
|
// No ticket keys available.
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &keys = ticket_keys->keys;
|
auto &keys = ticket_keys->keys;
|
||||||
|
@ -172,7 +172,7 @@ int ticket_key_cb(SSL *ssl, unsigned char *key_name, unsigned char *iv,
|
||||||
if (LOG_ENABLED(INFO)) {
|
if (LOG_ENABLED(INFO)) {
|
||||||
CLOG(INFO, handler) << "session ticket key: RAND_bytes failed";
|
CLOG(INFO, handler) << "session ticket key: RAND_bytes failed";
|
||||||
}
|
}
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &key = keys[0];
|
auto &key = keys[0];
|
||||||
|
|
Loading…
Reference in New Issue