esp_packet_decrypt.h File Reference

ESP packet decryption. More...

#include "ipsec/ipsec.h"
#include "esp/esp.h"

Go to the source code of this file.

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file esp_packet_decrypt.h.

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]contextPointer to the IPsec context
[in]saPointer to the SAD entry
[in]espHeaderPointer to the ESP header
[in,out]payloadPayload data to be decrypted
[in,out]payloadLenActual length of the payload data
[out]nextHeaderValue 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]contextPointer to the IPsec context
[in]saPointer to the SAD entry
[in]espHeaderPointer to the ESP header
[in]payloadPointer to the payload data
[in]lengthLength of the payload data, in bytes
[in]icvIntegrity Checksum Value (ICV)
Returns
Error code

Definition at line 349 of file esp_packet_decrypt.c.