SHOW_INT(tls_timeout);
- SHOW_INT(renegotiate_bytes);
- SHOW_INT(renegotiate_packets);
+ SHOW_INT64(renegotiate_bytes);
+ SHOW_INT64(renegotiate_packets);
SHOW_INT(renegotiate_seconds);
SHOW_INT(handshake_window);
else if (streq(p[0], "reneg-bytes") && p[1] && !p[2])
{
VERIFY_PERMISSION(OPT_P_TLS_PARMS);
- options->renegotiate_bytes = positive_atoi(p[1]);
+ char *end;
+ long long reneg_bytes = strtoll(p[1], &end, 10);
+ if (*end != '\0' || reneg_bytes < 0)
+ {
+ msg(msglevel, "--reneg-bytes parameter must be an integer and >= 0");
+ goto err;
+ }
+ options->renegotiate_bytes = reneg_bytes;
}
else if (streq(p[0], "reneg-pkts") && p[1] && !p[2])
{
VERIFY_PERMISSION(OPT_P_TLS_PARMS);
- options->renegotiate_packets = positive_atoi(p[1]);
+ char *end;
+ long long pkt_max = strtoll(p[1], &end, 10);
+ if (*end != '\0' || pkt_max < 0)
+ {
+ msg(msglevel, "--reneg-pkts parameter must be an integer and >= 0");
+ goto err;
+ }
+ options->renegotiate_packets = pkt_max;
}
else if (streq(p[0], "reneg-sec") && p[1] && !p[3])
{
int tls_timeout;
/* Data channel key renegotiation parameters */
- int renegotiate_bytes;
- int renegotiate_packets;
+ int64_t renegotiate_bytes;
+ int64_t renegotiate_packets;
int renegotiate_seconds;
int renegotiate_seconds_min;
* May *not* be NULL.
*/
static void
-tls_limit_reneg_bytes(const char *ciphername, int *reneg_bytes)
+tls_limit_reneg_bytes(const char *ciphername, int64_t *reneg_bytes)
{
if (cipher_kt_insecure(ciphername))
{
&& should_trigger_renegotiation(session, ks))
{
msg(D_TLS_DEBUG_LOW, "TLS: soft reset sec=%d/%d bytes=" counter_format
- "/%d pkts=" counter_format "/%d",
+ "/%" PRIi64 " pkts=" counter_format "/%" PRIi64,
(int) (now - ks->established), session->opt->renegotiate_seconds,
ks->n_bytes, session->opt->renegotiate_bytes,
ks->n_packets, session->opt->renegotiate_packets);
int transition_window;
int handshake_window;
interval_t packet_timeout;
- int renegotiate_bytes;
- int renegotiate_packets;
+ int64_t renegotiate_bytes;
+ int64_t renegotiate_packets;
interval_t renegotiate_seconds;
/* cert verification parms */