From: "plaisthos (Code Review)" Date: Wed, 8 Apr 2026 02:07:43 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., selva.nair@...277..., luca.boccassi@...277..., openvpn-devel@lists.sourceforge.net Message-ID: <672d2ede8a4c03e93da1d35092fca59877616499-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="6bwFlXztKS0="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Add new helpers to handle key exchange (S_SENT_KEY/S_START) with larg... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bluca Cc: selvanair , openvpn-devel --6bwFlXztKS0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: Bluca, selvanair. plaisthos has posted comments on this change by Bluca. ( http://gerrit.open= vpn.net/c/openvpn/+/1622?usp=3Demail ) Change subject: Add new helpers to handle key exchange (S_SENT_KEY/S_START)= with large passwords ...................................................................... Patch Set 2: Code-Review-1 (5 comments) Patchset: PS2: I still do not agree with the approach as such but here are additional some= comments on the patch itself. File src/openvpn/common.h: http://gerrit.openvpn.net/c/openvpn/+/1622/comment/a14781fe_894ca37b?usp=3D= email : PS2, Line 76: * than the default TLS channel size (e.g. with ENABLE_PKCS11= ), So an OpenVPN compiled without --enable-pkcs11 gets a buffer of 2048 + 2 * = 128? That feels a bit odd. File src/openvpn/ssl.c: http://gerrit.openvpn.net/c/openvpn/+/1622/comment/a7bf99f1_be645d0f?usp=3D= email : PS2, Line 919: } there are other reasons why a handshake can fail at this point. Printing a = message that suggest that probably password is at fault can be misleading. http://gerrit.openvpn.net/c/openvpn/+/1622/comment/ffbce5ce_262ab2e5?usp=3D= email : PS2, Line 2645: * when long passwords/tokens are used. So this method will basically greedily read as many TLS records as there ar= e currently on the wire. This will make future improvements a lot harder wh= ere there are server/clients out there that basically ignore the framing an= d consider anything that is sent in the same batch to be part of the key me= thod. Even the original Microsoft patch does not do that. It still uses only one = TLS record (max 16kB) for key2 method. The correct approach here would be to try to read a whole TLS record (16 kB= ) and take whatever the SSL_read gives you as the key2 method and not doing= multiple smaller reads that break the assumption of TLS record framing tha= t OpenVPN (currently) uses. I am surprised that this did not already cause problems for you when the se= rver sends push reply immediately after its key2 write and this is being pu= t into the key packet. But maybe you never got such unlucky timing. http://gerrit.openvpn.net/c/openvpn/+/1622/comment/9a4c89e5_f09f9549?usp=3D= email : PS2, Line 2940: BLEN(&ks->key_method_send_buf) > TLS_CHANNEL_BU= F_SIZE; This can also be triggered by other methods like setting multiple setenv UV= _xx with push-peerinfo in the configuration and then the user will get the = error message iwth the long password above. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1622?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: comment Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I055c64ca8b23066e70eea7d7deddfb14f5354c5f Gerrit-Change-Number: 1622 Gerrit-PatchSet: 2 Gerrit-Owner: Bluca Gerrit-Reviewer: plaisthos Gerrit-Reviewer: selvanair Gerrit-CC: openvpn-devel Gerrit-Attention: Bluca Gerrit-Attention: selvanair Gerrit-Comment-Date: Wed, 08 Apr 2026 02:07:43 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes --6bwFlXztKS0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: Bluca, selvanair.

Patch set 2:Code-Review -1=

V= iew Change

5 comments:

  • Patchset:

    • Patch Set #2:

      I still do= not agree with the approach as such but here are additional some comments = on the patch itself.

  • File src/openvpn/common.h:

    • Patch Set #2, Line 76: * than the default TLS channel size (e.g. with EN= ABLE_PKCS11),

      So an OpenVPN compiled without --enable-pkcs11 get= s a buffer of 2048 + 2 * 128? That feels a bit odd.

  • File src/openvpn/ssl.c:

    • Patch Set #2, Line 919= : }

      ther= e are other reasons why a handshake can fail at this point. Printing a mess= age that suggest that probably password is at fault can be misleading.

      <= /li>
    • Patch Set #2, Line 2645: * when long passwords/tokens are used.<= /p>

      So this method will basically greedily read as many TLS records as ther= e are currently on the wire. This will make future improvements a lot harde= r where there are server/clients out there that basically ignore the framin= g and consider anything that is sent in the same batch to be part of the ke= y method.

      Even the original Microsoft patch does not do that. It still = uses only one TLS record (max 16kB) for key2 method.

      The correct appro= ach here would be to try to read a whole TLS record (16 kB) and take whatev= er the SSL_read gives you as the key2 method and not doing multiple smaller= reads that break the assumption of TLS record framing that OpenVPN (curren= tly) uses.

      I am surprised that this did not already cause problems for = you when the server sends push reply immediately after its key2 write and t= his is being put into the key packet. But maybe you never got such unlucky = timing.

    • Patch Set #2, Line 2940: BLEN(&ks->key_me= thod_send_buf) > TLS_CHANNEL_BUF_SIZE;

      This can also be trigg= ered by other methods like setting multiple setenv UV_xx with push-peerinfo= in the configuration and then the user will get the error message iwth the= long password above.

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

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I055c64ca8b23066e70eea7d7ded= dfb14f5354c5f
Gerrit-Change-Number: 1622
Gerrit-PatchSet: 2
Gerrit-Owner: Bluca <luca.boccassi@...1663...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-Reviewer: selvanair <selva.nair@...1665...= 77...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: Bluca <luca.boccassi@...1665...= 77...>
Gerrit-Attention: selvanair <selva.nair@...493...= 277...>
Gerrit-Comment-Date: Wed, 08 Apr 2026 02:07:43= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
= --6bwFlXztKS0=--