Deleted Added
full compact
mppe.c (68344) mppe.c (68461)
1/*-
2 * Copyright (c) 2000 Semen Ustimenko <semenu@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2000 Semen Ustimenko <semenu@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/usr.sbin/ppp/mppe.c 68344 2000-11-05 03:25:09Z brian $
26 * $FreeBSD: head/usr.sbin/ppp/mppe.c 68461 2000-11-07 23:19:11Z brian $
27 */
28
29#include <sys/types.h>
30
31#include <stdio.h>
32#include <stdlib.h>
33#include <termios.h>
34#ifdef __FreeBSD__

--- 27 unchanged lines hidden (view full) ---

62 int keylen; /* 8 or 16 bytes */
63 int keybits; /* 40, 56 or 128 bits */
64 char sesskey[MPPE_KEY_LEN];
65 char mastkey[MPPE_KEY_LEN];
66 RC4_KEY rc4key;
67};
68
69int MPPE_MasterKeyValid = 0;
27 */
28
29#include <sys/types.h>
30
31#include <stdio.h>
32#include <stdlib.h>
33#include <termios.h>
34#ifdef __FreeBSD__

--- 27 unchanged lines hidden (view full) ---

62 int keylen; /* 8 or 16 bytes */
63 int keybits; /* 40, 56 or 128 bits */
64 char sesskey[MPPE_KEY_LEN];
65 char mastkey[MPPE_KEY_LEN];
66 RC4_KEY rc4key;
67};
68
69int MPPE_MasterKeyValid = 0;
70int MPPE_IsServer = 0;
70char MPPE_MasterKey[MPPE_KEY_LEN];
71
72static void
73MPPEResetOutput(void *v)
74{
75 log_Printf(LogCCP, "MPPE: Output channel reset\n");
76}
77

--- 257 unchanged lines hidden (view full) ---

335 mip->keybits = 56;
336 } else { /* 128-bits */
337 mip->keylen = 16;
338 mip->keybits = 128;
339 }
340
341 log_Printf(LogDEBUG, "MPPE: InitInput: %d-bits\n", mip->keybits);
342
71char MPPE_MasterKey[MPPE_KEY_LEN];
72
73static void
74MPPEResetOutput(void *v)
75{
76 log_Printf(LogCCP, "MPPE: Output channel reset\n");
77}
78

--- 257 unchanged lines hidden (view full) ---

336 mip->keybits = 56;
337 } else { /* 128-bits */
338 mip->keylen = 16;
339 mip->keybits = 128;
340 }
341
342 log_Printf(LogDEBUG, "MPPE: InitInput: %d-bits\n", mip->keybits);
343
343 GetAsymetricStartKey(MPPE_MasterKey, mip->mastkey, mip->keylen, 0, 0);
344 GetAsymetricStartKey(MPPE_MasterKey, mip->mastkey, mip->keylen, 0,
345 MPPE_IsServer);
344 GetNewKeyFromSHA(mip->mastkey, mip->mastkey, mip->keylen, mip->sesskey);
345
346 MPPEReduceSessionKey(mip);
347
348 MPPEKeyChange(mip);
349
350 mip->cohnum = 0;
351

--- 24 unchanged lines hidden (view full) ---

376 mop->keybits = 56;
377 } else { /* 128-bits */
378 mop->keylen = 16;
379 mop->keybits = 128;
380 }
381
382 log_Printf(LogDEBUG, "MPPE: InitOutput: %d-bits\n", mop->keybits);
383
346 GetNewKeyFromSHA(mip->mastkey, mip->mastkey, mip->keylen, mip->sesskey);
347
348 MPPEReduceSessionKey(mip);
349
350 MPPEKeyChange(mip);
351
352 mip->cohnum = 0;
353

--- 24 unchanged lines hidden (view full) ---

378 mop->keybits = 56;
379 } else { /* 128-bits */
380 mop->keylen = 16;
381 mop->keybits = 128;
382 }
383
384 log_Printf(LogDEBUG, "MPPE: InitOutput: %d-bits\n", mop->keybits);
385
384 GetAsymetricStartKey(MPPE_MasterKey, mop->mastkey, mop->keylen, 1, 0);
386 GetAsymetricStartKey(MPPE_MasterKey, mop->mastkey, mop->keylen, 1,
387 MPPE_IsServer);
385 GetNewKeyFromSHA(mop->mastkey, mop->mastkey, mop->keylen, mop->sesskey);
386
387 MPPEReduceSessionKey(mop);
388
389 MPPEKeyChange(mop);
390
391 mop->cohnum = 0;
392

--- 38 unchanged lines hidden ---
388 GetNewKeyFromSHA(mop->mastkey, mop->mastkey, mop->keylen, mop->sesskey);
389
390 MPPEReduceSessionKey(mop);
391
392 MPPEKeyChange(mop);
393
394 mop->cohnum = 0;
395

--- 38 unchanged lines hidden ---