1807a5caaSArchie Cobbs.\" Copyright (c) 1996-2000 Whistle Communications, Inc. 2807a5caaSArchie Cobbs.\" All rights reserved. 3807a5caaSArchie Cobbs.\" 4807a5caaSArchie Cobbs.\" Subject to the following obligations and disclaimer of warranty, use and 5807a5caaSArchie Cobbs.\" redistribution of this software, in source or object code forms, with or 6807a5caaSArchie Cobbs.\" without modifications are expressly permitted by Whistle Communications; 7807a5caaSArchie Cobbs.\" provided, however, that: 8807a5caaSArchie Cobbs.\" 1. Any and all reproductions of the source or object code must include the 9807a5caaSArchie Cobbs.\" copyright notice above and the following disclaimer of warranties; and 10807a5caaSArchie Cobbs.\" 2. No rights are granted, in any manner or form, to use Whistle 11807a5caaSArchie Cobbs.\" Communications, Inc. trademarks, including the mark "WHISTLE 12807a5caaSArchie Cobbs.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as 13807a5caaSArchie Cobbs.\" such appears in the above copyright notice or in the software. 14807a5caaSArchie Cobbs.\" 15807a5caaSArchie Cobbs.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 16807a5caaSArchie Cobbs.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 17807a5caaSArchie Cobbs.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 18807a5caaSArchie Cobbs.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 19807a5caaSArchie Cobbs.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 20807a5caaSArchie Cobbs.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 21807a5caaSArchie Cobbs.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 22807a5caaSArchie Cobbs.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 23807a5caaSArchie Cobbs.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 24807a5caaSArchie Cobbs.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 25807a5caaSArchie Cobbs.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 26807a5caaSArchie Cobbs.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 27807a5caaSArchie Cobbs.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 28807a5caaSArchie Cobbs.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29807a5caaSArchie Cobbs.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30807a5caaSArchie Cobbs.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 31807a5caaSArchie Cobbs.\" OF SUCH DAMAGE. 32807a5caaSArchie Cobbs.\" 33eddc45e7SJeroen Ruigrok van der Werven.\" Author: Archie Cobbs <archie@FreeBSD.org> 34807a5caaSArchie Cobbs.\" 35807a5caaSArchie Cobbs.\" $Whistle: ng_mppc.8,v 1.1 1999/12/08 20:20:39 archie Exp $ 36807a5caaSArchie Cobbs.\" 37*3707d4d3SPedro F. Giffuni.Dd June 7, 2016 38bec35b9aSArchie Cobbs.Dt NG_MPPC 4 393d45e180SRuslan Ermilov.Os 40807a5caaSArchie Cobbs.Sh NAME 41807a5caaSArchie Cobbs.Nm ng_mppc 42807a5caaSArchie Cobbs.Nd Microsoft MPPC/MPPE compression and encryption netgraph node type 43807a5caaSArchie Cobbs.Sh SYNOPSIS 4432eef9aeSRuslan Ermilov.In sys/types.h 4532eef9aeSRuslan Ermilov.In netgraph/ng_mppc.h 46807a5caaSArchie Cobbs.Sh DESCRIPTION 47807a5caaSArchie CobbsThe 48807a5caaSArchie Cobbs.Nm mppc 49807a5caaSArchie Cobbsnode type implements the Microsoft Point-to-Point Compression (MPPC) 50807a5caaSArchie Cobbsand Microsoft Point-to-Point Encryption (MPPE) sub-protocols of 51807a5caaSArchie Cobbsthe PPP protocol. 52807a5caaSArchie CobbsThese protocols are often used in conjunction with the Point-to-Point 53807a5caaSArchie CobbsTunneling Protocol (PPTP). 54807a5caaSArchie Cobbs.Pp 55807a5caaSArchie CobbsThe node has two hooks, 56807a5caaSArchie Cobbs.Dv "comp" 57807a5caaSArchie Cobbsfor compression and 58807a5caaSArchie Cobbs.Dv "decomp" 59807a5caaSArchie Cobbsfor decompression. 60807a5caaSArchie CobbsTypically one or both of these hooks would be connected to the 61bec35b9aSArchie Cobbs.Xr ng_ppp 4 62807a5caaSArchie Cobbsnode type hook of the same name. 63807a5caaSArchie CobbsEach direction of traffic flow is independent of the other. 64807a5caaSArchie Cobbs.Sh HOOKS 65807a5caaSArchie CobbsThis node type supports the following hooks: 66c60bda17SJoel Dahl.Bl -tag -width ".Va decomp" 67c60bda17SJoel Dahl.It Va comp 68807a5caaSArchie CobbsConnection to 69bec35b9aSArchie Cobbs.Xr ng_ppp 4 70807a5caaSArchie Cobbs.Dv "comp" 71807a5caaSArchie Cobbshook. 72807a5caaSArchie CobbsIncoming frames are compressed and/or encrypted, and sent 73807a5caaSArchie Cobbsback out the same hook. 74c60bda17SJoel Dahl.It Va decomp 75807a5caaSArchie CobbsConnection to 76bec35b9aSArchie Cobbs.Xr ng_ppp 4 77807a5caaSArchie Cobbs.Dv "decomp" 78807a5caaSArchie Cobbshook. 79807a5caaSArchie CobbsIncoming frames are decompressed and/or decrypted, and sent 80807a5caaSArchie Cobbsback out the same hook. 81807a5caaSArchie Cobbs.El 82807a5caaSArchie Cobbs.Sh CONTROL MESSAGES 83807a5caaSArchie CobbsThis node type supports the generic control messages, plus the following: 84807a5caaSArchie Cobbs.Bl -tag -width foo 85807a5caaSArchie Cobbs.It Dv NGM_MPPC_CONFIG_COMP 86807a5caaSArchie CobbsThis command resets and configures the node for a session in the 87807a5caaSArchie Cobbsoutgoing traffic direction (i.e., for compression and/or encryption). 88807a5caaSArchie CobbsThis command takes a 89807a5caaSArchie Cobbs.Dv "struct ng_mppc_config" 90807a5caaSArchie Cobbsas an argument: 913f610476SRuslan Ermilov.Bd -literal -offset 0n 92807a5caaSArchie Cobbs/* Length of MPPE key */ 93807a5caaSArchie Cobbs#define MPPE_KEY_LEN 16 94807a5caaSArchie Cobbs 95807a5caaSArchie Cobbs/* MPPC/MPPE PPP negotiation bits */ 96807a5caaSArchie Cobbs#define MPPC_BIT 0x00000001 /* mppc compression bits */ 97807a5caaSArchie Cobbs#define MPPE_40 0x00000020 /* use 40 bit key */ 98b051f615SArchie Cobbs#define MPPE_56 0x00000080 /* use 56 bit key */ 99807a5caaSArchie Cobbs#define MPPE_128 0x00000040 /* use 128 bit key */ 100b051f615SArchie Cobbs#define MPPE_BITS 0x000000e0 /* mppe encryption bits */ 101807a5caaSArchie Cobbs#define MPPE_STATELESS 0x01000000 /* use stateless mode */ 102b051f615SArchie Cobbs#define MPPC_VALID_BITS 0x010000e1 /* possibly valid bits */ 103807a5caaSArchie Cobbs 104807a5caaSArchie Cobbs/* Configuration for a session */ 105807a5caaSArchie Cobbsstruct ng_mppc_config { 106807a5caaSArchie Cobbs u_char enable; /* enable */ 1076b99842aSEd Schouten uint32_t bits; /* config bits */ 108807a5caaSArchie Cobbs u_char startkey[MPPE_KEY_LEN]; /* start key */ 109807a5caaSArchie Cobbs}; 110807a5caaSArchie Cobbs 111807a5caaSArchie Cobbs.Ed 112807a5caaSArchie CobbsThe 113807a5caaSArchie Cobbs.Dv enabled 114807a5caaSArchie Cobbsfield enables traffic flow through the node. 115807a5caaSArchie CobbsThe 116807a5caaSArchie Cobbs.Dv bits 117807a5caaSArchie Cobbsfield contains the bits as negotiated by the Compression Control Protocol 118807a5caaSArchie Cobbs(CCP) in PPP. 119807a5caaSArchie CobbsThe 120807a5caaSArchie Cobbs.Dv startkey 121807a5caaSArchie Cobbsis only necessary if MPPE was negotiated, and must be equal to the 122807a5caaSArchie Cobbssession start key as defined for MPPE. 123807a5caaSArchie CobbsThis key is based on the MS-CHAP credentials used at link authentication time. 124807a5caaSArchie Cobbs.It Dv NGM_MPPC_CONFIG_DECOMP 125807a5caaSArchie CobbsThis command resets and configures the node for a session in the 126807a5caaSArchie Cobbsincoming traffic direction (i.e., for decompression and/or decryption). 127807a5caaSArchie CobbsThis command takes a 128807a5caaSArchie Cobbs.Dv "struct ng_mppc_config" 129807a5caaSArchie Cobbsas an argument. 130807a5caaSArchie Cobbs.It Dv NGM_MPPC_RESETREQ 131807a5caaSArchie CobbsThis message contains no arguments, and is bi-directional. 132807a5caaSArchie CobbsIf an error is detected during decompression, this message is sent by the 133807a5caaSArchie Cobbsnode to the originator of the 134807a5caaSArchie Cobbs.Dv NGM_MPPC_CONFIG_DECOMP 135807a5caaSArchie Cobbsmessage that initiated the session. 136807a5caaSArchie CobbsThe receiver should respond by sending a PPP CCP Reset-Request to the peer. 137807a5caaSArchie Cobbs.Pp 138807a5caaSArchie CobbsThis message may also be received by this node type when a CCP Reset-Request 139807a5caaSArchie Cobbsis received by the local PPP entity. 140807a5caaSArchie CobbsThe node will respond by flushing its outgoing compression and encryption 141807a5caaSArchie Cobbsstate so the remote side can resynchronize. 142807a5caaSArchie Cobbs.El 143807a5caaSArchie Cobbs.Sh SHUTDOWN 144807a5caaSArchie CobbsThis node shuts down upon receipt of a 145807a5caaSArchie Cobbs.Dv NGM_SHUTDOWN 146807a5caaSArchie Cobbscontrol message, or when both hooks have been disconnected. 147807a5caaSArchie Cobbs.Sh COMPILATION 148807a5caaSArchie CobbsThe kernel options 149807a5caaSArchie Cobbs.Dv NETGRAPH_MPPC_COMPRESSION 150807a5caaSArchie Cobbsand 151807a5caaSArchie Cobbs.Dv NETGRAPH_MPPC_ENCRYPTION 152807a5caaSArchie Cobbsare supplied to selectively compile in either or both capabilities. 153807a5caaSArchie CobbsAt least one of these must be defined, or else this node type is useless. 154807a5caaSArchie Cobbs.Sh SEE ALSO 155807a5caaSArchie Cobbs.Xr netgraph 4 , 156bec35b9aSArchie Cobbs.Xr ng_ppp 4 , 157807a5caaSArchie Cobbs.Xr ngctl 8 158807a5caaSArchie Cobbs.Rs 159807a5caaSArchie Cobbs.%A G. Pall 160807a5caaSArchie Cobbs.%T "Microsoft Point-To-Point Compression (MPPC) Protocol" 161807a5caaSArchie Cobbs.%O RFC 2118 162807a5caaSArchie Cobbs.Re 163807a5caaSArchie Cobbs.Rs 164807a5caaSArchie Cobbs.%A G. S. Pall 165807a5caaSArchie Cobbs.%A G. Zorn 166807a5caaSArchie Cobbs.%T "Microsoft Point-To-Point Encryption (MPPE) Protocol" 167807a5caaSArchie Cobbs.%O draft-ietf-pppext-mppe-04.txt 168807a5caaSArchie Cobbs.Re 169807a5caaSArchie Cobbs.Rs 170807a5caaSArchie Cobbs.%A K. Hamzeh 171807a5caaSArchie Cobbs.%A G. Pall 172807a5caaSArchie Cobbs.%A W. Verthein 173807a5caaSArchie Cobbs.%A J. Taarud 174807a5caaSArchie Cobbs.%A W. Little 175807a5caaSArchie Cobbs.%A G. Zorn 176807a5caaSArchie Cobbs.%T "Point-to-Point Tunneling Protocol (PPTP)" 177807a5caaSArchie Cobbs.%O RFC 2637 178807a5caaSArchie Cobbs.Re 17912aef8b7SArchie Cobbs.Sh AUTHORS 1806c899950SBaptiste Daroussin.An Archie Cobbs Aq Mt archie@FreeBSD.org 1819cbda590SRuslan Ermilov.Sh BUGS 1829cbda590SRuslan ErmilovIn PPP, encryption should be handled by the Encryption Control Protocol (ECP) 1839cbda590SRuslan Ermilovrather than CCP. 1849cbda590SRuslan ErmilovHowever, Microsoft combined both compression and encryption into their 1859cbda590SRuslan Ermilov``compression'' algorithm, which is confusing. 186