Skip to content
Snippets Groups Projects
Commit 4a8a06b5 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#4243] Add documentation to AudioSrtpSession

parent 6d2b3eb0
No related branches found
No related tags found
No related merge requests found
...@@ -78,30 +78,74 @@ class AudioSrtpSession : public ost::SymmetricRTPSession, public AudioRtpSession ...@@ -78,30 +78,74 @@ class AudioSrtpSession : public ost::SymmetricRTPSession, public AudioRtpSession
{ {
public: public:
/**
* Constructor for this rtp session
*/
AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall); AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall);
/**
* Used to get sdp crypto header to be included in sdp session. This
* method must be called befor setRemoteCryptoInfo in case of an
* outgoing call or after in case of an outgoing call.
*/
std::vector<std::string> getLocalCryptoInfo (void); std::vector<std::string> getLocalCryptoInfo (void);
/**
* Set remote crypto header from incoming sdp offer
*/
void setRemoteCryptoInfo (sfl::SdesNegotiator& nego); void setRemoteCryptoInfo (sfl::SdesNegotiator& nego);
/**
* Init local crypto context for outgoing data
* this method must be called before sending first Invite request
* with SDP offer.
*/
void initLocalCryptoInfo (void); void initLocalCryptoInfo (void);
private: private:
/**
* Init local master key according to current crypto context
* as defined in SdesNegotiator.h
*/
void initializeLocalMasterKey (void); void initializeLocalMasterKey (void);
/**
* Init local master salt according to current crypto context
* as defined in SdesNegotiator.h
*/
void initializeLocalMasterSalt (void); void initializeLocalMasterSalt (void);
/**
* Init remote crypto context in audio srtp session. This method
* must be called after unBase64ConcatenatedKeys.
*/
void initializeRemoteCryptoContext (void); void initializeRemoteCryptoContext (void);
/**
* Init local crypto context in audio srtp session. Make sure remote
* crypto context is set before calling this method for incoming calls.
*/
void initializeLocalCryptoContext (void); void initializeLocalCryptoContext (void);
/**
* Used to generate local keys to be included in SDP offer/answer.
*/
std::string getBase64ConcatenatedKeys(); std::string getBase64ConcatenatedKeys();
/**
* Used to retreive keys from base64 serialization
*/
void unBase64ConcatenatedKeys (std::string base64keys); void unBase64ConcatenatedKeys (std::string base64keys);
/**
* Encode input data as base64
*/
char* encodeBase64 (unsigned char *input, int length); char* encodeBase64 (unsigned char *input, int length);
/**
* Decode base64 data
*/
char* decodeBase64 (unsigned char *input, int length, int *length_out); char* decodeBase64 (unsigned char *input, int length, int *length_out);
/** Default local crypto suite is AES_CM_128_HMAC_SHA1_80*/ /** Default local crypto suite is AES_CM_128_HMAC_SHA1_80*/
...@@ -130,8 +174,10 @@ class AudioSrtpSession : public ost::SymmetricRTPSession, public AudioRtpSession ...@@ -130,8 +174,10 @@ class AudioSrtpSession : public ost::SymmetricRTPSession, public AudioRtpSession
/** remote master salt length in byte */ /** remote master salt length in byte */
int _remoteMasterSaltLength; int _remoteMasterSaltLength;
/** Remote srtp crypto context to be set into incoming data queue. */
ost::CryptoContext* _remoteCryptoCtx; ost::CryptoContext* _remoteCryptoCtx;
/** Local srtp crypto context to be set into outgoing data queue. */
ost::CryptoContext* _localCryptoCtx; ost::CryptoContext* _localCryptoCtx;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment