EAP MS-CHAP-V2 authentication method. More...
Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL IKE_TRACE_LEVEL |
Functions | |
| error_t | ikeProcessEapMschapv2Request (IkeSaEntry *sa, const IkeEapMschapv2Packet *request, size_t length) |
| Process EAP MS-CHAP-V2 request. More... | |
| error_t | ikeProcessEapMschapv2Challenge (IkeSaEntry *sa, const IkeEapMschapv2Challenge *challenge, size_t length) |
| Process EAP MS-CHAP-V2 Challenge packet. More... | |
| error_t | ikeProcessEapMschapv2SuccessRequest (IkeSaEntry *sa, const IkeEapMschapv2SuccessRequest *request, size_t length) |
| Process EAP MS-CHAP-V2 Success Request packet. More... | |
| error_t | ikeProcessEapMschapv2FailureRequest (IkeSaEntry *sa, const IkeEapMschapv2FailureRequest *request, size_t length) |
| Process EAP MS-CHAP-V2 Failure Request packet. More... | |
| error_t | ikeFormatEapMschapv2Response (IkeSaEntry *sa, uint8_t *p, size_t *written) |
| Format EAP MS-CHAP-V2 Response packet. More... | |
| error_t | ikeFormatEapMschapv2SuccessResponse (IkeSaEntry *sa, uint8_t *p, size_t *written) |
| Format EAP MS-CHAP-V2 Success Response packet. More... | |
| error_t | ikeFormatEapMschapv2FailureResponse (IkeSaEntry *sa, uint8_t *p, size_t *written) |
| Format EAP MS-CHAP-V2 Failure Response packet. More... | |
| void | ikeEapMschapv2GenerateNtResponse (const uint8_t *authChallenge, const uint8_t *peerChallenge, const char_t *username, const char_t *password, uint8_t *response) |
| GenerateNTResponse routine. More... | |
| void | ikeEapMschapv2ChallengeHash (const uint8_t *peerChallenge, const uint8_t *authChallenge, const char_t *username, uint8_t *challenge) |
| ChallengeHash routine. More... | |
| void | ikeEapMschapv2NtPasswordHash (const char_t *password, uint8_t *passwordHash) |
| NtPasswordHash routine. More... | |
| void | ikeEapMschapv2HashNtPasswordHash (const uint8_t *passwordHash, uint8_t *passwordHashHash) |
| HashNtPasswordHash routine. More... | |
| void | ikeEapMschapv2ChallengeResponse (const uint8_t *challenge, const uint8_t *passwordHash, uint8_t *response) |
| ChallengeResponse routine. More... | |
| void | ikeEapMschapv2GenerateAuthResponse (const char_t *password, const uint8_t *ntResponse, const uint8_t *peerChallenge, const uint8_t *authChallenge, const char_t *username, uint8_t *authResponse) |
| GenerateAuthenticatorResponse routine. More... | |
| bool_t | ikeEapMschapv2CheckAuthResponse (const char_t *password, const uint8_t *ntResponse, const uint8_t *peerChallenge, const uint8_t *authChallenge, const char_t *username, const uint8_t *receivedResponse) |
| CheckAuthenticatorResponse routine. More... | |
| void | ikeEapMschapv2GenerateMasterSessionKey (const char_t *password, const uint8_t *ntResponse, uint8_t *masterSessionKey) |
| Generate master session key. More... | |
| void | ikeEapMschapv2GetMasterKey (const uint8_t *passwordHashHash, const uint8_t *ntResponse, uint8_t *masterKey) |
| GetMasterKey routine. More... | |
| void | ikeEapMschapv2GetAsymmetricStartKey (const uint8_t *masterKey, uint8_t *sessionKey, size_t sessionKeyLen, bool_t isSend) |
| GetAsymmetricStartKey routine. More... | |
Detailed Description
EAP MS-CHAP-V2 authentication method.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2022-2026 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneIPSEC Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.6.8
Definition in file ike_eap_mschapv2.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL IKE_TRACE_LEVEL |
Definition at line 32 of file ike_eap_mschapv2.c.
Function Documentation
◆ ikeEapMschapv2ChallengeHash()
| void ikeEapMschapv2ChallengeHash | ( | const uint8_t * | peerChallenge, |
| const uint8_t * | authChallenge, | ||
| const char_t * | username, | ||
| uint8_t * | challenge | ||
| ) |
ChallengeHash routine.
- Parameters
-
[in] peerChallenge Peer challenge (16 bytes) [in] authChallenge Authenticator challenge (16 bytes) [in] username NULL-terminated string containing the user name [out] challenge Resulting challenge (8 bytes)
Definition at line 468 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2ChallengeResponse()
| void ikeEapMschapv2ChallengeResponse | ( | const uint8_t * | challenge, |
| const uint8_t * | passwordHash, | ||
| uint8_t * | response | ||
| ) |
ChallengeResponse routine.
- Parameters
-
[in] challenge Challenge (8 bytes) [in] passwordHash Password hash (16 bytes) [out] response Resulting response (24 bytes)
Definition at line 551 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2CheckAuthResponse()
| bool_t ikeEapMschapv2CheckAuthResponse | ( | const char_t * | password, |
| const uint8_t * | ntResponse, | ||
| const uint8_t * | peerChallenge, | ||
| const uint8_t * | authChallenge, | ||
| const char_t * | username, | ||
| const uint8_t * | receivedResponse | ||
| ) |
CheckAuthenticatorResponse routine.
- Parameters
-
[in] password NULL-terminated string containing the password [out] ntResponse NT-Response field (24 bytes) [in] peerChallenge Peer challenge (16 bytes) [in] authChallenge Authenticator challenge (16 bytes) [in] username NULL-terminated string containing the user name [in] receivedResponse Received response (42 bytes)
- Returns
- TRUE if the authenticator response is correct, else FASE
Definition at line 690 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2GenerateAuthResponse()
| void ikeEapMschapv2GenerateAuthResponse | ( | const char_t * | password, |
| const uint8_t * | ntResponse, | ||
| const uint8_t * | peerChallenge, | ||
| const uint8_t * | authChallenge, | ||
| const char_t * | username, | ||
| uint8_t * | authResponse | ||
| ) |
GenerateAuthenticatorResponse routine.
- Parameters
-
[in] password NULL-terminated string containing the password [out] ntResponse NT-Response field (24 bytes) [in] peerChallenge Peer challenge (16 bytes) [in] authChallenge Authenticator challenge (16 bytes) [in] username NULL-terminated string containing the user name [out] authResponse Resulting authenticator response (42 bytes)
Definition at line 595 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2GenerateMasterSessionKey()
| void ikeEapMschapv2GenerateMasterSessionKey | ( | const char_t * | password, |
| const uint8_t * | ntResponse, | ||
| uint8_t * | masterSessionKey | ||
| ) |
Generate master session key.
- Parameters
-
[in] password NULL-terminated string containing the password [in] ntResponse NT-Response field (24 bytes) [out] masterSessionKey Resulting master session key (64 bytes)
Definition at line 725 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2GenerateNtResponse()
| void ikeEapMschapv2GenerateNtResponse | ( | const uint8_t * | authChallenge, |
| const uint8_t * | peerChallenge, | ||
| const char_t * | username, | ||
| const char_t * | password, | ||
| uint8_t * | response | ||
| ) |
GenerateNTResponse routine.
- Parameters
-
[in] authChallenge Authenticator challenge (16 bytes) [in] peerChallenge Peer challenge (16 bytes) [in] username NULL-terminated string containing the user name [in] password NULL-terminated string containing the password [out] response Resulting NT-Response field (24 bytes)
Definition at line 439 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2GetAsymmetricStartKey()
| void ikeEapMschapv2GetAsymmetricStartKey | ( | const uint8_t * | masterKey, |
| uint8_t * | sessionKey, | ||
| size_t | sessionKeyLen, | ||
| bool_t | isSend | ||
| ) |
GetAsymmetricStartKey routine.
- Parameters
-
[in] masterKey Master key (16 bytes) [out] sessionKey Session key [in] sessionKeyLen Length of the session key, in bytes [in] isSend Send or receive direction
Definition at line 809 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2GetMasterKey()
| void ikeEapMschapv2GetMasterKey | ( | const uint8_t * | passwordHashHash, |
| const uint8_t * | ntResponse, | ||
| uint8_t * | masterKey | ||
| ) |
GetMasterKey routine.
- Parameters
-
[in] passwordHashHash Hash value (16 bytes) [in] ntResponse NT-Response field (24 bytes) [out] masterKey Resulting master key (16 bytes)
Definition at line 771 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2HashNtPasswordHash()
| void ikeEapMschapv2HashNtPasswordHash | ( | const uint8_t * | passwordHash, |
| uint8_t * | passwordHashHash | ||
| ) |
HashNtPasswordHash routine.
- Parameters
-
[in] passwordHash Password hash (16 bytes) [out] passwordHashHash Resulting hash (16 bytes)
Definition at line 530 of file ike_eap_mschapv2.c.
◆ ikeEapMschapv2NtPasswordHash()
| void ikeEapMschapv2NtPasswordHash | ( | const char_t * | password, |
| uint8_t * | passwordHash | ||
| ) |
NtPasswordHash routine.
- Parameters
-
[in] password NULL-terminated string containing the password [out] passwordHash Password hash (16 bytes)
Definition at line 493 of file ike_eap_mschapv2.c.
◆ ikeFormatEapMschapv2FailureResponse()
| error_t ikeFormatEapMschapv2FailureResponse | ( | IkeSaEntry * | sa, |
| uint8_t * | p, | ||
| size_t * | written | ||
| ) |
Format EAP MS-CHAP-V2 Failure Response packet.
- Parameters
-
[in] sa Pointer to the IKE SA [out] p Buffer where to format the EAP MS-CHAP-V2 packet [out] written Length of the resulting EAP MS-CHAP-V2 packet
- Returns
- Error code
Definition at line 404 of file ike_eap_mschapv2.c.
◆ ikeFormatEapMschapv2Response()
| error_t ikeFormatEapMschapv2Response | ( | IkeSaEntry * | sa, |
| uint8_t * | p, | ||
| size_t * | written | ||
| ) |
Format EAP MS-CHAP-V2 Response packet.
- Parameters
-
[in] sa Pointer to the IKE SA [out] p Buffer where to format the EAP MS-CHAP-V2 packet [out] written Length of the resulting EAP MS-CHAP-V2 packet
- Returns
- Error code
Definition at line 292 of file ike_eap_mschapv2.c.
◆ ikeFormatEapMschapv2SuccessResponse()
| error_t ikeFormatEapMschapv2SuccessResponse | ( | IkeSaEntry * | sa, |
| uint8_t * | p, | ||
| size_t * | written | ||
| ) |
Format EAP MS-CHAP-V2 Success Response packet.
- Parameters
-
[in] sa Pointer to the IKE SA [out] p Buffer where to format the EAP MS-CHAP-V2 packet [out] written Length of the resulting EAP MS-CHAP-V2 packet
- Returns
- Error code
Definition at line 370 of file ike_eap_mschapv2.c.
◆ ikeProcessEapMschapv2Challenge()
| error_t ikeProcessEapMschapv2Challenge | ( | IkeSaEntry * | sa, |
| const IkeEapMschapv2Challenge * | challenge, | ||
| size_t | length | ||
| ) |
Process EAP MS-CHAP-V2 Challenge packet.
- Parameters
-
[in] sa Pointer to the IKE SA [in] challenge Pointer to the EAP MS-CHAP-V2 Challenge packet [in] length Length of the EAP MS-CHAP-V2 Challenge packet, in bytes
- Returns
- Error code
Definition at line 101 of file ike_eap_mschapv2.c.
◆ ikeProcessEapMschapv2FailureRequest()
| error_t ikeProcessEapMschapv2FailureRequest | ( | IkeSaEntry * | sa, |
| const IkeEapMschapv2FailureRequest * | request, | ||
| size_t | length | ||
| ) |
Process EAP MS-CHAP-V2 Failure Request packet.
- Parameters
-
[in] sa Pointer to the IKE SA [in] request Pointer to the EAP MS-CHAP-V2 Failure Request packet [in] length Length of the EAP MS-CHAP-V2 Failure Request packet, in bytes
- Returns
- Error code
Definition at line 254 of file ike_eap_mschapv2.c.
◆ ikeProcessEapMschapv2Request()
| error_t ikeProcessEapMschapv2Request | ( | IkeSaEntry * | sa, |
| const IkeEapMschapv2Packet * | request, | ||
| size_t | length | ||
| ) |
Process EAP MS-CHAP-V2 request.
- Parameters
-
[in] sa Pointer to the IKE SA [in] request Pointer to the EAP MS-CHAP-V2 request [in] length Length of the EAP MS-CHAP-V2 request, in bytes
- Returns
- Error code
Definition at line 52 of file ike_eap_mschapv2.c.
◆ ikeProcessEapMschapv2SuccessRequest()
| error_t ikeProcessEapMschapv2SuccessRequest | ( | IkeSaEntry * | sa, |
| const IkeEapMschapv2SuccessRequest * | request, | ||
| size_t | length | ||
| ) |
Process EAP MS-CHAP-V2 Success Request packet.
- Parameters
-
[in] sa Pointer to the IKE SA [in] request Pointer to the EAP MS-CHAP-V2 Success Request packet [in] length Length of the EAP MS-CHAP-V2 Success Request packet, in bytes
- Returns
- Error code
Definition at line 177 of file ike_eap_mschapv2.c.
