ike_message_encrypt.c File Reference

IKE message encryption. More...

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
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]saPointer to the IKE SA
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
[out]icvIntegrity 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]saPointer to the IKE SA
[in,out]messageIKE message to be encrypted
[in,out]messageLenActual 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]ivPointer 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]saPointer to the IKE SA
[in]dataPointer to the payload
[in]lengthLength of the payload, in bytes
Returns
Length of the resulting padded payload

Definition at line 484 of file ike_message_encrypt.c.