Deleted Added
full compact
chap_ms.c (31343) chap_ms.c (31962)
1/*
2 * chap_ms.c - Microsoft MS-CHAP compatible implementation.
3 *
4 * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited.
5 * http://www.strataware.com/
6 *
7 * All rights reserved.
8 *

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

14 * by Eric Rosenquist. The name of the author may not be used to
15 * endorse or promote products derived from this software without
16 * specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 *
1/*
2 * chap_ms.c - Microsoft MS-CHAP compatible implementation.
3 *
4 * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited.
5 * http://www.strataware.com/
6 *
7 * All rights reserved.
8 *

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

14 * by Eric Rosenquist. The name of the author may not be used to
15 * endorse or promote products derived from this software without
16 * specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 * $Id: chap_ms.c,v 1.2 1997/10/26 01:02:20 brian Exp $
22 * $Id: chap_ms.c,v 1.3 1997/11/22 03:37:26 brian Exp $
23 *
24 */
25
26#include <sys/types.h>
27
28#include <des.h>
29#include <stdio.h>
30#include <string.h>

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

48static void DesEncrypt(u_char *, u_char *, u_char *);
49static void MakeKey(u_char *, u_char *);
50
51static void /* IN 8 octets IN 16 octets OUT 24 octets */
52ChallengeResponse(u_char *challenge, u_char *pwHash, u_char *response)
53{
54 char ZPasswordHash[21];
55
23 *
24 */
25
26#include <sys/types.h>
27
28#include <des.h>
29#include <stdio.h>
30#include <string.h>

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

48static void DesEncrypt(u_char *, u_char *, u_char *);
49static void MakeKey(u_char *, u_char *);
50
51static void /* IN 8 octets IN 16 octets OUT 24 octets */
52ChallengeResponse(u_char *challenge, u_char *pwHash, u_char *response)
53{
54 char ZPasswordHash[21];
55
56 memset(ZPasswordHash, '\0', sizeof(ZPasswordHash));
56 memset(ZPasswordHash, '\0', sizeof ZPasswordHash);
57 memcpy(ZPasswordHash, pwHash, 16);
58
59 DesEncrypt(challenge, ZPasswordHash + 0, response + 0);
60 DesEncrypt(challenge, ZPasswordHash + 7, response + 8);
61 DesEncrypt(challenge, ZPasswordHash + 14, response + 16);
62}
63
64static void /* IN 8 octets IN 7 octest OUT 8 octets */

--- 51 unchanged lines hidden ---
57 memcpy(ZPasswordHash, pwHash, 16);
58
59 DesEncrypt(challenge, ZPasswordHash + 0, response + 0);
60 DesEncrypt(challenge, ZPasswordHash + 7, response + 8);
61 DesEncrypt(challenge, ZPasswordHash + 14, response + 16);
62}
63
64static void /* IN 8 octets IN 7 octest OUT 8 octets */

--- 51 unchanged lines hidden ---