ppp: update to version 2.4.7.git-2019-10-04
[openwrt/openwrt.git] / package / network / services / ppp / patches / 201-mppe_mppc_1.1.patch
index 0bc42d448710b70911e8359e7b941503a673bfa9..bc1b69ebf1d5649dc3237d77a86344ebd94fc934 100644 (file)
@@ -3,7 +3,7 @@ pppd: add support for MPPE and MPPC encryption and compression protocols
 This is a forward ported version of ppp-2.4.3-mppe-mppc-1.1.patch.gz found on
 http://mppe-mppc.alphacron.de/ .
 
-Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
+Signed-off-by: Jo-Philipp Wich <jo@mein.io>
 
 --- a/include/linux/ppp-comp.h
 +++ b/include/linux/ppp-comp.h
@@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
   */
 --- a/pppd/ccp.c
 +++ b/pppd/ccp.c
-@@ -62,12 +62,10 @@ static int setdeflate __P((char **));
+@@ -61,12 +61,10 @@ static int setdeflate __P((char **));
  static char bsd_value[8];
  static char deflate_value[8];
  
@@ -104,7 +104,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  
  static option_t ccp_option_list[] = {
      { "noccp", o_bool, &ccp_protent.enabled_flag,
-@@ -108,54 +106,36 @@ static option_t ccp_option_list[] = {
+@@ -107,54 +105,36 @@ static option_t ccp_option_list[] = {
        "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
        &ccp_allowoptions[0].predictor_1 },
  
@@ -188,7 +188,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  #endif /* MPPE */
  
      { NULL }
-@@ -241,7 +221,7 @@ static fsm_callbacks ccp_callbacks = {
+@@ -240,7 +220,7 @@ static fsm_callbacks ccp_callbacks = {
   */
  #define ANY_COMPRESS(opt)     ((opt).deflate || (opt).bsd_compress \
                                 || (opt).predictor_1 || (opt).predictor_2 \
@@ -197,7 +197,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  
  /*
   * Local state (mainly for handling reset-reqs and reset-acks).
-@@ -344,6 +324,100 @@ setdeflate(argv)
+@@ -343,6 +323,100 @@ setdeflate(argv)
      return 1;
  }
  
@@ -298,7 +298,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  /*
   * ccp_init - initialize CCP.
   */
-@@ -378,6 +452,30 @@ ccp_init(unit)
+@@ -377,6 +451,30 @@ ccp_init(unit)
      ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
  
      ccp_allowoptions[0].predictor_1 = 1;
@@ -329,7 +329,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  }
  
  /*
-@@ -455,11 +553,11 @@ ccp_input(unit, p, len)
+@@ -454,11 +552,11 @@ ccp_input(unit, p, len)
      if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
        notice("Compression disabled by peer.");
  #ifdef MPPE
@@ -343,7 +343,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
      }
  
      /*
-@@ -487,6 +585,15 @@ ccp_extcode(f, code, id, p, len)
+@@ -486,6 +584,15 @@ ccp_extcode(f, code, id, p, len)
            break;
        /* send a reset-ack, which the transmitter will see and
           reset its compression state. */
@@ -359,7 +359,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
        fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
        break;
  
-@@ -515,12 +622,11 @@ ccp_protrej(unit)
+@@ -514,12 +621,11 @@ ccp_protrej(unit)
      fsm_lowerdown(&ccp_fsm[unit]);
  
  #ifdef MPPE
@@ -374,7 +374,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  }
  
  /*
-@@ -537,7 +643,7 @@ ccp_resetci(f)
+@@ -536,7 +642,7 @@ ccp_resetci(f)
      all_rejected[f->unit] = 0;
  
  #ifdef MPPE
@@ -383,7 +383,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
        ccp_options *ao = &ccp_allowoptions[f->unit];
        int auth_mschap_bits = auth_done[f->unit];
        int numbits;
-@@ -551,80 +657,109 @@ ccp_resetci(f)
+@@ -550,80 +656,109 @@ ccp_resetci(f)
         * NB: If MPPE is required, all other compression opts are invalid.
         *     So, we return right away if we can't do it.
         */
@@ -560,7 +560,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
        opt_buf[0] = CI_BSD_COMPRESS;
        opt_buf[1] = CILEN_BSD_COMPRESS;
 @@ -679,7 +814,8 @@ ccp_cilen(f)
-       + (go->deflate? CILEN_DEFLATE: 0)
+       + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
        + (go->predictor_1? CILEN_PREDICTOR_1: 0)
        + (go->predictor_2? CILEN_PREDICTOR_2: 0)
 -      + (go->mppe? CILEN_MPPE: 0);
@@ -1459,7 +1459,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
      bool deflate_draft;               /* use draft RFC code for deflate? */
 +    bool lzs;                 /* do Stac LZS? */
 +    bool mppc;                        /* do MPPC? */
-     bool mppe;                        /* do MPPE? */
+     u_char mppe;              /* MPPE bitfield */
 +    bool mppe_40;             /* allow 40 bit encryption? */
 +    bool mppe_56;             /* allow 56 bit encryption? */
 +    bool mppe_128;            /* allow 128 bit encryption? */
@@ -1473,7 +1473,7 @@ Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  
 --- a/pppd/chap_ms.c
 +++ b/pppd/chap_ms.c
-@@ -963,13 +963,17 @@ set_mppe_enc_types(int policy, int types
+@@ -962,13 +962,17 @@ set_mppe_enc_types(int policy, int types
      /*
       * Disable undesirable encryption types.  Note that we don't ENABLE
       * any encryption types, to avoid overriding manual configuration.