From: "plaisthos (Code Review)" Date: Wed, 1 Apr 2026 11:54:53 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <29166cbd1c6d228805969a39730fe4ac8b3aa6ce-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ztNaW3f3Im8="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Do not access internals of ASN1_INTEGER to print hex of serial List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: flichtenheld , openvpn-devel --ztNaW3f3Im8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. plaisthos has posted comments on this change by plaisthos. ( http://gerrit.= openvpn.net/c/openvpn/+/1589?usp=3Demail ) Change subject: Do not access internals of ASN1_INTEGER to print hex of ser= ial ...................................................................... Patch Set 4: (1 comment) File src/openvpn/ssl_verify_openssl.c: http://gerrit.openvpn.net/c/openvpn/+/1589/comment/c7682b24_7bdda5a6?usp=3D= email : PS4, Line 320: char *ret =3D format_hex_ex(buf, len_serial, 0, 1, ":", = gc); > I changed this to use BN_bn2hex only to find out that then test fails sin= ce we have : in the output [=E2=80=A6] For reference the change with BN_bn2hex: /** Wrapper around OpenSSL_free * * Passing OPENSSL_free to gc_add_special does not work * since OPENSSL_free is a macro, so use this small wrapper * to allow passing this function instead */ static void opensl_free_wrapper(void *arg) { OPENSSL_free(arg); } char * backend_x509_get_serial_hex(openvpn_x509_cert_t *cert, struct gc_arena *gc) { const ASN1_INTEGER *asn1_i =3D X509_get_serialNumber(cert); BIGNUM *bn_serial =3D ASN1_INTEGER_to_BN(asn1_i, NULL); char *ret =3D BN_bn2hex(bn_serial); gc_addspecial(ret, opensl_free_wrapper, gc); BN_free(bn_serial); return ret; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1589?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: I5158fbb0762443ea4954e5745f520e83e019ed30 Gerrit-Change-Number: 1589 Gerrit-PatchSet: 4 Gerrit-Owner: plaisthos Gerrit-CC: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Wed, 01 Apr 2026 11:54:53 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: plaisthos Comment-In-Reply-To: flichtenheld --ztNaW3f3Im8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld.

View = Change

1 comment:

    =
  • File src/openvpn/ssl_verify_openssl= .c:

    • Pa= tch Set #4, Line 320: = char *ret =3D format_hex_ex(buf, len_serial, 0, 1, ":", gc);

      I changed this to use BN_bn2hex only to find out that = then test fails since we have : in the output [=E2=80=A6]

      =

      For reference the change with BN_bn2hex:

      /** Wrapper arou=
      nd OpenSSL_free
      *
      * Passing OPENSSL_free to gc_add_special does not= work
      * since OPENSSL_free is a macro, so use this small wrapper
      * = to allow passing this function instead */
      static void
      opensl_free_wra= pper(void *arg)
      {
      OPENSSL_free(arg);
      }

      = char *
      backend_x509_get_serial_hex(openvpn_x509_cert_t *cert, struct gc_= arena *gc)
      {
      const ASN1_INTEGER *asn1_i =3D X509_get_serialNumber= (cert);
      BIGNUM *bn_serial =3D ASN1_INTEGER_to_BN(asn1_i, NULL);
      = char *ret =3D BN_bn2hex(bn_serial);
          gc_addspecial=
      (ret, opensl_free_wrapper, gc);
      BN_free(bn_serial);
          return ret;
      }

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

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5158fbb0762443ea4954e5745f5= 20e83e019ed30
Gerrit-Change-Number: 1589
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-CC: flichtenheld <frank@...2641...&g= t;
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Wed, 01 Apr 2026 11:54:53= +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...>
= --ztNaW3f3Im8=--