bZRTP
bZRTP is an opensource implementation of ZRTP keys exchange protocol
|
Functions | |
int | bzrtp_turnIntoResponder (bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext, bzrtpPacket_t *zrtpPacket, bzrtpCommitMessage_t *commitMessage) |
Turn the current Channel into responder role This happens when receiving a commit message when in state state_discovery_waitingForHelloAck or state_keyAgreement_sendingCommit if commit contention gives us the responder role. State will be changed to state_confirmation_responderSendingConfirm1 or state_confirmation_responderSendingDHPart1 depending on DHM or non-DHM operation mode. More... | |
int | bzrtp_responseToHelloMessage (bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext, bzrtpPacket_t *zrtpPacket) |
When a Hello message arrive from peer for the first time, we shall parse it to check if it match our configuration and act on the context This message may arrives when in state state_discovery_init or state_discovery_waitingForHello. More... | |
int | bzrtp_computeS0DHMMode (bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext) |
After the DHPart1 or DHPart2 arrives from peer, validity check and shared secret computation call this function to compute s0, KDF Context, ZRTPSess,. More... | |
int | bzrtp_computeS0MultiStreamMode (bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext) |
In multistream mode, when we must send a confirm1 or receive a confirm1 for the first time, call the function to compute s0, KDF context and derive mac and srtp keys. More... | |
int | bzrtp_deriveKeysFromS0 (bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext) |
This function is called after s0 (and ZRTPSess when non in Multistream mode) have been computed to derive the other keys Keys computed are: mackeyi, mackeyr, zrtpkeyi and zrtpkeyr, srtpkeys and salt. More... | |
int | bzrtp_deriveSrtpKeysFromS0 (bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext) |
This function is called after confirm1 is received by initiator or confirm2 by responder Keys computed are: srtp self and peer keys and salt, SAS(if mode is not multistream). The whole bzrtpSrtpSecrets_t structure is ready after this call. More... | |
int | bzrtp_updateCachedSecrets (bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext) |
Compute the new rs1 and update the cached secrets according to rfc section 4.6.1. More... | |
int | state_discovery_init (bzrtpEvent_t event) |
This is the initial state On first call, we will create the Hello message and start sending it until we receive an helloACK or a hello message from peer. More... | |
int | state_discovery_waitingForHello (bzrtpEvent_t event) |
Arrives in this state coming from init upon reception on Hello ACK, we are now waiting for the Hello packet from peer. More... | |
int | state_discovery_waitingForHelloAck (bzrtpEvent_t event) |
We are now waiting for the HelloACK packet from peer or a Commit packet. More... | |
int | state_keyAgreement_sendingCommit (bzrtpEvent_t event) |
For any kind of key agreement (DHM, Mult, PreShared), we keep sending commit. More... | |
int | state_keyAgreement_responderSendingDHPart1 (bzrtpEvent_t event) |
For DHM mode only, responder send DHPart1 packet. More... | |
int | state_keyAgreement_initiatorSendingDHPart2 (bzrtpEvent_t event) |
For DHM mode only, initiator send DHPart2 packet. More... | |
int | state_confirmation_responderSendingConfirm1 (bzrtpEvent_t event) |
Responder send the confirm1 message. More... | |
int | state_confirmation_initiatorSendingConfirm2 (bzrtpEvent_t event) |
Initiator send the confirm2 message. More... | |
int | state_secure (bzrtpEvent_t event) |
We are in secure state. More... | |
int bzrtp_computeS0DHMMode | ( | bzrtpContext_t * | zrtpContext, |
bzrtpChannelContext_t * | zrtpChannelContext | ||
) |
After the DHPart1 or DHPart2 arrives from peer, validity check and shared secret computation call this function to compute s0, KDF Context, ZRTPSess,.
param[in] zrtpContext The context we are operation on(where to find the DHM context with the shared secret ready) param[in] zrtpChannelContext The channel context we are operation on
return 0 on success, error code otherwise
int bzrtp_computeS0MultiStreamMode | ( | bzrtpContext_t * | zrtpContext, |
bzrtpChannelContext_t * | zrtpChannelContext | ||
) |
In multistream mode, when we must send a confirm1 or receive a confirm1 for the first time, call the function to compute s0, KDF context and derive mac and srtp keys.
param[in] zrtpContext The context we are operation on(where to find the ZRTPSess) param[in] zrtpChannelContext The channel context we are operation on
return 0 on success, error code otherwise
int bzrtp_deriveKeysFromS0 | ( | bzrtpContext_t * | zrtpContext, |
bzrtpChannelContext_t * | zrtpChannelContext | ||
) |
This function is called after s0 (and ZRTPSess when non in Multistream mode) have been computed to derive the other keys Keys computed are: mackeyi, mackeyr, zrtpkeyi and zrtpkeyr, srtpkeys and salt.
param[in] zrtpContext The context we are operation on(contains ZRTPSess) param[in,out] zrtpChannelContext The channel context we are operation on(contains s0 and will get the computed keys)
return 0 on success, error code otherwise
int bzrtp_deriveSrtpKeysFromS0 | ( | bzrtpContext_t * | zrtpContext, |
bzrtpChannelContext_t * | zrtpChannelContext | ||
) |
This function is called after confirm1 is received by initiator or confirm2 by responder Keys computed are: srtp self and peer keys and salt, SAS(if mode is not multistream). The whole bzrtpSrtpSecrets_t structure is ready after this call.
param[in] zrtpContext The context we are operation on param[in,out] zrtpChannelContext The channel context we are operation on(contains s0 and will get the computed keys)
return 0 on success, error code otherwise
int bzrtp_responseToHelloMessage | ( | bzrtpContext_t * | zrtpContext, |
bzrtpChannelContext_t * | zrtpChannelContext, | ||
bzrtpPacket_t * | zrtpPacket | ||
) |
When a Hello message arrive from peer for the first time, we shall parse it to check if it match our configuration and act on the context This message may arrives when in state state_discovery_init or state_discovery_waitingForHello.
[in] | zrtpContext | The current zrtp Context |
[in,out] | zrtpChannelContext | The channel we are operating |
[in] | zrtpPacket | The zrtpPacket received, it contains the hello message |
int bzrtp_turnIntoResponder | ( | bzrtpContext_t * | zrtpContext, |
bzrtpChannelContext_t * | zrtpChannelContext, | ||
bzrtpPacket_t * | zrtpPacket, | ||
bzrtpCommitMessage_t * | commitMessage | ||
) |
Turn the current Channel into responder role This happens when receiving a commit message when in state state_discovery_waitingForHelloAck or state_keyAgreement_sendingCommit if commit contention gives us the responder role. State will be changed to state_confirmation_responderSendingConfirm1 or state_confirmation_responderSendingDHPart1 depending on DHM or non-DHM operation mode.
[in] | zrtpContext | The current zrtp Context |
[in,out] | zrtpChannelContext | The channel we are operating |
[in] | zrtpPacket | The zrtpPacket receives, it contains the commit message |
[in] | commitMessage | A direct pointer to the commitMessage structure contained in the zrtp packet |
int bzrtp_updateCachedSecrets | ( | bzrtpContext_t * | zrtpContext, |
bzrtpChannelContext_t * | zrtpChannelContext | ||
) |
Compute the new rs1 and update the cached secrets according to rfc section 4.6.1.
param[in] zrtpContext The context we are operation on param[in/out] zrtpChannelContext The channel context we are operation on(contains s0)
return 0 on success, error code otherwise
int state_confirmation_initiatorSendingConfirm2 | ( | bzrtpEvent_t | event | ) |
Initiator send the confirm2 message.
Arrives from:
int state_confirmation_responderSendingConfirm1 | ( | bzrtpEvent_t | event | ) |
Responder send the confirm1 message.
Arrives from:
int state_discovery_init | ( | bzrtpEvent_t | event | ) |
This is the initial state On first call, we will create the Hello message and start sending it until we receive an helloACK or a hello message from peer.
Arrives from :
int state_discovery_waitingForHello | ( | bzrtpEvent_t | event | ) |
Arrives in this state coming from init upon reception on Hello ACK, we are now waiting for the Hello packet from peer.
Arrives from :
int state_discovery_waitingForHelloAck | ( | bzrtpEvent_t | event | ) |
We are now waiting for the HelloACK packet from peer or a Commit packet.
Arrives from :
int state_keyAgreement_initiatorSendingDHPart2 | ( | bzrtpEvent_t | event | ) |
For DHM mode only, initiator send DHPart2 packet.
Arrives from:
int state_keyAgreement_responderSendingDHPart1 | ( | bzrtpEvent_t | event | ) |
For DHM mode only, responder send DHPart1 packet.
Arrives from:
int state_keyAgreement_sendingCommit | ( | bzrtpEvent_t | event | ) |
For any kind of key agreement (DHM, Mult, PreShared), we keep sending commit.
Arrives from :
int state_secure | ( | bzrtpEvent_t | event | ) |
We are in secure state.
Arrives from: