From: "plaisthos (Code Review)" Date: Thu, 28 Nov 2024 19:02:02 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., gert@...1296... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="6oOGxlRqsaw="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Trigger renegotiation of data key if getting close to the AEAD usage ... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: flichtenheld , cron2 , openvpn-devel --6oOGxlRqsaw= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld. plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c= /openvpn/+/796?usp=3Demail ) Change subject: Trigger renegotiation of data key if getting close to the A= EAD usage limit ...................................................................... Patch Set 7: (9 comments) Commit Message: http://gerrit.openvpn.net/c/openvpn/+/796/comment/afd7f3b3_34658dc4 : PS6, Line 50: Change-Id: I057f007577f10c6ac917ee4620ee3d2559187dc7 > That is a good question, some that post commit script did some nonsense, = I will try to figure out wh [=E2=80=A6] Done File src/openvpn/crypto.h: http://gerrit.openvpn.net/c/openvpn/+/796/comment/424ddba6_d7884def : PS6, Line 603: * number of number of block + packets. Return -1 if ciphern= ame is not an AEAD > "blocks" Done File src/openvpn/crypto.c: http://gerrit.openvpn.net/c/openvpn/+/796/comment/734aa10c_22eb3343 : PS6, Line 353: * q + s <=3D (p^36 - 1) > `2^36` Done http://gerrit.openvpn.net/c/openvpn/+/796/comment/827f411c_2ae94fdb : PS6, Line 502: /* update number of plaintext blocks decrypted. Use the = x + (n-1)/n trick > Should be `(x + (n-1))/n`. The code is correct, but comment is wrong. Done http://gerrit.openvpn.net/c/openvpn/+/796/comment/eaad6627_493699fa : PS6, Line 503: * to round up the result to the number of blocked used.= */ > "blocks" Done http://gerrit.openvpn.net/c/openvpn/+/796/comment/c3a09ead_b2f38a1c : PS6, Line 505: opt->key_ctx_bi.decrypt.plaintext_blocks +=3D (outlen + = (blocksize - 1))/blocksize; > So we increase this number before we have done all checks on the packet. = [=E2=80=A6] thanks good catch. File src/openvpn/ssl.c: http://gerrit.openvpn.net/c/openvpn/+/796/comment/e2fcb49b_de363156 : PS6, Line 144: /* set limit to 7/8 of the limit so the renogiation has = can succeeds before > "renegotiation can succeed" ? Acknowledged File src/openvpn/ssl_common.h: http://gerrit.openvpn.net/c/openvpn/+/796/comment/c98780b7_0c3c5759 : PS6, Line 336: /** This limit for AEAD cipher, this is the sum of packe= ts + blocks > "This" -> "The"? Or maybe just remove it? Done File tests/unit_tests/openvpn/test_crypto.c: http://gerrit.openvpn.net/c/openvpn/+/796/comment/918d7aea_2d1e7962 : PS6, Line 463: int64_t L =3D 101; > Please mention or use AEAD_LIMIT_BLOCKSIZE Done -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/796?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I057f007577f10c6ac917ee4620ee3d2559187dc7 Gerrit-Change-Number: 796 Gerrit-PatchSet: 7 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: cron2 Gerrit-CC: openvpn-devel Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Thu, 28 Nov 2024 19:02:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: plaisthos Comment-In-Reply-To: flichtenheld Gerrit-MessageType: comment --6oOGxlRqsaw= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, flichtenheld.

View C= hange

9 comments:

    =
  • Commit Message:

    • <= p style=3D"margin-bottom: 4px;">Patch Set #6, Line 50: Change-Id: I057f007577f10c6ac917ee4620= ee3d2559187dc7

      That is a good question, some that pos= t commit script did some nonsense, I will try to figure out wh [=E2=80=A6]<= /blockquote>

      = Done

  • File src/ope= nvpn/crypto.h:

  • File src/openvpn/crypto.c:

    • Patch Set #6, Line 353: * q + s <=3D (p^36 - = 1)

      `2^36`

      Done

    • Patch Set #6, Line 50= 2: /* update number= of plaintext blocks decrypted. Use the x + (n-1)/n trick

      Should be `(x + (n-1))/n`. The code is correct, but comment is wrong.<= /blockquote>

      = Done

    • Patch Set #6, Line 503: * to round up the result to the number of block= ed used. */

      "blocks"

      Done

    • = Patch Set #6, Line 505: opt->key_ctx_bi.decrypt.plaintext_blocks +=3D (outlen + (blocksize = - 1))/blocksize;

      So we increase this number before we= have done all checks on the packet. [=E2=80=A6]

      thanks good catch.

  • File src/openvpn/ssl.c= :

    • Patch Set #6, Lin= e 144: /* set limit= to 7/8 of the limit so the renogiation has can succeeds before

      <= p>
      "renegotiation can succeed" ?

      Acknowledged

    • File src/openvpn/ssl_common.= h:

      • Patch Set #6, Li= ne 336: /** This li= mit for AEAD cipher, this is the sum of packets + blocks

        "This" -> "The"? Or maybe just remove it?

        Done

    • File tests/unit_te= sts/openvpn/test_crypto.c:

        <= li style=3D"margin: 0; padding: 0 0 0 16px;">

        Patch Set #6, Line 463: int64_t L =3D 101;

        Please mention or use= AEAD_LIMIT_BLOCKSIZE

        Done

    To view, visit change 796. = To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: openvpn
    Gerrit-Branch: master
    Gerrit-Change-Id: I057f007577f10c6ac917ee4620e= e3d2559187dc7
    Gerrit-Change-Number: 796
    Gerrit-PatchSet: 7
    Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
    Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
    Gerrit-CC: cron2 <gert@...1296...>
    Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
    Gerrit-Attention: cron2 <gert@...1296...>= ;
    Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
    Gerrit-Comment-Date: Thu, 28 Nov 2024 19:02:02= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: plaisthos <arne-openvp= n@...1227...>
    Comment-In-Reply-To: flichtenheld <frank@...1186...= .2641...>
    Gerrit-MessageType: comment
    --6oOGxlRqsaw=--