Bayonne2 / Common C++ 2 Framework: ZrtpCallback.h Source File

Bayonne2 / Common C++ 2 Framework
ZrtpCallback.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006-2010 Werner Dittmann
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef _ZRTPCALLBACK_H_
19 #define _ZRTPCALLBACK_H_
20 
28 #include <string>
29 #include <stdint.h>
30 #include <libzrtpcpp/ZrtpCodes.h>
31 
32 #ifndef __EXPORT
33  #if __GNUC__ >= 4
34  #define __EXPORT __attribute__ ((visibility("default")))
35  #define __LOCAL __attribute__ ((visibility("hidden")))
36  #elif defined _WIN32 || defined __CYGWIN__
37  #define __EXPORT __declspec(dllimport)
38  #define __LOCAL
39  #else
40   #define __EXPORT
41   #define __LOCAL
42  #endif
43 #endif
44 
60  typedef enum {
61   Responder = 1,
62   Initiator
63 } Role;
64 
66  typedef enum {
67   None,
68   Aes = 1,
69   TwoFish,
70   Sha1,
71   Skein
72 } SrtpAlgorithms;
73 
83  typedef struct srtpSecrets {
84   SrtpAlgorithms symEncAlgorithm;
85   const uint8_t* keyInitiator;
86   int32_t initKeyLen;
87   const uint8_t* saltInitiator;
88   int32_t initSaltLen;
89   const uint8_t* keyResponder;
90   int32_t respKeyLen;
91   const uint8_t* saltResponder;
92   int32_t respSaltLen;
93   SrtpAlgorithms authAlgorithm;
94   int32_t srtpAuthTagLen;
95   std::string sas;
96   Role role;
97 } SrtpSecret_t;
98 
99  enum EnableSecurity {
100   ForReceiver = 1,
101   ForSender = 2
102 };
103 
119  class __EXPORT ZrtpCallback {
120 
121 protected:
122   friend class ZRtp;
123 
124   virtual ~ZrtpCallback() {};
125 
138  virtual int32_t sendDataZRTP(const uint8_t* data, int32_t length) =0;
139 
148  virtual int32_t activateTimer(int32_t time) =0;
149 
156  virtual int32_t cancelTimer() =0;
157 
172  virtual void sendInfo(GnuZrtpCodes::MessageSeverity severity, int32_t subCode) =0;
173 
203  virtual bool srtpSecretsReady(SrtpSecret_t* secrets, EnableSecurity part) =0;
204 
211  virtual void srtpSecretsOff(EnableSecurity part) =0;
212 
231  virtual void srtpSecretsOn(std::string c, std::string s, bool verified) =0;
232 
243  virtual void handleGoClear() =0;
244 
257  virtual void zrtpNegotiationFailed(GnuZrtpCodes::MessageSeverity severity, int32_t subCode) =0;
258 
266  virtual void zrtpNotSuppOther() =0;
267 
277  virtual void synchEnter() =0;
278 
282  virtual void synchLeave() =0;
283 
296  virtual void zrtpAskEnrollment(GnuZrtpCodes::InfoEnrollment info) =0;
297 
310  virtual void zrtpInformEnrollment(GnuZrtpCodes::InfoEnrollment info) =0;
311 
329  virtual void signSAS(uint8_t* sasHash) =0;
330 
353  virtual bool checkSASSignature(uint8_t* sasHash) =0;
354 };
355 
356 #endif // ZRTPCALLBACK
357 
None
Definition: ZrtpCallback.h:67
EnableSecurity
EnableSecurity
Definition: ZrtpCallback.h:99
srtpSecrets::symEncAlgorithm
SrtpAlgorithms symEncAlgorithm
symmetrical cipher algorithm
Definition: ZrtpCallback.h:84
ForReceiver
Enable security for SRTP receiver.
Definition: ZrtpCallback.h:100
ZrtpCodes.h
The ZRTP info, warning, and error codes.
Skein
Use Skein as authentication algorithm.
Definition: ZrtpCallback.h:71
info
__EXPORT AppLog & info(AppLog &sl)
Manipulator for info level.
Definition: applog.h:581
ZrtpCallback
This abstract class defines the callback functions required by GNU ZRTP.
Definition: ZrtpCallback.h:119
Initiator
This client is in ZRTP Initiator mode.
Definition: ZrtpCallback.h:62
srtpSecrets
This structure contains pointers to the SRTP secrets and the role info.
Definition: ZrtpCallback.h:83
ForSender
Enable security for SRTP sender.
Definition: ZrtpCallback.h:101
srtpSecrets::initKeyLen
int32_t initKeyLen
Initiator's key length.
Definition: ZrtpCallback.h:86
GnuZrtpCodes::InfoEnrollment
InfoEnrollment
Information codes for the Enrollment user callbacks.
Definition: ZrtpCodes.h:152
srtpSecrets::role
Role role
ZRTP role of this client.
Definition: ZrtpCallback.h:96
TwoFish
Use TwoFish as symmetrical cipher algorithm.
Definition: ZrtpCallback.h:69
Role
Role
This enum defines which role a ZRTP peer has.
Definition: ZrtpCallback.h:60
srtpSecrets::respKeyLen
int32_t respKeyLen
Responder's key length.
Definition: ZrtpCallback.h:90
srtpSecrets::keyInitiator
const uint8_t * keyInitiator
Initiator's key.
Definition: ZrtpCallback.h:85
__EXPORT
#define __EXPORT
Definition: ZrtpCallback.h:40
srtpSecrets::saltInitiator
const uint8_t * saltInitiator
Initiator's salt.
Definition: ZrtpCallback.h:87
srtpSecrets::respSaltLen
int32_t respSaltLen
Responder's salt length.
Definition: ZrtpCallback.h:92
srtpSecrets::keyResponder
const uint8_t * keyResponder
Responder's key.
Definition: ZrtpCallback.h:89
SrtpAlgorithms
SrtpAlgorithms
The algorihms that we support in SRTP and that ZRTP can negotiate.
Definition: ZrtpCallback.h:66
ZRtp
struct ZRtp ZRtp
Definition: ZrtpCWrapper.h:260
Aes
Use AES as symmetrical cipher algorithm.
Definition: ZrtpCallback.h:68
srtpSecrets::saltResponder
const uint8_t * saltResponder
Responder's salt.
Definition: ZrtpCallback.h:91
GnuZrtpCodes::MessageSeverity
MessageSeverity
Definition: ZrtpCodes.h:65
srtpSecrets::authAlgorithm
SrtpAlgorithms authAlgorithm
SRTP authentication algorithm.
Definition: ZrtpCallback.h:93
srtpSecrets::srtpAuthTagLen
int32_t srtpAuthTagLen
SRTP authentication length.
Definition: ZrtpCallback.h:94
Responder
This client is in ZRTP Responder mode.
Definition: ZrtpCallback.h:61
srtpSecrets::initSaltLen
int32_t initSaltLen
Initiator's salt length.
Definition: ZrtpCallback.h:88
ZrtpCallback::~ZrtpCallback
virtual ~ZrtpCallback()
Definition: ZrtpCallback.h:124
srtpSecrets::sas
std::string sas
The SAS string.
Definition: ZrtpCallback.h:95
Sha1
Use Sha1 as authentication algorithm.
Definition: ZrtpCallback.h:70
SrtpSecret_t
struct srtpSecrets SrtpSecret_t
This structure contains pointers to the SRTP secrets and the role info.

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 によって変換されたページ (->オリジナル) /