IKE message encryption. More...
#include "ike/ike.h"
#include "ike/ike_message_encrypt.h"
#include "ike/ike_debug.h"
#include "cipher/cipher_algorithms.h"
#include "cipher_modes/cipher_modes.h"
#include "aead/aead_algorithms.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL IKE_TRACE_LEVEL |
Functions | |
error_t | ikeEncryptMessage (IkeSaEntry *sa, uint8_t *message, size_t *messageLen) |
Encrypt an outgoing IKE message. More... | |
error_t | ikeComputeChecksum (IkeSaEntry *sa, const uint8_t *message, size_t length, uint8_t *icv) |
Compute ICV checksum. More... | |
size_t | ikePadPayload (IkeSaEntry *sa, uint8_t *data, size_t length) |
Append Padding and Pad Length fields. More... | |
void | ikeGenerateIv (uint8_t *iv) |
IV generation. More... | |
Detailed Description
IKE message encryption.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2022-2024 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.4.4
Definition in file ike_message_encrypt.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL IKE_TRACE_LEVEL |
Definition at line 32 of file ike_message_encrypt.c.
Function Documentation
◆ ikeComputeChecksum()
error_t ikeComputeChecksum | ( | IkeSaEntry * | sa, |
const uint8_t * | message, | ||
size_t | length, | ||
uint8_t * | icv | ||
) |
Compute ICV checksum.
- Parameters
-
[in] sa Pointer to the IKE SA [in] message Pointer to the message [in] length Length of the message, in bytes [out] icv Integrity Checksum Value (ICV)
- Returns
- Error code
Definition at line 372 of file ike_message_encrypt.c.
◆ ikeEncryptMessage()
error_t ikeEncryptMessage | ( | IkeSaEntry * | sa, |
uint8_t * | message, | ||
size_t * | messageLen | ||
) |
Encrypt an outgoing IKE message.
- Parameters
-
[in] sa Pointer to the IKE SA [in,out] message IKE message to be encrypted [in,out] messageLen Actual length of the IKE message
- Returns
- Error code
Definition at line 55 of file ike_message_encrypt.c.
◆ ikeGenerateIv()
void ikeGenerateIv | ( | uint8_t * | iv | ) |
IV generation.
- Parameters
-
[in,out] iv Pointer to the 8-octet initialization vector
Definition at line 533 of file ike_message_encrypt.c.
◆ ikePadPayload()
size_t ikePadPayload | ( | IkeSaEntry * | sa, |
uint8_t * | data, | ||
size_t | length | ||
) |
Append Padding and Pad Length fields.
- Parameters
-
[in] sa Pointer to the IKE SA [in] data Pointer to the payload [in] length Length of the payload, in bytes
- Returns
- Length of the resulting padded payload
Definition at line 484 of file ike_message_encrypt.c.