Ticket #268: 8225.patch

File 8225.patch, 4.1 KB (added by Samuli Seppänen, 9 years ago)

Git-am -style patch extracted from SVN using svnrev2git.py

  • version.m4

    From: James Yonan <james@openvpn.net>
    Date: mar, 25 set 2012 02:05:41 +0300
    Subject: [PATCH] On the client, allow certain peer info fields to be pushed even if
    
    push-peer-info isn't specified in the config.
    
    This is needed to allow the compression handshake to work
    correctly (i.e. where the client indicates its support for
    LZO and/or Snappy).
    
    Fields that have privacy implications such as Mac Address and
    UV_ * fields will not be pushed to the server as before unless
    push-peer-info is specified by client config.
    
    Version 2.1.21c
    
    ---
    
    a b  
    11dnl define the OpenVPN version
    2 define(PRODUCT_VERSION,[2.1.21b])
     2define(PRODUCT_VERSION,[2.1.21c])
    33dnl define the TAP version
    44define(PRODUCT_TAP_ID,[tap0901])
    55define(PRODUCT_TAP_WIN32_MIN_MAJOR,[9])
  • ssl.c

    a b  
    39073907  bool ret = false;
    39083908
    39093909#ifdef ENABLE_PUSH_PEER_INFO
    3910   if (session->opt->push_peer_info) /* write peer info */
    3911     {
    3912       struct env_set *es = session->opt->es;
    3913       struct env_item *e;
    3914       struct buffer out = alloc_buf_gc (512*3, &gc);
     3910  {
     3911    struct env_set *es = session->opt->es;
     3912    struct env_item *e;
     3913    struct buffer out = alloc_buf_gc (512*3, &gc);
    39153914
    3916       /* push version */
    3917       buf_printf (&out, "IV_VER=%s\n", PACKAGE_VERSION);
     3915    /* push version */
     3916    buf_printf (&out, "IV_VER=%s\n", PACKAGE_VERSION);
    39183917
    3919       /* push platform */
     3918    /* push platform */
    39203919#if defined(TARGET_LINUX)
    3921       buf_printf (&out, "IV_PLAT=linux\n");
     3920    buf_printf (&out, "IV_PLAT=linux\n");
    39223921#elif defined(TARGET_SOLARIS)
    3923       buf_printf (&out, "IV_PLAT=solaris\n");
     3922    buf_printf (&out, "IV_PLAT=solaris\n");
    39243923#elif defined(TARGET_OPENBSD)
    3925       buf_printf (&out, "IV_PLAT=openbsd\n");
     3924    buf_printf (&out, "IV_PLAT=openbsd\n");
    39263925#elif defined(TARGET_DARWIN)
    3927       buf_printf (&out, "IV_PLAT=mac\n");
     3926    buf_printf (&out, "IV_PLAT=mac\n");
    39283927#elif defined(TARGET_NETBSD)
    3929       buf_printf (&out, "IV_PLAT=netbsd\n");
     3928    buf_printf (&out, "IV_PLAT=netbsd\n");
    39303929#elif defined(TARGET_FREEBSD)
    3931       buf_printf (&out, "IV_PLAT=freebsd\n");
     3930    buf_printf (&out, "IV_PLAT=freebsd\n");
    39323931#elif defined(WIN32)
    3933       buf_printf (&out, "IV_PLAT=win\n");
     3932    buf_printf (&out, "IV_PLAT=win\n");
    39343933#endif
    39353934
    3936       /* push mac addr */
    3937       {
    3938         struct route_gateway_info rgi;
    3939         get_default_gateway (&rgi);
    3940         if (rgi.flags & RGI_HWADDR_DEFINED)
    3941           buf_printf (&out, "IV_HWADDR=%s\n", format_hex_ex (rgi.hwaddr, 6, 0, 1, ":", &gc));
    3942       }
    3943 
    3944       /* push compression status */
     3935    /* push compression status */
    39453936#ifdef USE_COMP
    3946       comp_generate_peer_info_string(&session->opt->comp_options, &out);
     3937    comp_generate_peer_info_string(&session->opt->comp_options, &out);
    39473938#endif
    39483939
    3949       /* push env vars that begin with UV_ */
    3950       for (e=es->list; e != NULL; e=e->next)
     3940    if (session->opt->push_peer_info)
     3941      {
     3942        /* push mac addr */
    39513943        {
    3952           if (e->string)
    3953             {
    3954               if (!strncmp(e->string, "UV_", 3) && buf_safe(&out, strlen(e->string)+1))
    3955                 buf_printf (&out, "%s\n", e->string);
    3956             }
     3944          struct route_gateway_info rgi;
     3945          get_default_gateway (&rgi);
     3946          if (rgi.flags & RGI_HWADDR_DEFINED)
     3947            buf_printf (&out, "IV_HWADDR=%s\n", format_hex_ex (rgi.hwaddr, 6, 0, 1, ":", &gc));
    39573948        }
    39583949
    3959       if (!write_string(buf, BSTR(&out), -1))
    3960         goto error;
    3961     }
    3962   else
     3950        /* push env vars that begin with UV_ */
     3951        for (e=es->list; e != NULL; e=e->next)
     3952          {
     3953            if (e->string)
     3954              {
     3955                if (!strncmp(e->string, "UV_", 3) && buf_safe(&out, strlen(e->string)+1))
     3956                  buf_printf (&out, "%s\n", e->string);
     3957              }
     3958          }
     3959      }
     3960
     3961    if (!write_string(buf, BSTR(&out), -1))
     3962      goto error;
     3963  }
     3964#else
     3965  {
     3966    if (!write_empty_string (buf)) /* no peer info */
     3967      goto error;
     3968  }
    39633969#endif
    3964     {
    3965       if (!write_empty_string (buf)) /* no peer info */
    3966         goto error;
    3967     }
    39683970  ret = true;
    39693971
    39703972 error: