20 #ifndef ZRTPCWRAPPER_H
21 #define ZRTPCWRAPPER_H
62 #define ZRTP_MAGIC 0x5a525450
63 #define MAX_ZRTP_SIZE 3072
251 #define ForReceiver 1
255 #pragma GCC visibility push(default)
607 const char* zidFilename,
629 int32_t
zrtp_CheckCksum(uint8_t* buffer, uint16_t length, uint32_t crc);
1333 #pragma GCC visibility pop
void zrtp_conf2AckSecure(ZrtpContext *zrtpContext)
Emulate a Conf2Ack packet.
int32_t zrtp_addAlgo(ZrtpContext *zrtpContext, Zrtp_AlgoTypes algoType, const char *algo)
Add an algorithm to configuration data.
zrtp_SevereCodes
Sub-codes for Severe.
Enrollment process failed, no PBX secret available.
void(* zrtp_srtpSecretsOff)(ZrtpContext *ctx, int32_t part)
Switch off the security for the defined part.
const uint8_t * saltInitiator
void zrtp_setSasSignature(ZrtpContext *zrtpContext, int32_t yesNo)
Enables or disables SAS signature processing.
int32_t zrtp_inState(ZrtpContext *zrtpContext, int32_t state)
Check current state of the ZRTP state engine.
const char * zrtp_getSasType(ZrtpContext *zrtpContext)
Get the commited SAS rendering algorithm for this ZRTP session.
void(* zrtp_zrtpNotSuppOther)(ZrtpContext *ctx)
ZRTP calls this method if the other side does not support ZRTP.
char * zrtp_getHelloHash(ZrtpContext *zrtpContext)
Get the ZRTP Hello Hash data.
void zrtp_processTimeout(ZrtpContext *zrtpContext)
Process a timeout event.
int32_t zrtp_CheckCksum(uint8_t *buffer, uint16_t length, uint32_t crc)
Computes the ZRTP checksum over a received ZRTP packet buffer and compares the result with received c...
void zrtp_stopZrtpEngine(ZrtpContext *zrtpContext)
Stop ZRTP security.
void zrtp_setMandatoryOnly(ZrtpContext *zrtpContext)
Convenience function that sets the mandatory algorithms only.
int32_t zrtp_isMultiStream(ZrtpContext *zrtpContext)
Check if this ZRTP session is a Multi-stream session.
const uint8_t * saltResponder
struct c_srtpSecrets C_SrtpSecret_t
This structure contains pointers to the SRTP secrets and the role info.
Enrollment process for this PBX was ok.
zrtp_ZrtpErrorCodes
Error codes according to the ZRTP specification chapter 6.9.
__EXPORT AppLog & info(AppLog &sl)
Manipulator for info level.
Aks user to confirm or deny an Enrollemnt request.
int32_t zrtp_getSignatureLength(ZrtpContext *zrtpContext)
Get length of signature data.
int32_t zrtp_getNumConfiguredAlgos(ZrtpContext *zrtpContext, Zrtp_AlgoTypes algoType)
Returns the number of configured algorithms.
void zrtp_initializeZrtpEngine(ZrtpContext *zrtpContext, zrtp_Callbacks *cb, const char *id, const char *zidFilename, void *userData, int32_t mitmMode)
Initialize the ZRTP protocol engine.
void(* zrtp_zrtpInformEnrollment)(ZrtpContext *ctx, int32_t info)
Inform about PBX enrollment result.
const uint8_t * zrtp_getSignatureData(ZrtpContext *zrtpContext)
Get signature data.
char * zrtp_getPeerHelloHash(ZrtpContext *zrtpContext)
Get the peer's ZRTP Hello Hash data.
int32_t zrtp_removeAlgo(ZrtpContext *zrtpContext, Zrtp_AlgoTypes algoType, const char *algo)
Remove a algorithm from configuration data.
zrtp_AlgoTypes
This enumerations list all configurable algorithm types.
This structure contains pointers to the SRTP secrets and the role info.
int32_t(* zrtp_cancelTimer)(ZrtpContext *ctx)
Cancel the active timer.
User did not confirm the PBX enrollement.
int32_t zrtp_getPeerZid(ZrtpContext *zrtpContext, uint8_t *data)
Get other party's ZID (ZRTP Identifier) data.
ZrtpCallbackWrapper * zrtpCallback
enum zrtp_AlgoTypes Zrtp_AlgoTypes
This enumerations list all configurable algorithm types.
const uint8_t * keyResponder
void(* zrtp_signSAS)(ZrtpContext *ctx, uint8_t *sas)
Request a SAS signature.
uint32_t zrtp_GenerateCksum(uint8_t *buffer, uint16_t length)
Computes the ZRTP checksum over a newly created ZRTP packet buffer.
void(* zrtp_sendInfo)(ZrtpContext *ctx, int32_t severity, int32_t subCode)
Send information messages to the hosting environment.
int32_t(* zrtp_srtpSecretsReady)(ZrtpContext *ctx, C_SrtpSecret_t *secrets, int32_t part)
SRTP crypto data ready for the sender or receiver.
zrtp_SrtpAlgorithms symEncAlgorithm
void zrtp_setMultiStrParams(ZrtpContext *zrtpContext, char *parameters, int32_t length)
Set Multi-stream parameters.
void zrtp_processZrtpMessage(ZrtpContext *zrtpContext, uint8_t *extHeader, uint32_t peerSSRC)
Process RTP extension header.
uint8_t * zrtp_getSasHash(ZrtpContext *zrtpContext)
Get the computed SAS hash for this ZRTP session.
void zrtp_SASVerified(ZrtpContext *zrtpContext)
Set SAS as verified.
ZrtpContext * zrtp_CreateWrapper()
Create the GNU ZRTP C wrapper.
void zrtp_setTrustedMitM(ZrtpContext *zrtpContext, int32_t yesNo)
Enables or disables trusted MitM processing.
int32_t isPeerEnrolled(ZrtpContext *zrtpContext)
Check if a peer's cache entry has a vaild MitM key.
void zrtp_setAuxSecret(ZrtpContext *zrtpContext, uint8_t *data, int32_t length)
Set the auxilliary secret.
void zrtp_startZrtpEngine(ZrtpContext *zrtpContext)
Kick off the ZRTP protocol engine.
void(* zrtp_rtpSecretsOn)(ZrtpContext *ctx, char *c, char *s, int32_t verified)
Switch on the security.
int32_t zrtp_isMultiStreamAvailable(ZrtpContext *zrtpContext)
Check if the other ZRTP client supports Multi-stream.
void zrtp_freeAlgorithmNames(char **names)
Free storage used to store the algorithm names.
void zrtp_setStandardConfig(ZrtpContext *zrtpContext)
Convenience function that sets a pre-defined standard configuration.
uint32_t zrtp_EndCksum(uint32_t crc)
Prepares the ZRTP checksum for appending to ZRTP packet.
void zrtp_resetSASVerified(ZrtpContext *zrtpContext)
Reset the SAS verfied flag for the current active user's retained secrets.
int32_t zrtp_isEnrollmentMode(ZrtpContext *zrtpContext)
Check the state of the enrollment mode.
void zrtp_DestroyWrapper(ZrtpContext *zrtpContext)
Destroy the ZRTP wrapper and its underlying objects.
zrtp_InfoEnrollment
Information codes for the Enrollment user callbacks.
int32_t zrtp_isTrustedMitM(ZrtpContext *zrtpContext)
Check status of trusted MitM processing.
void(* zrtp_zrtpNegotiationFailed)(ZrtpContext *ctx, int32_t severity, int32_t subCode)
Handle ZRTP negotiation failed.
void zrtp_confClear(ZrtpContext *zrtpContext)
Clear all configuration data.
struct zrtp_Callbacks zrtp_Callbacks
This structure defines the callback functions required by GNU ZRTP.
void zrtp_setEnrollmentMode(ZrtpContext *zrtpContext, int32_t enrollmentMode)
Check the state of the enrollment mode.
zrtp_SrtpAlgorithms authAlgorithm
zrtp_WarningCodes
Sub-codes for Warning.
int32_t(* zrtp_checkSASSignature)(ZrtpContext *ctx, uint8_t *sas)
ZRTPQueue calls this method to request a SAS signature check.
void(* zrtp_handleGoClear)(ZrtpContext *ctx)
This method handles GoClear requests.
void zrtp_acceptEnrollment(ZrtpContext *zrtpContext, int32_t accepted)
Accept a PBX enrollment request.
struct zrtpContext ZrtpContext
int32_t zrtp_setSignatureData(ZrtpContext *zrtpContext, uint8_t *data, int32_t length)
Set signature data.
int32_t zrtp_isSasSignature(ZrtpContext *zrtpContext)
Check status of SAS signature processing.
This structure defines the callback functions required by GNU ZRTP.
int32_t(* zrtp_activateTimer)(ZrtpContext *ctx, int32_t time)
Activate timer.
void(* zrtp_zrtpAskEnrollment)(ZrtpContext *ctx, int32_t info)
Inform about a PBX enrollment request.
struct ZrtpCallbackWrapper ZrtpCallbackWrapper
void(* zrtp_synchLeave)(ZrtpContext *ctx)
Leave synchronization mutex.
void(* zrtp_synchEnter)(ZrtpContext *ctx)
Enter synchronization mutex.
int32_t zrtp_InitializeConfig(ZrtpContext *zrtpContext)
Initialize the GNU ZRTP Configure data.
ZrtpConfigure * configure
zrtp_InfoCodes
Sub-codes for Info.
const uint8_t * keyInitiator
zrtp_MessageSeverity
This enum defines the information message severity.
char * zrtp_getMultiStrParams(ZrtpContext *zrtpContext, int32_t *length)
Get Multi-stream parameters.
char ** zrtp_getAlgorithmNames(ZrtpContext *zrtpContext, Zrtp_AlgoTypes type)
Get names of all available algorithmes of a given algorithm type.
const char * zrtp_getAlgoAt(ZrtpContext *zrtpContext, Zrtp_AlgoTypes algoType, int32_t index)
Returns the identifier of the algorithm at index.
int32_t zrtp_sendSASRelayPacket(ZrtpContext *zrtpContext, uint8_t *sh, char *render)
Send the SAS relay packet.
int32_t zrtp_addAlgoAt(ZrtpContext *zrtpContext, Zrtp_AlgoTypes algoType, const char *algo, int32_t index)
Add an algorithm to configuration data at given index.
int32_t(* zrtp_sendDataZRTP)(ZrtpContext *ctx, const uint8_t *data, int32_t length)
Send a ZRTP packet via RTP.
int32_t zrtp_containsAlgo(ZrtpContext *zrtpContext, Zrtp_AlgoTypes algoType, const char *algo)
Checks if the configuration data of the algorihm type already contains a specific algorithms...