Bayonne2 / Common C++ 2 Framework
Protected Member Functions | Friends
ZrtpCallback Class Referenceabstract

This abstract class defines the callback functions required by GNU ZRTP. More...

#include <ZrtpCallback.h>

Inheritance diagram for ZrtpCallback:
Inheritance graph
[legend]

Protected Member Functions

virtual  ~ZrtpCallback ()
 
virtual int32_t  sendDataZRTP (const uint8_t *data, int32_t length)=0
  Send a ZRTP packet via RTP. More...
 
virtual int32_t  activateTimer (int32_t time)=0
  Activate timer. More...
 
virtual int32_t  cancelTimer ()=0
  Cancel the active timer. More...
 
virtual void  sendInfo (GnuZrtpCodes::MessageSeverity severity, int32_t subCode)=0
  Send information messages to the hosting environment. More...
 
virtual bool  srtpSecretsReady (SrtpSecret_t *secrets, EnableSecurity part)=0
  SRTP crypto data ready for the sender or receiver. More...
 
virtual void  srtpSecretsOff (EnableSecurity part)=0
  Switch off the security for the defined part. More...
 
virtual void  srtpSecretsOn (std::string c, std::string s, bool verified)=0
  Switch on the security. More...
 
virtual void  handleGoClear ()=0
  This method handles GoClear requests. More...
 
virtual void  zrtpNegotiationFailed (GnuZrtpCodes::MessageSeverity severity, int32_t subCode)=0
  Handle ZRTP negotiation failed. More...
 
virtual void  zrtpNotSuppOther ()=0
  ZRTP calls this method if the other side does not support ZRTP. More...
 
virtual void  synchEnter ()=0
  Enter synchronization mutex. More...
 
virtual void  synchLeave ()=0
  Leave synchronization mutex. More...
 
  Inform about a PBX enrollment request. More...
 
  Inform about PBX enrollment result. More...
 
virtual void  signSAS (uint8_t *sasHash)=0
  Request a SAS signature. More...
 
virtual bool  checkSASSignature (uint8_t *sasHash)=0
  ZRTPQueue calls this method to request a SAS signature check. More...
 

Friends

class  ZRtp
 

Detailed Description

This abstract class defines the callback functions required by GNU ZRTP.

This class is a pure abstract class, aka Interface in Java, that defines the callback interface that the specific part of a GNU ZRTP must implement. The generic part of GNU ZRTP uses these mehtods to communicate with the specific part, for example to send data via the RTP/SRTP stack, to set timers and cancel timer and so on.

The generiy part of GNU ZRTP needs only a few callback methods to be implemented by the specific part.

Author
Werner Dittmann Werne.nosp@m.r.Di.nosp@m.ttman.nosp@m.n@t-.nosp@m.onlin.nosp@m.e.de

Definition at line 119 of file ZrtpCallback.h.

Constructor & Destructor Documentation

virtual ZrtpCallback::~ZrtpCallback ( )
inlineprotectedvirtual

Definition at line 124 of file ZrtpCallback.h.

Member Function Documentation

virtual int32_t ZrtpCallback::activateTimer ( int32_t  time )
protectedpure virtual

Activate timer.

Parameters
time The time in ms for the timer
Returns
zero if activation failed, one if timer was activated

Implemented in ZrtpQueue.

virtual int32_t ZrtpCallback::cancelTimer ( )
protectedpure virtual

Cancel the active timer.

Returns
zero if cancel action failed, one if timer was canceled

Implemented in ZrtpQueue.

virtual bool ZrtpCallback::checkSASSignature ( uint8_t *  sasHash )
protectedpure virtual

ZRTPQueue calls this method to request a SAS signature check.

After ZRTP received a SAS signature in one of the Confirm packets it call this method. The client may use getSignatureLength() and getSignatureData()of ZrtpQueue to get the signature data and perform the signature check. Refer to chapter 8.2 of ZRTP specification.

If the signature check fails the client may return false to ZRTP. In this case ZRTP signals an error to the other peer and terminates the ZRTP handshake.

Note: SAS signing is not yet fully supported by GNU ZRTP.

Parameters
sasHash The SAS hash that was signed by the other peer.
Returns
true if the signature was ok, false otherwise.

Implemented in ZrtpQueue.

virtual void ZrtpCallback::handleGoClear ( )
protectedpure virtual

This method handles GoClear requests.

According to the ZRTP specification the user must be informed about a GoClear request because the ZRTP implementation switches off security if it could authenticate the GoClear packet.

Note: GoClear is not yet implemented in GNU ZRTP.

Implemented in ZrtpQueue.

virtual int32_t ZrtpCallback::sendDataZRTP ( const uint8_t *  data,
int32_t  length 
)
protectedpure virtual

Send a ZRTP packet via RTP.

ZRTP calls this method to send a ZRTP packet via the RTP session.

Parameters
data Points to ZRTP packet to send.
length The length in bytes of the data
Returns
zero if sending failed, one if packet was send
virtual void ZrtpCallback::sendInfo ( GnuZrtpCodes::MessageSeverity  severity,
int32_t  subCode 
)
protectedpure virtual

Send information messages to the hosting environment.

The ZRTP implementation uses this method to send information messages to the host. Along with the message ZRTP provides a severity indicator that defines: Info, Warning, Error, Alert. Refer to the MessageSeverity enum above.

