ESP packet decryption. More...
#include "ipsec/ipsec.h"
#include "ipsec/ipsec_inbound.h"
#include "esp/esp.h"
#include "esp/esp_packet_decrypt.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 ESP_TRACE_LEVEL |
Functions | |
error_t | espDecryptPacket (IpsecContext *context, IpsecSadEntry *sa, const EspHeader *espHeader, uint8_t *payload, size_t *payloadLen, uint8_t *nextHeader) |
Decrypt an incoming ESP packet. More... | |
error_t | espVerifyChecksum (IpsecContext *context, IpsecSadEntry *sa, const EspHeader *espHeader, const uint8_t *payload, size_t length, const uint8_t *icv) |
Verify ICV checksum. More... | |
Detailed Description
ESP packet decryption.
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 esp_packet_decrypt.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL ESP_TRACE_LEVEL |
Definition at line 32 of file esp_packet_decrypt.c.
Function Documentation
◆ espDecryptPacket()
error_t espDecryptPacket | ( | IpsecContext * | context, |
IpsecSadEntry * | sa, | ||
const EspHeader * | espHeader, | ||
uint8_t * | payload, | ||
size_t * | payloadLen, | ||
uint8_t * | nextHeader | ||
) |
Decrypt an incoming ESP packet.
- Parameters
-
[in] context Pointer to the IPsec context [in] sa Pointer to the SAD entry [in] espHeader Pointer to the ESP header [in,out] payload Payload data to be decrypted [in,out] payloadLen Actual length of the payload data [out] nextHeader Value of the next header field
- Returns
- Error code
Definition at line 59 of file esp_packet_decrypt.c.
◆ espVerifyChecksum()
error_t espVerifyChecksum | ( | IpsecContext * | context, |
IpsecSadEntry * | sa, | ||
const EspHeader * | espHeader, | ||
const uint8_t * | payload, | ||
size_t | length, | ||
const uint8_t * | icv | ||
) |
Verify ICV checksum.
- Parameters
-
[in] context Pointer to the IPsec context [in] sa Pointer to the SAD entry [in] espHeader Pointer to the ESP header [in] payload Pointer to the payload data [in] length Length of the payload data, in bytes [in] icv Integrity Checksum Value (ICV)
- Returns
- Error code
Definition at line 349 of file esp_packet_decrypt.c.