From: "MaxF (Code Review)" Date: Wed, 20 Nov 2024 21:28:48 +0000 In-Reply-To: References: Reply-To: max@...2606..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <0a1ec4991ef92c812b75b2e4de699265939232e7-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="7C0hTuPcp00="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: Implement HKDF expand function based on RFC 8446 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --7C0hTuPcp00= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. MaxF has posted comments on this change. ( http://gerrit.openvpn.net/c/open= vpn/+/798?usp=3Demail ) Change subject: Implement HKDF expand function based on RFC 8446 ...................................................................... Patch Set 4: (1 comment) File src/openvpn/crypto_epoch.c: http://gerrit.openvpn.net/c/openvpn/+/798/comment/66b3a85e_5d30ac1a : PS4, Line 86: /* 2 byte for the outlen encoded as uint16, 5 bytes for "= ovpn " */ : int hkdf_label_len =3D 2 + 5 + label_len + context_len; : struct buffer hkdf_label =3D alloc_buf_gc(hkdf_label_len,= &gc); : : : buf_write_u16(&hkdf_label, out_len); : buf_write(&hkdf_label, "ovpn ", 5); : buf_write(&hkdf_label, label, label_len); : if (context_len > 0) : { : buf_write(&hkdf_label, context, context_len); : } > Hm, I know what you are saying, at the same time, TLS 1. [=E2=80=A6] TLS 1.3 does use length fields here, it's implied by the "opaque label<7..2= 55>" notation. You can look at the implementations in OpenSSL or mbed TLS. For example, se= e ssl_tls13_hkdf_encode_label() in https://github.com/Mbed-TLS/mbedtls/blob= /development/library/ssl_tls13_keys.c Removing the context argument and otherwise leaving the function as-is is f= ine. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/798?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: I3a1c6561f4d9a69e2a441d49dff620b4258a1bcc Gerrit-Change-Number: 798 Gerrit-PatchSet: 4 Gerrit-Owner: plaisthos Gerrit-Reviewer: MaxF Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Wed, 20 Nov 2024 21:28:48 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: plaisthos Comment-In-Reply-To: MaxF Gerrit-MessageType: comment --7C0hTuPcp00= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

View C= hange

1 comment:

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

    File src/openvpn/crypto_epoch.c:

    =
    • Patch Set #4, Line 86:=

          /* 2 byte for the outlen encoded as uint16, 5 bytes f=
      or "ovpn " */
      int hkdf_label_len =3D 2 + 5 + label_len + c= ontext_len;
      struct buffer hkdf_label =3D alloc_buf_gc(hkdf_label_len= , &gc);


      buf_write_u16(&hkdf_label, out_len);
      = buf_write(&hkdf_label, "ovpn ", 5);
      buf_write(&hkd= f_label, label, label_len);
      if (context_len > 0)
      {
      = buf_write(&hkdf_label, context, context_len);
      }

      Hm, I know what you are saying, at the same time,= TLS 1. [=E2=80=A6]

      TLS 1.3 does use length fields here, it's implied b= y the "opaque label<7..255>" notation.

      You can look at the implementatio= ns in OpenSSL or mbed TLS. For example, see ssl_tls13_hkdf_encode_label() i= n https://github.com/Mbed-TLS/mbedtls/blob/development/library/ssl_tls13_ke= ys.c

      Removing= the context argument and otherwise leaving the function as-is is fine.

      =

To view, visit change 798. To unsubscribe, or for help wr= iting mail filters, visit se= ttings.

<= div itemscope itemprop=3D"action" itemtype=3D"http://schema.org/ViewAction"= >
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I3a1c6561f4d9a69e2a441d49dff= 620b4258a1bcc
Gerrit-Change-Number: 798
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: MaxF <max@...2606...> <= /div>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Wed, 20 Nov 2024 21:28:48= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: plaisthos <arne-openvp= n@...1227...>
Comment-In-Reply-To: MaxF <max@...2606...&g= t;
Gerrit-MessageType: comment
--7C0hTuPcp00=--