Parameters
severity This defines the message's severity
subCode The subcode identifying the reason.
See Also
ZrtpCodes::MessageSeverity

Implemented in ZrtpQueue.

virtual void ZrtpCallback::signSAS ( uint8_t *  sasHash )
protectedpure virtual

Request a SAS signature.

After ZRTP was able to compute the Short Authentication String (SAS) it calls this method. The client may now use an approriate method to sign the SAS. The client may use ZrtpQueue::setSignatureData() to store the signature data an enable signature transmission to the other peer. Refer to chapter 8.2 of ZRTP specification.

Note: SAS signing is not yet fully supported by GNU ZRTP.

Parameters
sasHash The SAS hash to sign.

Implemented in ZrtpQueue.

virtual void ZrtpCallback::srtpSecretsOff ( EnableSecurity  part )
protectedpure virtual

Switch off the security for the defined part.

Parameters
part Defines for which part (sender or receiver) to switch on security

Implemented in ZrtpQueue.

virtual void ZrtpCallback::srtpSecretsOn ( std::string  c,
std::string  s,
bool  verified 
)
protectedpure virtual

Switch on the security.

ZRTP calls this method after it has computed the SAS and check if it is verified or not. In addition ZRTP provides information about the cipher algorithm and key length for the SRTP session.

This method must enable SRTP processing if it was not enabled during sertSecretsReady().

Parameters
c The name of the used cipher algorithm and mode, or NULL
s The SAS string
verified if verified is true then SAS was verified by both parties during a previous call.

Implemented in ZrtpQueue.

virtual bool ZrtpCallback::srtpSecretsReady ( SrtpSecret_tsecrets,
EnableSecurity  part 
)
protectedpure virtual

SRTP crypto data ready for the sender or receiver.

The ZRTP implementation calls this method right after all SRTP secrets are computed and ready to be used. The parameter points to a structure that contains pointers to the SRTP secrets and a enum Role. The called method (the implementation of this abstract method) must either copy the pointers to the SRTP data or the SRTP data itself to a save place. The SrtpSecret_t structure is destroyed after the callback method returns to the ZRTP implementation.

The SRTP data themselfs are ontained in the ZRtp object and are valid as long as the ZRtp object is active. TheZRtp's destructor clears the secrets. Thus the called method needs to save the pointers only, ZRtp takes care of the data.

The implementing class may enable SRTP processing in this method or delay it to srtpSecertsOn().

Parameters
secrets A pointer to a SrtpSecret_t structure that contains all necessary data.
part for which part (Sender or Receiver) this data is valid.
Returns
Returns false if something went wrong during initialization of SRTP context, for example memory shortage.

Implemented in ZrtpQueue.

virtual void ZrtpCallback::synchEnter ( )
protectedpure virtual

Enter synchronization mutex.

GNU ZRTP requires one mutes to synchronize its processing. Because mutex implementations depend on the underlying infrastructure, for example operating system or thread implementation, GNU ZRTP delegates mutex handling to the spcific part of its implementation.

Implemented in ZrtpQueue.

virtual void ZrtpCallback::synchLeave ( )
protectedpure virtual

Leave synchronization mutex.

Implemented in ZrtpQueue.

virtual void ZrtpCallback::zrtpAskEnrollment ( GnuZrtpCodes::InfoEnrollment  info )
protectedpure virtual

Inform about a PBX enrollment request.

Please refer to chapter 8.3 ff to get more details about PBX enrollment and SAS relay.

Note: PBX enrollement is not yet fully supported by GNU ZRTP.

Parameters
info Give some information to the user about the PBX requesting an enrollment.

Implemented in ZrtpQueue.

virtual void ZrtpCallback::zrtpInformEnrollment ( GnuZrtpCodes::InfoEnrollment  info )
protectedpure virtual

Inform about PBX enrollment result.

Informs the use about the acceptance or denial of an PBX enrollment request

Note: PBX enrollement is not yet fully supported by GNU ZRTP.

Parameters
info information to the user about the result of an enrollment.

Implemented in ZrtpQueue.

virtual void ZrtpCallback::zrtpNegotiationFailed ( GnuZrtpCodes::MessageSeverity  severity,
int32_t  subCode 
)
protectedpure virtual

Handle ZRTP negotiation failed.

ZRTP calls this method in case ZRTP negotiation failed. The parameters show the severity as well as the reason.

Parameters
severity This defines the message's severity
subCode The subcode identifying the reason.
See Also
ZrtpCodes::MessageSeverity

Implemented in ZrtpQueue.

virtual void ZrtpCallback::zrtpNotSuppOther ( )
protectedpure virtual

ZRTP calls this method if the other side does not support ZRTP.

If the other side does not answer the ZRTP Hello packets then ZRTP calls this method,

Implemented in ZrtpQueue.

Friends And Related Function Documentation

friend class ZRtp
friend

Definition at line 122 of file ZrtpCallback.h.


The documentation for this class was generated from the following file:

Generated on Dec 21, 2017 for commoncpp2-1.8.1, ccrtp-1.7.2, libzrtpcpp-2.3.4, ccscript3-1.1.7, ccaudio2-1.0.0 and bayonne2-2.3.2 (after installation in /usr/local/) by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /