Go to the documentation of this file.
32 #define TRACE_LEVEL IPSEC_TRACE_LEVEL
40 #if (IPSEC_SUPPORT == ENABLED)
81 if(context == NULL || settings == NULL)
84 #if (ESP_SUPPORT == ENABLED && ESP_CBC_SUPPORT == ENABLED)
137 if(context == NULL || params == NULL)
191 if(context == NULL || params == NULL)
202 #if (ESP_SUPPORT == ENABLED)
209 entry = &context->
sad[index];
212 entry->direction = params->direction;
213 entry->mode = params->mode;
214 entry->protocol = params->protocol;
215 entry->selector = params->selector;
216 entry->spi = params->spi;
217 entry->authCipherAlgo = params->authCipherAlgo;
218 entry->authHashAlgo = params->authHashAlgo;
219 entry->authKeyLen = params->authKeyLen;
220 entry->icvLen = params->icvLen;
221 entry->esn = params->esn;
222 entry->seqNum = params->seqNum;
223 entry->antiReplayEnabled = params->antiReplayEnabled;
226 osMemcpy(entry->authKey, params->authKey, params->authKeyLen);
228 #if (ESP_SUPPORT == ENABLED)
230 entry->cipherMode = params->cipherMode;
231 entry->cipherAlgo = params->cipherAlgo;
232 entry->encKeyLen = params->encKeyLen;
233 entry->saltLen = params->saltLen;
234 entry->ivLen = params->ivLen;
237 osMemcpy(entry->encKey, params->encKey, params->encKeyLen +
273 entry = &context->
sad[index];
280 entry->authCipherAlgo = NULL;
281 entry->authHashAlgo = NULL;
282 entry->authKeyLen = 0;
286 entry->antiReplayEnabled =
FALSE;
293 #if (ESP_SUPPORT == ENABLED)
296 entry->cipherAlgo = NULL;
297 entry->encKeyLen = 0;
325 if(context == NULL || params == NULL)
IpsecSadEntry * sad
Security Association Database (SAD)
uint_t numSadEntries
Number of entries in the SAD database.
uint_t numPadEntries
Number of entries in the PAD database.
void * prngContext
Pseudo-random number generator context.
void ipsecGetDefaultSettings(IpsecSettings *settings)
Initialize settings with default values.
error_t ipsecClearPadEntry(IpsecContext *context, uint_t index)
Clear entry at specified index in PAD database.
#define IPSEC_MAX_ENC_KEY_LEN
uint_t numSadEntries
Number of entries in the SAD database.
#define IPSEC_MAX_AUTH_KEY_LEN
Peer Authorization Database (PAD) entry.
IpsecSadEntry * sadEntries
Security Association Database (SAD)
IpsecSpdEntry * spd
Security Policy Database (SPD)
@ ERROR_INVALID_PARAMETER
Invalid parameter.
#define osMemcpy(dest, src, length)
IpsecPadEntry * pad
Peer Authorization Database (PAD)
Helper routines for IPsec.
@ ERROR_INVALID_KEY_LENGTH
error_t ipsecInit(IpsecContext *context, const IpsecSettings *settings)
IPsec service initialization.
error_t ipsecSetSadEntry(IpsecContext *context, uint_t index, IpsecSadEntry *params)
Set entry at specified index in SAD database.
IpsecPadEntry * padEntries
Peer Authorization Database (PAD)
void * ipsecContext
IPsec context.
const PrngAlgo * prngAlgo
Pseudo-random number generator to be used.
uint_t numPadEntries
Number of entries in the PAD database.
error_t ipsecSetPadEntry(IpsecContext *context, uint_t index, IpsecPadEntry *params)
Set entry at specified index in PAD database.
uint_t numSpdEntries
Number of entries in the SPD database.
const PrngAlgo * prngAlgo
Pseudo-random number generator to be used.
uint_t numSpdEntries
Number of entries in the SPD database.
error_t ipsecClearSpdEntry(IpsecContext *context, uint_t index)
Clear entry at specified index in SPD database.
Security Policy Database (SPD) entry.
#define osMemset(p, value, length)
void * prngContext
Pseudo-random number generator context.
error_t ipsecClearSadEntry(IpsecContext *context, uint_t index)
Clear entry at specified index in SAD database.
IpsecSpdEntry * spdEntries
Security Policy Database (SPD)
systime_t osGetSystemTime(void)
Retrieve system time.
error_t ipsecSetSpdEntry(IpsecContext *context, uint_t index, IpsecSpdEntry *params)
Set entry at specified index in SPD database.