iPXE
mschapv2.h
Go to the documentation of this file.
1 #ifndef _IPXE_MSCHAPV2_H
2 #define _IPXE_MSCHAPV2_H
3 
4 /** @file
5  *
6  * MS-CHAPv2 authentication
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 
14 /** An MS-CHAPv2 challenge */
16  /** Raw bytes */
17  uint8_t byte[16];
18 } __attribute__ (( packed ));
19 
20 /** An MS-CHAPv2 NT response */
22  /** DES-encrypted blocks */
23  uint8_t block[3][8];
24 } __attribute__ (( packed ));
25 
26 /** An MS-CHAPv2 challenge response */
28  /** Peer challenge */
30  /** Reserved, must be zero */
32  /** NT response */
34  /** Flags, must be zero */
36 } __attribute__ (( packed ));
37 
38 /** An MS-CHAPv2 authenticator response */
39 struct mschapv2_auth {
40  /** Authenticator response string
41  *
42  * This is an unterminated 42-byte string of the form
43  * "S=<auth_string>" where <auth_string> is the upper-cased
44  * hexadecimal encoding of the actual authenticator response
45  * value. Joy.
46  */
47  char wtf[42];
48 } __attribute__ (( packed ));
49 
50 extern void mschapv2_response ( const char *username, const char *password,
51  const struct mschapv2_challenge *challenge,
52  const struct mschapv2_challenge *peer,
53  struct mschapv2_response *response );
54 extern void mschapv2_auth ( const char *username, const char *password,
55  const struct mschapv2_challenge *challenge,
56  const struct mschapv2_response *response,
57  struct mschapv2_auth *auth );
58 
59 #endif /* _IPXE_MSCHAPV2_H */
uint8_t flags
Flags, must be zero.
Definition: mschapv2.h:35
static void void * auth
Definition: crypto.h:264
An MS-CHAPv2 challenge.
Definition: mschapv2.h:15
struct mschapv2_challenge __attribute__((packed))
uint8_t reserved[8]
Reserved, must be zero.
Definition: mschapv2.h:31
void mschapv2_auth(const char *username, const char *password, const struct mschapv2_challenge *challenge, const struct mschapv2_response *response, struct mschapv2_auth *auth)
Calculate MS-CHAPv2 authenticator response.
Definition: mschapv2.c:308
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned char uint8_t
Definition: stdint.h:10
An MS-CHAPv2 challenge response.
Definition: mschapv2.h:27
struct mschapv2_nt_response nt
NT response.
Definition: mschapv2.h:33
An MS-CHAPv2 authenticator response.
Definition: mschapv2.h:39
void mschapv2_response(const char *username, const char *password, const struct mschapv2_challenge *challenge, const struct mschapv2_challenge *peer, struct mschapv2_response *response)
Calculate MS-CHAPv2 challenge response.
Definition: mschapv2.c:269
struct mschapv2_challenge peer
Peer challenge.
Definition: mschapv2.h:12
uint8_t block[3][8]
DES-encrypted blocks.
Definition: mschapv2.h:23
struct mschapv2_challenge peer
Peer challenge.
Definition: mschapv2.h:29
char wtf[42]
Authenticator response string.
Definition: mschapv2.h:47
An MS-CHAPv2 NT response.
Definition: mschapv2.h:21