Go to the documentation of this file.
32 #define TRACE_LEVEL IKE_TRACE_LEVEL
45 #if (IKE_SUPPORT == ENABLED)
52 static const uint16_t ikeSupportedKeAlgos[] =
54 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_CURVE25519_SUPPORT == ENABLED)
58 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_CURVE448_SUPPORT == ENABLED)
62 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_ECP_256_SUPPORT == ENABLED)
66 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_ECP_384_SUPPORT == ENABLED)
70 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_ECP_521_SUPPORT == ENABLED)
74 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_ECP_224_SUPPORT == ENABLED)
78 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_ECP_192_SUPPORT == ENABLED)
82 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_BRAINPOOLP256R1_SUPPORT == ENABLED)
86 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_BRAINPOOLP384R1_SUPPORT == ENABLED)
90 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_BRAINPOOLP512R1_SUPPORT == ENABLED)
94 #if (IKE_ECDH_KE_SUPPORT == ENABLED && IKE_BRAINPOOLP224R1_SUPPORT == ENABLED)
98 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 2048 && \
99 IKE_MIN_DH_MODULUS_SIZE <= 2048)
103 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 3072 && \
104 IKE_MIN_DH_MODULUS_SIZE <= 3072)
108 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 4096 && \
109 IKE_MIN_DH_MODULUS_SIZE <= 4096)
113 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 6144 && \
114 IKE_MIN_DH_MODULUS_SIZE <= 6144)
118 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 8192 && \
119 IKE_MIN_DH_MODULUS_SIZE <= 8192)
123 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 1536 && \
124 IKE_MIN_DH_MODULUS_SIZE <= 1536)
128 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 1024 && \
129 IKE_MIN_DH_MODULUS_SIZE <= 1024)
133 #if (IKE_DH_KE_SUPPORT == ENABLED && IKE_MAX_DH_MODULUS_SIZE >= 768 && \
134 IKE_MIN_DH_MODULUS_SIZE <= 768)
145 static const IkeEncAlgo ikeSupportedEncAlgos[] =
147 #if (IKE_CHACHA20_POLY1305_SUPPORT == ENABLED)
150 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_GCM_16_SUPPORT == ENABLED)
153 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_GCM_16_SUPPORT == ENABLED)
156 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_GCM_16_SUPPORT == ENABLED)
159 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_GCM_12_SUPPORT == ENABLED)
162 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_GCM_12_SUPPORT == ENABLED)
165 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_GCM_12_SUPPORT == ENABLED)
168 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_GCM_8_SUPPORT == ENABLED)
171 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_GCM_8_SUPPORT == ENABLED)
174 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_GCM_8_SUPPORT == ENABLED)
177 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
180 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
183 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
186 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
189 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
192 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
195 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
198 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
201 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
204 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
207 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
210 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
213 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
216 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
219 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
222 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
225 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
228 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
231 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
234 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
237 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
240 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
243 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
246 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
249 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
252 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
255 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
258 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
261 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
264 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
267 #if (IKE_3DES_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
270 #if (IKE_DES_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
273 #if (IKE_IDEA_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
283 static const uint16_t ikeSupportedAuthAlgos[] =
285 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA256_SUPPORT == ENABLED)
288 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA384_SUPPORT == ENABLED)
291 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA512_SUPPORT == ENABLED)
294 #if (IKE_CMAC_AUTH_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
297 #if (IKE_XCBC_MAC_AUTH_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
300 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA1_SUPPORT == ENABLED)
303 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_MD5_SUPPORT == ENABLED)
314 static const uint16_t ikeSupportedPrfAlgos[] =
316 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA256_SUPPORT == ENABLED)
319 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA384_SUPPORT == ENABLED)
322 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA512_SUPPORT == ENABLED)
325 #if (IKE_CMAC_PRF_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
328 #if (IKE_XCBC_MAC_PRF_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
331 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_TIGER_SUPPORT == ENABLED)
334 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA1_SUPPORT == ENABLED)
337 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_MD5_SUPPORT == ENABLED)
359 #if (IKE_IDEA_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
370 #if (IKE_DES_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
381 #if (IKE_3DES_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
392 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
403 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
414 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
425 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
437 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
449 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
461 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
475 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
489 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
503 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
517 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
531 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
545 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
559 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
573 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
587 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_GCM_8_SUPPORT == ENABLED)
601 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_GCM_8_SUPPORT == ENABLED)
615 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_GCM_8_SUPPORT == ENABLED)
629 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_GCM_12_SUPPORT == ENABLED)
643 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_GCM_12_SUPPORT == ENABLED)
657 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_GCM_12_SUPPORT == ENABLED)
671 #if (IKE_AES_128_SUPPORT == ENABLED && IKE_GCM_16_SUPPORT == ENABLED)
685 #if (IKE_AES_192_SUPPORT == ENABLED && IKE_GCM_16_SUPPORT == ENABLED)
699 #if (IKE_AES_256_SUPPORT == ENABLED && IKE_GCM_16_SUPPORT == ENABLED)
713 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
724 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
735 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CBC_SUPPORT == ENABLED)
746 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
758 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
770 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CTR_SUPPORT == ENABLED)
782 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
796 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
810 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CCM_8_SUPPORT == ENABLED)
824 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
838 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
852 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CCM_12_SUPPORT == ENABLED)
866 #if (IKE_CAMELLIA_128_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
880 #if (IKE_CAMELLIA_192_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
894 #if (IKE_CAMELLIA_256_SUPPORT == ENABLED && IKE_CCM_16_SUPPORT == ENABLED)
908 #if (IKE_CHACHA20_POLY1305_SUPPORT == ENABLED)
913 sa->cipherAlgo = NULL;
947 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_MD5_SUPPORT == ENABLED)
952 sa->authCipherAlgo = NULL;
958 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA1_SUPPORT == ENABLED)
963 sa->authCipherAlgo = NULL;
969 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA256_SUPPORT == ENABLED)
974 sa->authCipherAlgo = NULL;
980 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA384_SUPPORT == ENABLED)
985 sa->authCipherAlgo = NULL;
991 #if (IKE_HMAC_AUTH_SUPPORT == ENABLED && IKE_SHA512_SUPPORT == ENABLED)
996 sa->authCipherAlgo = NULL;
1002 #if (IKE_CMAC_AUTH_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
1006 sa->authHashAlgo = NULL;
1008 sa->authKeyLen = 16;
1013 #if (IKE_XCBC_MAC_AUTH_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
1017 sa->authHashAlgo = NULL;
1019 sa->authKeyLen = 16;
1049 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_MD5_SUPPORT == ENABLED)
1054 sa->prfCipherAlgo = NULL;
1059 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA1_SUPPORT == ENABLED)
1064 sa->prfCipherAlgo = NULL;
1069 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA256_SUPPORT == ENABLED)
1074 sa->prfCipherAlgo = NULL;
1079 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA384_SUPPORT == ENABLED)
1084 sa->prfCipherAlgo = NULL;
1089 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_SHA512_SUPPORT == ENABLED)
1094 sa->prfCipherAlgo = NULL;
1099 #if (IKE_HMAC_PRF_SUPPORT == ENABLED && IKE_TIGER_SUPPORT == ENABLED)
1104 sa->prfCipherAlgo = NULL;
1109 #if (IKE_CMAC_PRF_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
1113 sa->prfHashAlgo = NULL;
1119 #if (IKE_XCBC_MAC_PRF_SUPPORT == ENABLED && IKE_AES_128_SUPPORT == ENABLED)
1123 sa->prfHashAlgo = NULL;
1152 uint16_t keyLen,
IkeProposal *proposal, uint8_t **lastSubstruc)
1163 p = (uint8_t *) proposal +
length;
1167 if(*lastSubstruc != NULL)
1177 transform->reserved1 = 0;
1179 transform->reserved2 = 0;
1198 attr->length =
htons(keyLen * 8);
1206 transform->transformLength =
htons(
n);
1209 *lastSubstruc = &transform->lastSubstruc;
1212 proposal->numTransforms++;
1233 uint8_t **lastSubstruc)
1284 for(i = 0; i <
arraysize(ikeSupportedKeAlgos) && !error; i++)
1288 ikeSupportedKeAlgos[i], 0, proposal, lastSubstruc);
1314 for(i = 0; i <
arraysize(ikeSupportedEncAlgos) && !error; i++)
1318 ikeSupportedEncAlgos[i].
id, ikeSupportedEncAlgos[i].keyLen,
1319 proposal, lastSubstruc);
1345 for(i = 0; i < (
arraysize(ikeSupportedAuthAlgos) - 1) && !error; i++)
1349 ikeSupportedAuthAlgos[i], 0, proposal, lastSubstruc);
1375 for(i = 0; i <
arraysize(ikeSupportedPrfAlgos) && !error; i++)
1379 ikeSupportedPrfAlgos[i], 0, proposal, lastSubstruc);
1410 proposalLen >= (
sizeof(
IkeProposal) + proposal->spiSize))
1415 p = (uint8_t *) proposal +
sizeof(
IkeProposal) + proposal->spiSize;
1429 n =
ntohs(transform->transformLength);
1477 uint16_t selectedAlgo;
1495 proposalLen >= (
sizeof(
IkeProposal) + proposal->spiSize))
1498 for(i = 0; i < algoListLen && !found; i++)
1503 p = (uint8_t *) proposal +
sizeof(
IkeProposal) + proposal->spiSize;
1517 n =
ntohs(transform->transformLength);
1527 if(
ntohs(transform->transformId) == algoList[i])
1529 selectedAlgo = algoList[i];
1547 return selectedAlgo;
1564 arraysize(ikeSupportedKeAlgos), proposal, proposalLen);
1590 selectedAlgo = NULL;
1594 proposalLen >= (
sizeof(
IkeProposal) + proposal->spiSize))
1597 for(i = 0; i <
arraysize(ikeSupportedEncAlgos) && selectedAlgo == NULL; i++)
1602 p = (uint8_t *) proposal +
sizeof(
IkeProposal) + proposal->spiSize;
1605 for(j = 0; j < proposal->
numTransforms && selectedAlgo == NULL; j++)
1616 n =
ntohs(transform->transformLength);
1645 ntohs(attr->length) == (ikeSupportedEncAlgos[i].
keyLen * 8))
1647 selectedAlgo = &ikeSupportedEncAlgos[i];
1661 selectedAlgo = &ikeSupportedEncAlgos[i];
1680 return selectedAlgo;
1697 arraysize(ikeSupportedAuthAlgos) - 1, proposal, proposalLen);
1714 arraysize(ikeSupportedPrfAlgos), proposal, proposalLen);
1775 n =
ntohs(proposal->proposalLength);
1799 sa->encAlgoId = encAlgo->
id;
1800 sa->encKeyLen = encAlgo->
keyLen;
1859 #if (AH_SUPPORT == ENABLED)
1867 #if (ESP_SUPPORT == ENABLED)
1927 n =
ntohs(proposal->proposalLength);
1942 if(proposal->spiSize != 0)
1978 sa->encAlgoId = encAlgo->
id;
1979 sa->encKeyLen = encAlgo->
keyLen;
2033 #if (AH_SUPPORT == ENABLED)
2041 #if (ESP_SUPPORT == ENABLED)
2188 #if (IKE_ECDH_KE_SUPPORT == ENABLED)
2189 #if (IKE_ECP_192_SUPPORT == ENABLED)
2197 #if (IKE_ECP_224_SUPPORT == ENABLED)
2205 #if (IKE_ECP_256_SUPPORT == ENABLED)
2213 #if (IKE_ECP_384_SUPPORT == ENABLED)
2221 #if (IKE_ECP_521_SUPPORT == ENABLED)
2229 #if (IKE_BRAINPOOLP224R1_SUPPORT == ENABLED)
2237 #if (IKE_BRAINPOOLP256R1_SUPPORT == ENABLED)
2245 #if (IKE_BRAINPOOLP384R1_SUPPORT == ENABLED)
2253 #if (IKE_BRAINPOOLP512R1_SUPPORT == ENABLED)
2261 #if (IKE_CURVE25519_SUPPORT == ENABLED)
2269 #if (IKE_CURVE448_SUPPORT == ENABLED)
2304 if(curveInfo != NULL)
2327 return ikeSupportedKeAlgos[0];
2346 for(i = 0; i <
arraysize(ikeSupportedKeAlgos); i++)
2349 if(ikeSupportedKeAlgos[i] == groupNum)
2371 #if (IKE_SHA1_SUPPORT == ENABLED)
2379 #if (IKE_SHA256_SUPPORT == ENABLED)
2387 #if (IKE_SHA384_SUPPORT == ENABLED)
2395 #if (IKE_SHA512_SUPPORT == ENABLED)
2403 #if (IKE_ED25519_SIGN_SUPPORT == ENABLED || IKE_ED448_SIGN_SUPPORT == ENABLED)
error_t ikeAddSupportedAuthTransforms(IkeContext *context, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported integrity transforms to the proposal.
@ IKE_TRANSFORM_ID_ENCR_AES_GCM_8
@ IKE_TRANSFORM_ID_AUTH_AES_CMAC_96
AH algorithm negotiation.
@ IKE_TRANSFORM_ID_DH_GROUP_CURVE448
Curve448.
error_t ikeSelectEncAlgo(IkeSaEntry *sa, uint16_t encAlgoId, size_t encKeyLen)
Select the relevant encryption algorithm.
uint_t ikeGetNumTransforms(IkeTransformType transformType, const IkeProposal *proposal, size_t proposalLen)
Get the number of transforms that match a given transform type.
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA2_384_192
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_1024
1024-bit MODP Group
@ IKE_TRANSFORM_ID_DH_GROUP_ECP_192
192-bit Random ECP Group
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA1_96
@ IKE_TRANSFORM_ID_PRF_AES128_CMAC
@ IKE_TRANSFORM_ID_ENCR_AES_CCM_16
@ IKE_TRANSFORM_ID_ENCR_AES_CTR
@ IKE_TRANSFORM_ID_DH_GROUP_NONE
None.
@ IKE_TRANSFORM_ID_ENCR_CAMELLIA_CBC
@ IKE_TRANSFORM_ID_ENCR_IDEA
@ IKE_TRANSFORM_ID_AUTH_HMAC_MD5_96
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_4096
4096-bit MODP Group
@ IKE_LAST_SUBSTRUC_MORE_TRANSFORMS
More transform substructures.
Collection of AEAD algorithms.
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_2048
2048-bit MODP Group
error_t ikeAddTransform(IkeTransformType transformType, uint16_t transformId, uint16_t keyLen, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported transforms to the proposal.
error_t ikeCheckSaProposal(IkeSaEntry *sa, const IkeSaPayload *payload)
Check whether the selected proposal is acceptable (IKE protocol)
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_8192
8192-bit MODP Group
@ IKE_TRANSFORM_TYPE_DH
Diffie-Hellman Group.
ESP algorithm negotiation.
@ IKE_TRANSFORM_ID_ENCR_CAMELLIA_CCM_8
@ IKE_LAST_SUBSTRUC_LAST
Last proposal/transform substructure.
error_t ikeSelectChildSaProposal(IkeChildSaEntry *childSa, const IkeSaPayload *payload)
Select a single proposal (AH or ESP protocol)
@ IKE_TRANSFORM_ID_ENCR_CAMELLIA_CCM_16
error_t ikeSelectPrfAlgo(IkeSaEntry *sa, uint16_t prfAlgoId)
Select the relevant PRF algorithm.
const IkeEncAlgo * ikeSelectEncTransform(IkeContext *context, const IkeProposal *proposal, size_t proposalLen)
Encryption transform negotiation.
error_t ikeAddSupportedPrfTransforms(IkeContext *context, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported PRF transforms to the proposal.
bool_t ikeIsHashAlgoSupported(uint16_t hashAlgoId)
Check whether a given signature hash algorithm is supported.
@ IKE_TRANSFORM_ID_DH_GROUP_CURVE25519
Curve25519.
@ IKE_TRANSFORM_ID_DH_GROUP_BRAINPOOLP224R1
224-bit Brainpool ECP Group
uint16_t ikeSelectTransform(IkeTransformType transformType, const uint16_t *algoList, uint_t algoListLen, const IkeProposal *proposal, size_t proposalLen)
Transform negotiation.
@ IKE_TRANSFORM_ID_ENCR_CHACHA20_POLY1305
uint16_t ikeSelectPrfTransform(IkeContext *context, const IkeProposal *proposal, size_t proposalLen)
PRF transform negotiation.
@ IKE_ATTR_FORMAT_TV
shortened Type/Value format
@ IKE_TRANSFORM_ID_AUTH_AES_XCBC_96
@ IKE_TRANSFORM_ID_PRF_HMAC_SHA2_384
error_t espSelectSaProposal(IkeChildSaEntry *childSa, const IkeSaPayload *payload)
Select a single proposal.
#define IKE_TRANSFORM_ID_INVALID
@ IKE_TRANSFORM_ID_DH_GROUP_ECP_224
224-bit Random ECP Group
@ IKE_TRANSFORM_ID_ENCR_AES_CBC
#define BRAINPOOLP512R1_CURVE
@ IKE_TRANSFORM_ATTR_TYPE_KEY_LEN
Key Length (in bits)
error_t ikeLoadEcdhParams(EcDomainParameters *params, uint16_t groupNum)
Load the EC parameters that match the specified group number.
#define BRAINPOOLP384R1_CURVE
error_t ecLoadDomainParameters(EcDomainParameters *params, const EcCurveInfo *curveInfo)
Load EC domain parameters.
#define BRAINPOOLP224R1_CURVE
error_t ikeSelectAuthAlgo(IkeSaEntry *sa, uint16_t authAlgoId)
Select the relevant MAC algorithm.
Elliptic curve parameters.
#define osMemcpy(dest, src, length)
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.
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_768
768-bit MODP Group
bool_t ikeIsDhGroupSupported(uint16_t groupNum)
Check whether a given Diffie-Hellman group is supported.
@ IKE_TRANSFORM_ID_PRF_HMAC_MD5
bool_t ikeIsDhKeyExchangeAlgo(uint16_t groupNum)
Test if the group number identifies a DH key exchange algorithm.
@ IKE_TRANSFORM_ID_DH_GROUP_BRAINPOOLP512R1
512-bit Brainpool ECP Group
@ IKE_TRANSFORM_ID_PRF_HMAC_SHA1
@ IKE_TRANSFORM_ID_ENCR_AES_GCM_12
#define CAMELLIA_CIPHER_ALGO
Block cipher modes of operation.
uint16_t ikeSelectAuthTransform(IkeContext *context, const IkeProposal *proposal, size_t proposalLen)
Integrity transform negotiation.
error_t espCheckSaProposal(IkeChildSaEntry *childSa, const IkeSaPayload *payload)
Check whether the selected proposal is acceptable.
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_1536
1536-bit MODP Group
@ IKE_TRANSFORM_TYPE_ENCR
Encryption Algorithm.
@ IKE_TRANSFORM_ID_PRF_AES128_XCBC
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_2048_224
2048-bit MODP Group with 224-bit Prime Order Subgroup
bool_t ikeIsAeadEncAlgo(uint16_t encAlgoId)
Test if the transform ID identifies an AEAD encryption algorithm.
IkeTransformType
Transform types.
#define SHA384_DIGEST_SIZE
@ IKE_TRANSFORM_ID_DH_GROUP_ECP_384
384-bit Random ECP Group
@ IKE_TRANSFORM_ID_PRF_HMAC_SHA2_256
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA2_256_128
@ IKE_TRANSFORM_ID_ENCR_DES
Collection of hash algorithms.
IKEv2 (Internet Key Exchange Protocol)
uint16_t ikeSelectDefaultDhGroup(void)
Get the default Diffie-Hellman group number.
error_t ikeSelectSaProposal(IkeSaEntry *sa, const IkeSaPayload *payload, size_t spiSize)
Select a single proposal (IKE protocol)
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_1024_160
1024-bit MODP Group with 160-bit Prime Order Subgroup
@ IKE_TRANSFORM_ID_ENCR_3DES
@ IKE_TRANSFORM_ID_ENCR_AES_GCM_16
@ IKE_TRANSFORM_ID_PRF_HMAC_TIGER
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_3072
3072-bit MODP Group
error_t ikeAddSupportedTransforms(IkeContext *context, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported IKE transforms to the proposal.
@ IKE_TRANSFORM_ID_ENCR_AES_CCM_12
@ IKE_TRANSFORM_TYPE_PRF
Pseudorandom Function.
@ IKE_TRANSFORM_ID_ENCR_CAMELLIA_CTR
@ IKE_PROTOCOL_ID_IKE
IKE protocol.
#define CAMELLIA_BLOCK_SIZE
#define BRAINPOOLP256R1_CURVE
#define TIGER_DIGEST_SIZE
bool_t ikeIsVariableLengthKeyEncAlgo(uint16_t encAlgoId)
Test if the transform ID identifies a variable-length key encryption algorithm.
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_2048_256
2048-bit MODP Group with 256-bit Prime Order Subgroup
@ IKE_TRANSFORM_ID_DH_GROUP_ECP_256
256-bit Random ECP Group
@ CIPHER_MODE_CHACHA20_POLY1305
error_t ahCheckSaProposal(IkeChildSaEntry *childSa, const IkeSaPayload *payload)
Check whether the selected proposal is acceptable.
bool_t ikeIsEcdhKeyExchangeAlgo(uint16_t groupNum)
Test if the group number identifies an ECDH key exchange algorithm.
error_t ikeAddSupportedEncTransforms(IkeContext *context, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported encryption transforms to the proposal.
@ IKE_TRANSFORM_ID_AUTH_HMAC_SHA2_512_256
@ IKE_TRANSFORM_ID_AUTH_NONE
const EcCurveInfo * ikeGetEcdhCurveInfo(uint16_t groupNum)
Get the elliptic curve that matches the specified group number.
#define SHA256_DIGEST_SIZE
@ IKE_TRANSFORM_ID_DH_GROUP_BRAINPOOLP384R1
384-bit Brainpool ECP Group
error_t ikeCheckChildSaProposal(IkeChildSaEntry *childSa, const IkeSaPayload *payload)
Check whether the selected proposal is acceptable (AH or ESP protocol)
@ IKE_TRANSFORM_ID_DH_GROUP_ECP_521
521-bit Random ECP Group
#define SHA512_DIGEST_SIZE
IKEv2 algorithm negotiation.
uint16_t ikeSelectKeTransform(IkeContext *context, const IkeProposal *proposal, size_t proposalLen)
Key exchange transform negotiation.
@ IKE_TRANSFORM_ID_DH_GROUP_BRAINPOOLP256R1
256-bit Brainpool ECP Group
@ IKE_TRANSFORM_ID_PRF_HMAC_SHA2_512
@ IKE_TRANSFORM_ID_DH_GROUP_MODP_6144
6144-bit MODP Group
@ IKE_TRANSFORM_ID_ENCR_CAMELLIA_CCM_12
@ IKE_TRANSFORM_ID_ENCR_AES_CCM_8
@ IKE_TRANSFORM_TYPE_INTEG
Integrity Algorithm.