10f8e0938SBrian Somers /* 20f8e0938SBrian Somers * chap.h - Cryptographic Handshake Authentication Protocol definitions. 30f8e0938SBrian Somers * 40f8e0938SBrian Somers * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited. 50f8e0938SBrian Somers * http://www.strataware.com/ 60f8e0938SBrian Somers * 70f8e0938SBrian Somers * All rights reserved. 80f8e0938SBrian Somers * 90f8e0938SBrian Somers * Redistribution and use in source and binary forms are permitted 100f8e0938SBrian Somers * provided that the above copyright notice and this paragraph are 110f8e0938SBrian Somers * duplicated in all such forms and that any documentation, 120f8e0938SBrian Somers * advertising materials, and other materials related to such 130f8e0938SBrian Somers * distribution and use acknowledge that the software was developed 140f8e0938SBrian Somers * by Eric Rosenquist. The name of the author may not be used to 150f8e0938SBrian Somers * endorse or promote products derived from this software without 160f8e0938SBrian Somers * specific prior written permission. 170f8e0938SBrian Somers * 180f8e0938SBrian Somers * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 190f8e0938SBrian Somers * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 200f8e0938SBrian Somers * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 210f8e0938SBrian Somers * 2297d92980SPeter Wemm * $FreeBSD$ 230f8e0938SBrian Somers */ 240f8e0938SBrian Somers 2575240ed1SBrian Somers /* Max # of (Unicode) chars in an NT password */ 2675240ed1SBrian Somers #define MAX_NT_PASSWORD 256 270f8e0938SBrian Somers 2875240ed1SBrian Somers /* Don't rely on sizeof(MS_ChapResponse) in case of struct padding */ 2975240ed1SBrian Somers #define MS_CHAP_RESPONSE_LEN 49 30a8d604abSBrian Somers #define CHAP81_RESPONSE_LEN 49 31a8d604abSBrian Somers #define CHAP81_NTRESPONSE_LEN 24 32a8d604abSBrian Somers #define CHAP81_NTRESPONSE_OFF 24 33a8d604abSBrian Somers #define CHAP81_HASH_LEN 16 34a8d604abSBrian Somers #define CHAP81_AUTHRESPONSE_LEN 42 35a8d604abSBrian Somers #define CHAP81_CHALLENGE_LEN 16 360f8e0938SBrian Somers 375e315498SBrian Somers extern void mschap_NT(char *, char *); 385e315498SBrian Somers extern void mschap_LANMan(char *, char *, char *); 39a8d604abSBrian Somers extern void GenerateNTResponse(char *, char *, char *, int, char *, int , char *); 40a8d604abSBrian Somers extern void HashNtPasswordHash(char *, char *); 41a8d604abSBrian Somers extern void NtPasswordHash(char *, int, char *); 42a8d604abSBrian Somers extern void ChallengeHash(char *, char *, char *UserName, int, char *); 43a8d604abSBrian Somers extern void GenerateAuthenticatorResponse(char *, int, char *, char *, char *, char *, int, char *); 44a8d604abSBrian Somers extern void GetAsymetricStartKey(char *, char *, int, int, int); 45a8d604abSBrian Somers extern void GetMasterKey(char *, char *, char *); 46a8d604abSBrian Somers extern void GetNewKeyFromSHA(char *, char *, long, char *); 47