ike_payload_format.c
AH algorithm negotiation.
void netUnlock(NetContext *context)
Release exclusive access to the core of the TCP/IP stack.
Definition: net.c:319
Diffie-Hellman key exchange.
error_t ikeFormatNoncePayload(IkeSaEntry *sa, IkeChildSaEntry *childSa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Nonce payload.
Definition: ike_payload_format.c:951
Authentication of the IKE SA.
IKE payload formatting.
void sha1Update(Sha1Context *context, const void *data, size_t length)
Update the SHA-1 context with a portion of the message being hashed.
Definition: apm32f4xx_crypto_hash.c:230
@ IKE_NOTIFY_MSG_TYPE_CHILD_SA_NOT_FOUND
Definition: ike.h:1202
error_t ikeAddTransform(IkeTransformType transformType, uint16_t transformId, uint16_t keyLen, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported transforms to the proposal.
Definition: ike_algorithms.c:1166
ESP algorithm negotiation.
error_t ipSelectSourceAddr(NetContext *context, NetInterface **interface, const IpAddr *destAddr, IpAddr *srcAddr)
IP source address selection.
Definition: ip.c:120
error_t ikeFormatChildSaPayload(IkeChildSaEntry *childSa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Security Association payload (AH or ESP protocol)
Definition: ike_payload_format.c:242
error_t ikeFormatAuthPayload(IkeSaEntry *sa, const IkeIdPayload *idPayload, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Authentication payload.
Definition: ike_payload_format.c:898
error_t ahAddSupportedTransforms(IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported AH transforms to the proposal.
Definition: ah_algorithms.c:192
@ IKE_NOTIFY_MSG_TYPE_SIGNATURE_HASH_ALGORITHMS
Definition: ike.h:1255
error_t ikeFormatDeletePayload(IkeSaEntry *sa, IkeChildSaEntry *childSa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Delete payload.
Definition: ike_payload_format.c:1430
@ IKE_NOTIFY_MSG_TYPE_NAT_DETECTION_SOURCE_IP
Definition: ike.h:1212
error_t ikeGenerateAuth(IkeSaEntry *sa, const IkeIdPayload *idPayload, uint8_t *authMethod, uint8_t *authData, size_t *authDataLen)
Generate signature or MAC.
Definition: ike_auth.c:60
error_t ikeFormatSaPayload(IkeSaEntry *sa, const uint8_t *spi, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Security Association payload (IKE protocol)
Definition: ike_payload_format.c:61
@ IKE_NOTIFY_MSG_TYPE_NAT_DETECTION_DESTINATION_IP
Definition: ike.h:1213
error_t ikeFormatCertAuthorities(const char_t *trustedCaList, size_t trustedCaListLen, uint8_t *certAuth, size_t *certAuthLen)
Format list of acceptable certification authorities.
Definition: ike_certificate.c:292
error_t pemImportCertificate(const char_t *input, size_t inputLen, uint8_t *output, size_t *outputLen, size_t *consumed)
Decode a PEM file containing a certificate.
Definition: pem_import.c:55
error_t ikeFormatNatDetectDestIpNotificationData(IkeSaEntry *sa, uint8_t *p, size_t *written)
Format NAT_DETECTION_DESTINATION_IP notification data.
Definition: ike_payload_format.c:1291
PEM file import functions.
void sha1Init(Sha1Context *context)
Initialize SHA-1 message digest context.
Definition: esp32_c3_crypto_hash.c:186
error_t ikeFormatPublicKey(IkeKeContext *keContext, uint8_t *p, size_t *written)
Format public key.
Definition: ike_key_exchange.c:215
bool_t ipCompAddr(const IpAddr *ipAddr1, const IpAddr *ipAddr2)
Compare IP addresses.
Definition: ip.c:318
Key material generation.
error_t espAddSupportedTransforms(IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported ESP transforms to the proposal.
Definition: esp_algorithms.c:993
error_t ikeFormatNotifyPayload(IkeSaEntry *sa, IkeChildSaEntry *childSa, IkeNotifyMsgType notifyMsgType, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Notify payload.
Definition: ike_payload_format.c:1039
error_t ikeFormatChildSaProposal(IkeChildSaEntry *childSa, uint8_t *p, size_t *written)
Format Proposal substructure (AH or ESP protocol)
Definition: ike_payload_format.c:294
error_t ikeFormatKePayload(IkeKeContext *keContext, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Key Exchange payload.
Definition: ike_payload_format.c:488
error_t ikeFormatTsiPayload(IkeChildSaEntry *childSa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Traffic Selector payload (initiator)
Definition: ike_payload_format.c:1493
bool_t ikeIsAeadEncAlgo(uint16_t encAlgoId)
Test if the transform ID identifies an AEAD encryption algorithm.
Definition: ike_algorithms.c:2088
error_t ikeFormatIdPayload(IkeSaEntry *sa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Identification payload.
Definition: ike_payload_format.c:543
error_t ikeFormatCertPayloads(IkeSaEntry *sa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Certificate payloads.
Definition: ike_payload_format.c:646
IKEv2 (Internet Key Exchange Protocol)
error_t ikeFormatCertPayload(const char_t *certChain, size_t certChainLen, size_t *consumed, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Certificate payload.
Definition: ike_payload_format.c:739
@ IKE_NOTIFY_MSG_TYPE_INVALID_KE_PAYLOAD
Definition: ike.h:1190
error_t ikeFormatNatDetectSrcIpNotificationData(IkeSaEntry *sa, uint8_t *p, size_t *written)
Format NAT_DETECTION_SOURCE_IP notification data.
Definition: ike_payload_format.c:1209
error_t ikeGetCertSubjectDn(const char_t *cert, size_t certLen, uint8_t *subjectDn, size_t *subjectDnLen)
Extract subject's DN from certificate.
Definition: ike_certificate.c:204
@ IKE_NOTIFY_MSG_TYPE_UNSUPPORTED_CRITICAL_PAYLOAD
Definition: ike.h:1183
error_t ikeAddSupportedTransforms(IkeContext *context, IkeProposal *proposal, uint8_t **lastSubstruc)
Add the supported IKE transforms to the proposal.
Definition: ike_algorithms.c:1247
X.509 certificate handling.
void netLock(NetContext *context)
Get exclusive access to the core of the TCP/IP stack.
Definition: net.c:307
void sha1Final(Sha1Context *context, uint8_t *digest)
Finish the SHA-1 message digest.
Definition: esp32_c3_crypto_hash.c:269
error_t ikeFormatSaProposal(IkeSaEntry *sa, const uint8_t *spi, uint8_t *p, size_t *written)
Format Proposal substructure (IKE protocol)
Definition: ike_payload_format.c:114
error_t ikeFormatTsEntry(const IkeTsEntry *tsEntry, uint8_t *p, size_t *written)
Format Traffic Selector substructure.
Definition: ike_payload_format.c:1770
error_t ikeFormatCertReqPayload(IkeSaEntry *sa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Certificate Request payload.
Definition: ike_payload_format.c:800
IKEv2 algorithm negotiation.
error_t ikeFormatTsrPayload(IkeChildSaEntry *childSa, uint8_t *p, size_t *written, uint8_t **nextPayload)
Format Traffic Selector payload (responder)
Definition: ike_payload_format.c:1631
Debugging facilities.
error_t ikeFormatSignHashAlgosNotificationData(IkeSaEntry *sa, uint8_t *p, size_t *written)
Format SIGNATURE_HASH_ALGORITHMS notification data.
Definition: ike_payload_format.c:1356
