ah_algorithms.c
Go to the documentation of this file.
1 /**
2  * @file ah_algorithms.c
3  * @brief AH algorithm negotiation
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2022-2026 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneIPSEC Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.6.6
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL AH_TRACE_LEVEL
33 
34 //Dependencies
35 #include "ipsec/ipsec.h"
36 #include "ipsec/ipsec_misc.h"
37 #include "ah/ah.h"
38 #include "ah/ah_algorithms.h"
39 #include "ike/ike_algorithms.h"
40 #include "hash/hash_algorithms.h"
41 #include "debug.h"
42 
43 //Check IPsec library configuration
44 #if (AH_SUPPORT == ENABLED)
45 
46 
47 /**
48  * @brief List of supported integrity algorithms
49  **/
50 
51 static const uint16_t ahSupportedAuthAlgos[] =
52 {
53 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA256_SUPPORT == ENABLED)
55 #endif
56 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA384_SUPPORT == ENABLED)
58 #endif
59 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA512_SUPPORT == ENABLED)
61 #endif
62 #if (AH_CMAC_SUPPORT == ENABLED && AH_AES_128_SUPPORT == ENABLED)
64 #endif
65 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA1_SUPPORT == ENABLED)
67 #endif
68 #if (AH_HMAC_SUPPORT == ENABLED && AH_MD5_SUPPORT == ENABLED)
70 #endif
71 };
72 
73 
74 /**
75  * @brief List of supported ESN transforms
76  **/
77 
78 static const uint16_t ahSupportedEsnTranforms[] =
79 {
80 #if (AH_ESN_SUPPORT == ENABLED)
82 #endif
84 };
85 
86 
87 /**
88  * @brief Select the relevant MAC algorithm
89  * @param[in] childSa Pointer to the Child SA
90  * @param[in] authAlgoId Authentication algorithm identifier
91  * @return Error code
92  **/
93 
94 error_t ahSelectAuthAlgo(IkeChildSaEntry *childSa, uint16_t authAlgoId)
95 {
96  error_t error;
97 
98  //Initialize status code
99  error = NO_ERROR;
100 
101 #if (AH_CMAC_SUPPORT == ENABLED && AH_AES_128_SUPPORT == ENABLED)
102  //AES-CMAC-96 authentication algorithm?
103  if(authAlgoId == IKE_TRANSFORM_ID_AUTH_AES_CMAC_96)
104  {
105  childSa->authMacAlgo = MAC_ALGO_CMAC;
106  childSa->authHashAlgo = NULL;
107  childSa->authCipherAlgo = AES_CIPHER_ALGO;
108  childSa->authKeyLen = 16;
109  childSa->icvLen = 12;
110  }
111  else
112 #endif
113 #if (AH_HMAC_SUPPORT == ENABLED && AH_MD5_SUPPORT == ENABLED)
114  //HMAC-MD5-96 authentication algorithm?
115  if(authAlgoId == IKE_TRANSFORM_ID_AUTH_HMAC_MD5_96)
116  {
117  childSa->authMacAlgo = MAC_ALGO_HMAC;
118  childSa->authHashAlgo = MD5_HASH_ALGO;
119  childSa->authCipherAlgo = NULL;
120  childSa->authKeyLen = MD5_DIGEST_SIZE;
121  childSa->icvLen = 12;
122  }
123  else
124 #endif
125 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA1_SUPPORT == ENABLED)
126  //HMAC-SHA1-96 authentication algorithm?
127  if(authAlgoId == IKE_TRANSFORM_ID_AUTH_HMAC_SHA1_96)
128  {
129  childSa->authMacAlgo = MAC_ALGO_HMAC;
130  childSa->authHashAlgo = SHA1_HASH_ALGO;
131  childSa->authCipherAlgo = NULL;
132  childSa->authKeyLen = SHA1_DIGEST_SIZE;
133  childSa->icvLen = 12;
134  }
135  else
136 #endif
137 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA256_SUPPORT == ENABLED)
138  //HMAC-SHA256-128 authentication algorithm?
140  {
141  childSa->authMacAlgo = MAC_ALGO_HMAC;
142  childSa->authHashAlgo = SHA256_HASH_ALGO;
143  childSa->authCipherAlgo = NULL;
144  childSa->authKeyLen = SHA256_DIGEST_SIZE;
145  childSa->icvLen = 16;
146  }
147  else
148 #endif
149 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA384_SUPPORT == ENABLED)
150  //HMAC-SHA384-192 authentication algorithm?
152  {
153  childSa->authMacAlgo = MAC_ALGO_HMAC;
154  childSa->authHashAlgo = SHA384_HASH_ALGO;
155  childSa->authCipherAlgo = NULL;
156  childSa->authKeyLen = SHA384_DIGEST_SIZE;
157  childSa->icvLen = 24;
158  }
159  else
160 #endif
161 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA512_SUPPORT == ENABLED)
162  //HMAC-SHA512-256 authentication algorithm?
164  {
165  childSa->authMacAlgo = MAC_ALGO_HMAC;
166  childSa->authHashAlgo = SHA512_HASH_ALGO;
167  childSa->authCipherAlgo = NULL;
168  childSa->authKeyLen = SHA512_DIGEST_SIZE;
169  childSa->icvLen = 32;
170  }
171  else
172 #endif
173  //Unknown authentication algorithm?
174  {
175  //Report an error
176  error = ERROR_UNSUPPORTED_ALGO;
177  }
178 
179  //Return status code
180  return error;
181 }
182 
183 
184 /**
185  * @brief Add the supported AH transforms to the proposal
186  * @param[in] childSa Pointer to the Child SA
187  * @param[in,out] proposal Pointer to the Proposal substructure
188  * @param[in,out] lastSubstruc Pointer to the Last Substruc field
189  * @return Error code
190  **/
191 
193  IkeProposal *proposal, uint8_t **lastSubstruc)
194 {
195  error_t error;
196 
197  //Add supported integrity transforms
198  error = ahAddSupportedAuthTransforms(childSa, proposal, lastSubstruc);
199 
200 #if (IKE_CHILD_SA_PFS_SUPPORT == ENABLED)
201  //Check status code
202  if(!error)
203  {
204  //Although AH does not directly include a Diffie-Hellman exchange, a
205  //Diffie-Hellman group may be negotiated for the Child SA. This allows
206  //the peers to employ Diffie-Hellman in the CREATE_CHILD_SA exchange,
207  //providing perfect forward secrecy for the generated Child SA keys
208  //(refer to RFC 7296, section 3.3.2)
209  if(childSa->pfs)
210  {
211  //Add supported key exchange transforms
212  error = ikeAddSupportedKeTransforms(childSa->context, proposal,
213  lastSubstruc);
214  }
215  }
216 #endif
217 
218  //Check status code
219  if(!error)
220  {
221  //An initiator who supports ESNs will usually include two ESN transforms,
222  //with values "0" and "1", in its proposals (refer to RFC 7296,
223  //section 3.3.2)
224  error = ahAddSupportedEsnTransforms(childSa, proposal, lastSubstruc);
225  }
226 
227  //Return status code
228  return error;
229 }
230 
231 
232 /**
233  * @brief Add the supported integrity transforms to the proposal
234  * @param[in] childSa Pointer to the Child SA
235  * @param[in,out] proposal Pointer to the Proposal substructure
236  * @param[in,out] lastSubstruc Pointer to the Last Substruc field
237  * @return Error code
238  **/
239 
241  IkeProposal *proposal, uint8_t **lastSubstruc)
242 {
243  error_t error;
244  uint_t i;
245 
246  //Initialize status code
247  error = NO_ERROR;
248 
249  //Loop through the list of supported integrity transforms
250  for(i = 0; i < arraysize(ahSupportedAuthAlgos) && !error; i++)
251  {
252  //Add a new transform to the proposal
254  ahSupportedAuthAlgos[i], 0, proposal, lastSubstruc);
255  }
256 
257  //Return status code
258  return error;
259 }
260 
261 
262 /**
263  * @brief Add the supported ESN transforms to the proposal
264  * @param[in] childSa Pointer to the Child SA
265  * @param[in,out] proposal Pointer to the Proposal substructure
266  * @param[in,out] lastSubstruc Pointer to the Last Substruc field
267  * @return Error code
268  **/
269 
271  IkeProposal *proposal, uint8_t **lastSubstruc)
272 {
273  error_t error;
274  uint_t i;
275 
276  //Initialize status code
277  error = NO_ERROR;
278 
279  //Loop through the list of supported ESN transforms
280  for(i = 0; i < arraysize(ahSupportedEsnTranforms) && !error; i++)
281  {
282  //Add a new transform to the proposal
284  ahSupportedEsnTranforms[i], 0, proposal, lastSubstruc);
285  }
286 
287  //Return status code
288  return error;
289 }
290 
291 
292 /**
293  * @brief Integrity transform negotiation
294  * @param[in] childSa Pointer to the Child SA
295  * @param[in] proposal Pointer to the Proposal substructure
296  * @param[in] proposalLen Length of the Proposal substructure, in bytes
297  * @return Selected integrity transform, if any
298  **/
299 
301  const IkeProposal *proposal, size_t proposalLen)
302 {
303  //Select the integrity transform to use
304  return ikeSelectTransform(IKE_TRANSFORM_TYPE_INTEG, ahSupportedAuthAlgos,
305  arraysize(ahSupportedAuthAlgos), proposal, proposalLen);
306 }
307 
308 
309 /**
310  * @brief ESN transform negotiation
311  * @param[in] childSa Pointer to the Child SA
312  * @param[in] proposal Pointer to the Proposal substructure
313  * @param[in] proposalLen Length of the Proposal substructure, in bytes
314  * @return Selected ESN transform, if any
315  **/
316 
318  const IkeProposal *proposal, size_t proposalLen)
319 {
320  //Select the ESN transform to use
321  return ikeSelectTransform(IKE_TRANSFORM_TYPE_ESN, ahSupportedEsnTranforms,
322  arraysize(ahSupportedEsnTranforms), proposal, proposalLen);
323 }
324 
325 
326 /**
327  * @brief Select a single proposal
328  * @param[in] childSa Pointer to the Child SA
329  * @param[in] payload Pointer to the Security Association payload
330  * @return Error code
331  **/
332 
334  const IkeSaPayload *payload)
335 {
336  error_t error;
337  size_t n;
338  size_t length;
339  const uint8_t *p;
340  const IkeProposal *proposal;
341 
342  //Clear the set of parameters
343  childSa->protocol = IPSEC_PROTOCOL_INVALID;
344  childSa->encAlgoId = IKE_TRANSFORM_ID_INVALID;
345  childSa->encKeyLen = 0;
346  childSa->authAlgoId = IKE_TRANSFORM_ID_INVALID;
347  childSa->esn = IKE_TRANSFORM_ID_INVALID;
348 #if (IKE_CHILD_SA_PFS_SUPPORT == ENABLED)
349  childSa->keContext.groupNum = IKE_TRANSFORM_ID_KE_NONE;
350 #endif
351 
352  //Retrieve the length of the SA payload
353  length = ntohs(payload->header.payloadLength);
354 
355  //Malformed payload?
356  if(length < sizeof(IkeSaPayload))
357  return ERROR_INVALID_MESSAGE;
358 
359  //Point to the first byte of the Proposals field
360  p = payload->proposals;
361  //Determine the length of the Proposals field
362  length -= sizeof(IkeSaPayload);
363 
364  //Initialize status code
365  error = ERROR_INVALID_PROPOSAL;
366 
367  //The Security Association payload contains one or more Proposal
368  //substructures
369  while(1)
370  {
371  //Malformed payload?
372  if(length < sizeof(IkeProposal))
373  {
374  //Report an error
375  error = ERROR_INVALID_MESSAGE;
376  break;
377  }
378 
379  //Point to the Proposal substructure
380  proposal = (IkeProposal *) p;
381 
382  //The Proposal Length field indicates the length of this proposal,
383  //including all transforms and attributes that follow
384  n = ntohs(proposal->proposalLength);
385 
386  //Check the length of the proposal
387  if(n < sizeof(IkeProposal) || n > length)
388  {
389  //Report an error
390  error = ERROR_INVALID_MESSAGE;
391  break;
392  }
393 
394  //Check protocol identifier
395  if(proposal->protocolId == IKE_PROTOCOL_ID_AH)
396  {
397  //Valid SPI value?
398  if(proposal->spiSize == IPSEC_SPI_SIZE &&
399  osMemcmp(proposal->spi, IPSEC_INVALID_SPI, IPSEC_SPI_SIZE) != 0)
400  {
401  //Initialize status code
402  error = NO_ERROR;
403 
404  //Integrity transform negotiation
405  childSa->authAlgoId = ahSelectAuthTransform(childSa, proposal, n);
406  //ESN transform negotiation
407  childSa->esn = ahSelectEsnTransform(childSa, proposal, n);
408 
409  //Unacceptable proposal?
410  if(childSa->authAlgoId == IKE_TRANSFORM_ID_INVALID ||
411  childSa->esn == IKE_TRANSFORM_ID_INVALID)
412  {
413  error = ERROR_INVALID_PROPOSAL;
414  }
415 
416 #if (IKE_CHILD_SA_PFS_SUPPORT == ENABLED)
417  //Although AH does not directly include a Diffie-Hellman exchange,
418  //a Diffie-Hellman group may be negotiated for the Child SA. This
419  //allows the peers to employ Diffie-Hellman in the CREATE_CHILD_SA
420  //exchange, providing perfect forward secrecy for the generated
421  //Child SA keys (refer to RFC 7296, section 3.3.2)
422  if(childSa->pfs)
423  {
424  //Key exchange transform negotiation
425  childSa->keContext.groupNum = ikeSelectKeTransform(
426  childSa->context, proposal, n);
427 
428  //Unacceptable proposal?
429  if(childSa->keContext.groupNum == IKE_TRANSFORM_ID_KE_NONE)
430  {
431  error = ERROR_INVALID_PROPOSAL;
432  }
433  }
434 #endif
435  //Valid proposal?
436  if(!error)
437  {
438  //Select AH security protocol
439  childSa->protocol = IPSEC_PROTOCOL_AH;
440  //Save the number of the proposal that was accepted
441  childSa->acceptedProposalNum = proposal->proposalNum;
442 
443  //The initiator SPI is supplied in the SPI field of the SA
444  //payload
445  osMemcpy(childSa->remoteSpi, proposal->spi, proposal->spiSize);
446 
447  //Successful negotiation
448  break;
449  }
450  }
451  }
452 
453  //Jump to the next proposal
454  p += n;
455  length -= n;
456  }
457 
458  //Return status code
459  return error;
460 }
461 
462 
463 /**
464  * @brief Check whether the selected proposal is acceptable
465  * @param[in] childSa Pointer to the Child SA
466  * @param[in] payload Pointer to the Security Association payload
467  * @return Error code
468  **/
469 
471  const IkeSaPayload *payload)
472 {
473  size_t n;
474  size_t length;
475  const uint8_t *p;
476  const IkeProposal *proposal;
477 
478  //Clear the set of parameters
479  childSa->encAlgoId = IKE_TRANSFORM_ID_INVALID;
480  childSa->encKeyLen = 0;
481  childSa->authAlgoId = IKE_TRANSFORM_ID_INVALID;
482  childSa->esn = IKE_TRANSFORM_ID_INVALID;
483 
484  //Retrieve the length of the SA payload
485  length = ntohs(payload->header.payloadLength);
486 
487  //Malformed payload?
488  if(length < sizeof(IkeSaPayload))
489  return ERROR_INVALID_MESSAGE;
490 
491  //Point to the first byte of the Proposals field
492  p = payload->proposals;
493  //Determine the length of the Proposals field
494  length -= sizeof(IkeSaPayload);
495 
496  //Malformed payload?
497  if(length < sizeof(IkeProposal))
498  return ERROR_INVALID_MESSAGE;
499 
500  //Point to the Proposal substructure
501  proposal = (IkeProposal *) p;
502 
503  //The Proposal Length field indicates the length of this proposal,
504  //including all transforms and attributes that follow
505  n = ntohs(proposal->proposalLength);
506 
507  //The responder must accept a single proposal (refer to RFC 7296,
508  //section 2.7)
509  if(n != length)
510  return ERROR_INVALID_MESSAGE;
511 
512  //Check protocol identifier
513  if(proposal->protocolId != IKE_PROTOCOL_ID_AH)
514  return ERROR_INVALID_MESSAGE;
515 
516  //During subsequent negotiations, the SPI Size field is equal to the size,
517  //in octets, of the SPI of the corresponding protocol (4 for ESP and AH)
518  if(proposal->spiSize != IPSEC_SPI_SIZE)
519  return ERROR_INVALID_MESSAGE;
520 
521  //The SPI value of zero is reserved and must not be sent on the wire (refer
522  //to RFC 4302, section 2.4)
523  if(osMemcmp(proposal->spi, IPSEC_INVALID_SPI, IPSEC_SPI_SIZE) == 0)
524  return ERROR_INVALID_MESSAGE;
525 
526  //The responder SPI is supplied in the SPI field of the SA payload
527  osMemcpy(childSa->remoteSpi, proposal->spi, proposal->spiSize);
528 
529  //The accepted cryptographic suite must contain exactly one transform of
530  //each type included in the proposal (refer to RFC 7296, section 2.7)
531  if(ikeGetNumTransforms(IKE_TRANSFORM_TYPE_INTEG, proposal, n) != 1 ||
533  {
534  return ERROR_INVALID_PROPOSAL;
535  }
536 
537  //Get the selected integrity transform
538  childSa->authAlgoId = ahSelectAuthTransform(childSa, proposal, n);
539  //Get the selected ESN transform
540  childSa->esn = ahSelectEsnTransform(childSa, proposal, n);
541 
542  //The initiator of an exchange must check that the accepted offer is
543  //consistent with one of its proposals, and if not must terminate the
544  //exchange (refer to RFC 7296, section 3.3.6)
545  if(childSa->authAlgoId != IKE_TRANSFORM_ID_INVALID &&
546  childSa->esn != IKE_TRANSFORM_ID_INVALID)
547  {
548  return NO_ERROR;
549  }
550  else
551  {
552  return ERROR_INVALID_PROPOSAL;
553  }
554 }
555 
556 #endif
@ IKE_TRANSFORM_ID_AUTH_AES_CMAC_96
Definition: ike.h:1037
AH algorithm negotiation.
@ MAC_ALGO_CMAC
uint_t ikeGetNumTransforms(IkeTransformType transformType, const IkeProposal *proposal, size_t proposalLen)
Get the number of transforms that match a given transform type.
#define IPSEC_SPI_SIZE
Definition: ipsec.h:145
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA2_384_192
Definition: ike.h:1042
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA1_96
Definition: ike.h:1031
#define SHA256_HASH_ALGO
Definition: sha256.h:49
#define SHA1_HASH_ALGO
Definition: sha1.h:49
@ IPSEC_PROTOCOL_AH
Definition: ipsec.h:199
#define SHA512_HASH_ALGO
Definition: sha512.h:49
uint8_t p
Definition: ndp.h:300
@ IKE_TRANSFORM_ID_AUTH_HMAC_MD5_96
Definition: ike.h:1030
error_t ikeAddTransform(IkeTransformType transformType, uint16_t transformId, uint16_t keyLen, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported transforms to the proposal.
@ IKE_TRANSFORM_ID_ESN_NO
No Extended Sequence Numbers.
Definition: ike.h:1090
@ IKE_PROTOCOL_ID_AH
AH.
Definition: ike.h:931
const uint8_t IPSEC_INVALID_SPI[4]
Definition: ipsec_misc.c:40
#define osMemcmp(p1, p2, length)
Definition: os_port.h:159
uint16_t ahSelectEsnTransform(IkeChildSaEntry *childSa, const IkeProposal *proposal, size_t proposalLen)
ESN transform negotiation.
@ ERROR_INVALID_MESSAGE
Definition: error.h:105
error_t ahAddSupportedTransforms(IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported AH transforms to the proposal.
uint16_t ikeSelectTransform(IkeTransformType transformType, const uint16_t *algoList, uint_t algoListLen, const IkeProposal *proposal, size_t proposalLen)
Transform negotiation.
uint16_t ahSelectAuthTransform(IkeChildSaEntry *childSa, const IkeProposal *proposal, size_t proposalLen)
Integrity transform negotiation.
@ IKE_TRANSFORM_TYPE_ESN
Extended Sequence Numbers.
Definition: ike.h:949
#define IKE_TRANSFORM_ID_INVALID
#define osMemcpy(dest, src, length)
Definition: os_port.h:147
@ ERROR_INVALID_PROPOSAL
Definition: error.h:301
error_t ahSelectSaProposal(IkeChildSaEntry *childSa, const IkeSaPayload *payload)
Select a single proposal.
error_t ikeAddSupportedKeTransforms(IkeContext *context, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported key exchange transforms to the proposal.
error_t
Error codes.
Definition: error.h:43
@ ERROR_UNSUPPORTED_ALGO
Definition: error.h:126
Helper routines for IPsec.
#define MD5_HASH_ALGO
Definition: md5.h:49
error_t ahSelectAuthAlgo(IkeChildSaEntry *childSa, uint16_t authAlgoId)
Select the relevant MAC algorithm.
Definition: ah_algorithms.c:94
error_t ahAddSupportedEsnTransforms(IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported ESN transforms to the proposal.
uint8_t length
Definition: tcp.h:375
#define SHA384_DIGEST_SIZE
Definition: sha384.h:41
#define MD5_DIGEST_SIZE
Definition: md5.h:45
AH (IP Authentication Header)
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA2_256_128
Definition: ike.h:1041
Collection of hash algorithms.
#define ntohs(value)
Definition: cpu_endian.h:421
@ IKE_TRANSFORM_ID_KE_NONE
None.
Definition: ike.h:1053
#define SHA384_HASH_ALGO
Definition: sha384.h:45
error_t ahAddSupportedAuthTransforms(IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported integrity transforms to the proposal.
IkeProposal
Definition: ike.h:1505
#define SHA1_DIGEST_SIZE
Definition: sha1.h:45
IPsec (IP security)
uint8_t n
uint8_t payload[]
Definition: ipv6.h:308
@ IKE_TRANSFORM_ID_ESN_YES
Extended Sequence Numbers.
Definition: ike.h:1091
@ MAC_ALGO_HMAC
#define AES_CIPHER_ALGO
Definition: aes.h:45
error_t ahCheckSaProposal(IkeChildSaEntry *childSa, const IkeSaPayload *payload)
Check whether the selected proposal is acceptable.
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA2_512_256
Definition: ike.h:1043
unsigned int uint_t
Definition: compiler_port.h:57
#define SHA256_DIGEST_SIZE
Definition: sha256.h:45
#define IkeChildSaEntry
Definition: ike.h:840
@ IPSEC_PROTOCOL_INVALID
Definition: ipsec.h:198
#define SHA512_DIGEST_SIZE
Definition: sha512.h:45
IKEv2 algorithm negotiation.
uint16_t ikeSelectKeTransform(IkeContext *context, const IkeProposal *proposal, size_t proposalLen)
Key exchange transform negotiation.
@ NO_ERROR
Success.
Definition: error.h:44
Debugging facilities.
IkeSaPayload
Definition: ike.h:1488
#define arraysize(a)
Definition: os_port.h:71
@ IKE_TRANSFORM_TYPE_INTEG
Integrity Algorithm.
Definition: ike.h:947