xref: /openbsd-src/sbin/iked/chap_ms.h (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1 /*	$OpenBSD: chap_ms.h,v 1.3 2013/01/08 10:38:19 reyk Exp $	*/
2 
3 /*
4  * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _CHAP_MS_H
20 #define _CHAP_MS_H
21 
22 #define MSCHAP_CHALLENGE_SZ	8
23 #define MSCHAPV2_CHALLENGE_SZ	16
24 #define MSCHAP_HASH_SZ		16
25 #define MSCHAP_MASTERKEY_SZ	16
26 #define MSCHAP_MSK_KEY_SZ	32
27 #define MSCHAP_MSK_PADDING_SZ	32
28 #define MSCHAP_MSK_SZ		64
29 
30 #define MSCHAP_MAXNTPASSWORD_SZ	255	/* unicode chars */
31 
32 void	 mschap_nt_response(u_int8_t *, u_int8_t *, u_int8_t *, int,
33 	    u_int8_t *, int , u_int8_t *);
34 void	 mschap_auth_response(u_int8_t *, int, u_int8_t *, u_int8_t *,
35 	    u_int8_t *, u_int8_t *, int, u_int8_t *);
36 
37 void	 mschap_nt(u_int8_t *, u_int8_t *);
38 void	 mschap_lanman(u_int8_t *, u_int8_t *, u_int8_t *);
39 
40 void	 mschap_ntpassword_hash(u_int8_t *, int, u_int8_t *);
41 void	 mschap_challenge_hash(u_int8_t *, u_int8_t *, u_int8_t *,
42 	    int, u_int8_t *);
43 
44 void	 mschap_asymetric_startkey(u_int8_t *, u_int8_t *, int, int, int);
45 void	 mschap_masterkey(u_int8_t *, u_int8_t *, u_int8_t *);
46 void	 mschap_newkey(u_int8_t *, u_int8_t *, long, u_int8_t *);
47 void	 mschap_radiuskey(u_int8_t *, const u_int8_t *, const u_int8_t *,
48 	    const u_int8_t *);
49 void	 mschap_msk(u_int8_t *, int, u_int8_t *, u_int8_t *);
50 
51 #endif /* _CHAP_MS_H */
52