From: "plaisthos (Code Review)" Date: Tue, 7 Oct 2025 15:50:10 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641..., gert@...1296... Message-ID: <334f152f34aa95ea6819e4a33b0196f499fa7dfa-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ydUF9gFuEWM="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: multipeer: introduce asymmetric peer-id List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: its_Giaan Cc: flichtenheld , openvpn-devel --ydUF9gFuEWM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld, its_Giaan. plaisthos has posted comments on this change by its_Giaan. ( http://gerrit.= openvpn.net/c/openvpn/+/1089?usp=3Demail ) Change subject: multipeer: introduce asymmetric peer-id ...................................................................... Patch Set 4: Code-Review-2 (8 comments) Patchset: PS4: The part that picks the "peer-id" pushed and parsed options.c that sets pee= r-id on receiving peer-id if (found & OPT_P_PEER_ID) { msg(D_PUSH_DEBUG, "OPTIONS IMPORT: peer-id set"); c->c2.tls_multi->use_peer_id =3D true; c->c2.tls_multi->tx_peer_id =3D c->options.peer_id; } should probably also be adjusted to set both rx and tx as peer-id as pushed= option should set both. File src/openvpn/ssl.c: http://gerrit.openvpn.net/c/openvpn/+/1089/comment/7b89f526_1248648b?usp=3D= email : PS4, Line 1179: ret->rx_peer_id =3D MAX_PEER_ID; Add comment here that we also use the rx peer id to identify DCO clients as= this has become now a important distinction. http://gerrit.openvpn.net/c/openvpn/+/1089/comment/18e30fd6_0e66350f?usp=3D= email : PS4, Line 1982: } This is still not guarded by DCO capability. With the current version we st= ill always indicate to the peer that we are always asymmetric peer ID capab= le even if the underlying DCO module is not able to use a different peer ID= for TX. http://gerrit.openvpn.net/c/openvpn/+/1089/comment/3fb67b50_b42dfeaf?usp=3D= email : PS4, Line 2165: if (multi->rx_peer_id =3D=3D MAX_PEER_ID && session->op= t->mode !=3D MODE_SERVER) This feel be a very hacky place to set the multi rx peer id. I think there = is a better place to do that. File src/openvpn/ssl_ncp.c: http://gerrit.openvpn.net/c/openvpn/+/1089/comment/c5df3a60_53fab78f?usp=3D= email : PS4, Line 425: if (tx_peer_id) This also need to take DCO capability into account. http://gerrit.openvpn.net/c/openvpn/+/1089/comment/1a14b321_0b6cf1e1?usp=3D= email : PS4, Line 450: if (multi->use_peer_id) I think this parts needs to be skipped if we are using/negotiated asymmetri= c peer-id as it would overwrite both rx and tx ids with the EKM generated o= nes. Probably move the if (tx_peer_id) above and have this as else path wit= h a comment that asymmetric peer id trumps EKM File src/openvpn/ssl_util.h: http://gerrit.openvpn.net/c/openvpn/+/1089/comment/17f8e5bb_aeb5d80c?usp=3D= email : PS4, Line 56: uint32_t extract_asymmetric_peer_id(const char *peer_info); Add doxygen please File src/openvpn/ssl_util.c: http://gerrit.openvpn.net/c/openvpn/+/1089/comment/aa5446c4_405e7c5e?usp=3D= email : PS4, Line 90: return 0; 0 is a valid peer id. So I would rather have -1 (and int32_t as return type= ) or MAX_PEER_ID, MAX_UINT value or similar as not defined. In fact the first client that typically connects to a p2mp server is assign= ed value 0. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1089?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: I0a13ee90b6706acf20eabcee3bab3f2dff639bf9 Gerrit-Change-Number: 1089 Gerrit-PatchSet: 4 Gerrit-Owner: its_Giaan Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: its_Giaan Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Tue, 07 Oct 2025 15:50:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes --ydUF9gFuEWM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: cron2, flichtenheld, its_Giaan.

Patch set 4:Code-Review -2=

V= iew Change

8 comments:

  • Patchset:

    • Patch Set #4:

      The part t= hat picks the "peer-id" pushed and parsed options.c that sets pee= r-id on receiving peer-id

          if (found & OPT_P_PEER_I=
      D)
      {
      msg(D_PUSH_DEBUG, "OPTIONS IMPORT: peer-id set&= quot;);
      c->c2.tls_multi->use_peer_id =3D true;
      = c->c2.tls_multi->tx_peer_id =3D c->options.peer_id;
      }
      =

      should probably also be adjusted to set both rx and tx as peer-id = as pushed option should set both.

  • File src/openvpn/ssl.c:

    • Patch Set #4, Line 1179: ret->rx_peer_id =3D MAX_PEER_ID= ;

      Add comment here that we also use the rx peer id to identify D= CO clients as this has become now a important distinction.

    • Patch Set #4, Line 1982: }

      This is still not guarded by DCO capab= ility. With the current version we still always indicate to the peer that w= e are always asymmetric peer ID capable even if the underlying DCO module i= s not able to use a different peer ID for TX.

    • Patch Set #4, Line 2165: if (multi->rx_peer_id =3D=3D MAX_PEER_ID && session->o= pt->mode !=3D MODE_SERVER)

      This feel be a very hacky place to= set the multi rx peer id. I think there is a better place to do that.

      <= /li>
  • File src/openvpn/ssl_= ncp.c:

    • Patch Set #4, Line 425: if (tx_peer_id)

      This also need to take DCO capability into= account.

    • Patch Set #4, Line 450: if (multi->use_peer_id)=

      I think this parts needs to be skipped if we are using/negotiat= ed asymmetric peer-id as it would overwrite both rx and tx ids with the EKM= generated ones. Probably move the if (tx_peer_id) above and have this as e= lse path with a comment that asymmetric peer id trumps EKM

  • File src/openvpn/ssl_util.h:

    <= ul style=3D"list-style: none; padding: 0;">
  • Patch Set = #4, Line 56: uint32_t e= xtract_asymmetric_peer_id(const char *peer_info);

    Add doxygen pl= ease

  • File src/ope= nvpn/ssl_util.c:

    • Patch Set #4, Line 90: return 0;

      0 is a valid peer id. So I would rath= er have -1 (and int32_t as return type) or MAX_PEER_ID, MAX_UINT value or s= imilar as not defined.

      In fact the first client that typically connects= to a p2mp server is assigned value 0.

  • To view, v= isit cha= nge 1089. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: openvpn
    Gerrit-Branch: master
    Gerrit-Change-Id: I0a13ee90b6706acf20eabcee3ba= b3f2dff639bf9
    Gerrit-Change-Number: 1089
    Gerrit-PatchSet: 4
    Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
    Gerrit-Reviewer: cron2 <gert@...1296...>=
    Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
    Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
    Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
    Gerrit-Attention: its_Giaan <gianmarco@...1665...= 726...>
    Gerrit-Attention: cron2 <gert@...1296...>= ;
    Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
    Gerrit-Comment-Date: Tue, 07 Oct 2025 15:50:10= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    = --ydUF9gFuEWM=--