From: "syzzer (Code Review)" Date: Wed, 11 Dec 2024 21:15:40 +0000 In-Reply-To: References: Reply-To: steffan@...1856..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., max@...2606..., gert@...1296... Message-ID: <05b5a9d885a5d03e70028a4e30889007aea27df5-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="M7cVi9PJqN4="; 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: , To: plaisthos Cc: MaxF , flichtenheld , cron2 , openvpn-devel --M7cVi9PJqN4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: MaxF, cron2, flichtenheld, plaisthos. syzzer has posted comments on this change. ( http://gerrit.openvpn.net/c/op= envpn/+/796?usp=3Demail ) Change subject: Trigger renegotiation of data key if getting close to the A= EAD usage limit ...................................................................... Patch Set 12: Code-Review-1 (5 comments) Patchset: PS12: Looks good in general. Math checks out. Some minor nits and one fundamental= remark to consider. File src/openvpn/ssl.c: http://gerrit.openvpn.net/c/openvpn/+/796/comment/2fd3c45a_2a4cdbb4 : PS12, Line 144: /* set limit to 7/8 of the limit so the renogiation can= succeed before renegotiation http://gerrit.openvpn.net/c/openvpn/+/796/comment/a6fc21b4_8bd28a4d : PS12, Line 146: limit =3D limit * 7/8; Consider adding overflow checks. I know, unlikely, and doesn=C2=B4t result = in an unsafe situation, but if cipher_get_aead_limits at some point could r= eturn values close to 2**64, this calculation could result in very low limi= t values. http://gerrit.openvpn.net/c/openvpn/+/796/comment/7971040c_bac1d94b : PS12, Line 149: PRIi64 " for block and packets before renegotiation= ", This suggests a hard limit, but it's a soft limit we can (and typically wil= l) exceed. Without the 64-bit pid, we had a hard limit at 2**32-1. To be ab= le to claim we never exceed the real limit (the "8/8" value), we should con= sider adding a hard limit enforcement. http://gerrit.openvpn.net/c/openvpn/+/796/comment/502879b2_3c1a0f24 : PS12, Line 3027: || aead_usage_limit_reached(usage_limit, &key_ctx_= bi->decrypt, This is a safety precaution? The sending party is ultimately responsible fo= r not exceeding the limit of course. (But I admit, in practice this would l= ikely prevent buggy peers from exceeding the limit.) -- 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: 12 Gerrit-Owner: plaisthos Gerrit-Reviewer: MaxF Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: syzzer Gerrit-CC: cron2 Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-Attention: MaxF Gerrit-Comment-Date: Wed, 11 Dec 2024 21:15:40 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --M7cVi9PJqN4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: MaxF, cron2, flichtenheld, plaist= hos.

Patch set 12:Code-Review -1

V= iew Change

5 comments:

  • Patchset:

    • Patch Set #12:

      Looks good in general. Math checks out. Som= e minor nits and one fundamental remark to consider.

  • File src/openvpn/ssl.c:

    • Patch Set #12, Line 144: /* set limit to 7/8 of the l= imit so the renogiation can succeed before

      renegotiation

    • Patch S= et #12, Line 146: l= imit =3D limit * 7/8;

      Consider adding overflow checks. I know, unlikely, and does= n=C2=B4t result in an unsafe situation, but if cipher_get_aead_limits at so= me point could return values close to 2**64, this calculation could result = in very low limit values.

    • Patch Set #12, Line 149: PRIi64 " for bloc= k and packets before renegotiation",

      This suggests a hard limit, but it'= s a soft limit we can (and typically will) exceed. Without the 64-bit pid, = we had a hard limit at 2**32-1. To be able to claim we never exceed the rea= l limit (the "8/8" value), we should consider adding a hard limit= enforcement.

    • Patch Set #12, Line 3027: || aead_usage_limit_reached(usage= _limit, &key_ctx_bi->decrypt,

      This is a safety precaution? The sending par= ty is ultimately responsible for not exceeding the limit of course. (But I = admit, in practice this would likely prevent buggy peers from exceeding the= limit.)

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

<= /div>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I057f007577f10c6ac917ee4620e= e3d2559187dc7
Gerrit-Change-Number: 796
Gerrit-PatchSet: 12
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: MaxF <max@...2606...> <= /div>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: syzzer <steffan@...1856...= >
Gerrit-CC: cron2 <gert@...1296...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: cron2 <gert@...1296...>= ;
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: MaxF <max@...2606...> =
Gerrit-Comment-Date: Wed, 11 Dec 2024 21:15:40= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--M7cVi9PJqN4=--