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:
Tatsuhiro Tsujikawa 2015-01-08 20:46:35 +09:00
parent 5dce9501a6
commit 5d3544185c
2 changed files with 3 additions and 4 deletions

View File

@ -465,7 +465,6 @@ void renew_ticket_key_cb(struct ev_loop *loop, ev_timer *w, int revents) {
if (LOG_ENABLED(INFO)) {
LOG(INFO) << "failed to renew ticket key";
}
mod_config()->ticket_keys.reset();
return;
}

View File

@ -160,8 +160,8 @@ int ticket_key_cb(SSL *ssl, unsigned char *key_name, unsigned char *iv,
#endif // NOTHREADS
if (!ticket_keys) {
/* No ticket keys available. Perform full handshake */
return 0;
// No ticket keys available.
return -1;
}
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)) {
CLOG(INFO, handler) << "session ticket key: RAND_bytes failed";
}
return 0;
return -1;
}
auto &key = keys[0];