Code Monkey home page Code Monkey logo

Comments (3)

mangodan2003 avatar mangodan2003 commented on July 18, 2024

Just adding that it seems to be the sum of data in each direction rather than an amount in one direction totalling ~100meg which leads to the hang. This is not a few odd times that by coincidence add up to this figure - it happens consistently for every single session.

e.g. it just hung with these stats after several hours of data in both directions

    RX packets 80669  bytes 63366673 (60.4 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 72866  bytes 47692318 (45.4 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Then doing a test with the majority of data incoming over the course of a few minutes (webcam stream):

    RX packets 86550  bytes 108562464 (103.5 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 46766  bytes 2486873 (2.3 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And a test with most data outgoing (file upload) :

    RX packets 45531  bytes 2587063 (2.4 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 83212  bytes 104402447 (99.5 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

from authy-openvpn.

mangodan2003 avatar mangodan2003 commented on July 18, 2024

Resolved - turns out an option not in the default config, but in the docs (tho inaccurate). reneg-bytes is supposed to be disabled by default but apparently it is not.
Adding this to the config gets me past 100meg :

reneg-bytes 0

Now to see if a similar limit exists for reneg-pkts ...

from authy-openvpn.

dsommers avatar dsommers commented on July 18, 2024

Extracts from a --verb 4 log on a test setup I have:

Wed Dec 21 18:18:02 2016 us=960278   renegotiate_bytes = -1
Wed Dec 21 18:18:02 2016 us=961046 OpenVPN 2.3.13 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Nov  3 2016

However ... if you are using a cipher with a block size less than 128 bits, it will default to --reneg-bytes 64MB (on the UDP/TCP socket), and that will be clearly identified in the log file as well as a big warning.

And some code segments to document my statement:

src/openvpn/ssl.c:

/**
 * Limit the reneg_bytes value when using a small-block (<128 bytes) cipher.
 *
 * @param cipher        The current cipher (may be NULL).
 * @param reneg_bytes   Pointer to the current reneg_bytes, updated if needed.
 *                      May *not* be NULL.
 */
static void
tls_limit_reneg_bytes(const cipher_kt_t *cipher, int *reneg_bytes)
{
    if (cipher && (cipher_kt_block_size(cipher) < 128/8))
    {
        if (*reneg_bytes == -1) /* Not user-specified */
        {
            msg(M_WARN, "WARNING: cipher with small block size in use, "
                "reducing reneg-bytes to 64MB to mitigate SWEET32 attacks.");
            *reneg_bytes = 64 * 1024 * 1024;
        }
    }
}

src/openvpn/ssl.c:2702

   /* Should we trigger a soft reset? -- new key, keeps old key for a while */
    if (ks->state >= S_ACTIVE
        && ((session->opt->renegotiate_seconds
             && now >= ks->established + session->opt->renegotiate_seconds)
            || (session->opt->renegotiate_bytes > 0
                && ks->n_bytes >= session->opt->renegotiate_bytes)
            || (session->opt->renegotiate_packets
                && ks->n_packets >= session->opt->renegotiate_packets)
            || (packet_id_close_to_wrapping(&ks->crypto_options.packet_id.send))))
    {
        msg(D_TLS_DEBUG_LOW,
            "TLS: soft reset sec=%d bytes=" counter_format "/%d pkts=" counter_format "/%d",
            (int)(ks->established + session->opt->renegotiate_seconds - now),
            ks->n_bytes, session->opt->renegotiate_bytes,
            ks->n_packets, session->opt->renegotiate_packets);
        key_state_soft_reset(session);
    }

Please post a complete --verb 4 log of what is happening next time.

(I will post the same to the OpenVPN trac ticket you opened as well)

from authy-openvpn.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.