nghttpx: Generate stateless reset secret

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-17 19:15:55 +09:00
parent 37bd9ffc48
commit fe4c6e4c56
1 changed files with 11 additions and 1 deletions

View File

@ -1549,7 +1549,17 @@ void fill_default_config(Config *config) {
}
auto &quicconf = config->quic;
{ quicconf.timeout.idle = 30_s; }
{
quicconf.timeout.idle = 30_s;
auto &stateless_resetconf = quicconf.stateless_reset;
// TODO Find better place to do this and error handling.
if (RAND_bytes(stateless_resetconf.secret.data(),
stateless_resetconf.secret.size()) != 1) {
LOG(FATAL) << "Unable to generate stateless reset secret";
exit(EXIT_FAILURE);
}
}
auto &loggingconf = config->logging;
{