From 4a8a06b52ce649212bdcee899516d5bdfebd0d34 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandre.savard@savoirfairelinux.com> Date: Wed, 6 Oct 2010 15:07:07 -0400 Subject: [PATCH] [#4243] Add documentation to AudioSrtpSession --- .../src/audio/audiortp/AudioSrtpSession.h | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sflphone-common/src/audio/audiortp/AudioSrtpSession.h b/sflphone-common/src/audio/audiortp/AudioSrtpSession.h index 34e680f343..bc77019e43 100644 --- a/sflphone-common/src/audio/audiortp/AudioSrtpSession.h +++ b/sflphone-common/src/audio/audiortp/AudioSrtpSession.h @@ -78,30 +78,74 @@ class AudioSrtpSession : public ost::SymmetricRTPSession, public AudioRtpSession { public: + /** + * Constructor for this rtp session + */ 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); + /** + * Set remote crypto header from incoming sdp offer + */ 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); private: + /** + * Init local master key according to current crypto context + * as defined in SdesNegotiator.h + */ void initializeLocalMasterKey (void); + /** + * Init local master salt according to current crypto context + * as defined in SdesNegotiator.h + */ void initializeLocalMasterSalt (void); + /** + * Init remote crypto context in audio srtp session. This method + * must be called after unBase64ConcatenatedKeys. + */ 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); + /** + * Used to generate local keys to be included in SDP offer/answer. + */ std::string getBase64ConcatenatedKeys(); + /** + * Used to retreive keys from base64 serialization + */ void unBase64ConcatenatedKeys (std::string base64keys); + /** + * Encode input data as base64 + */ char* encodeBase64 (unsigned char *input, int length); + /** + * Decode base64 data + */ char* decodeBase64 (unsigned char *input, int length, int *length_out); /** Default local crypto suite is AES_CM_128_HMAC_SHA1_80*/ @@ -130,8 +174,10 @@ class AudioSrtpSession : public ost::SymmetricRTPSession, public AudioRtpSession /** remote master salt length in byte */ int _remoteMasterSaltLength; + /** Remote srtp crypto context to be set into incoming data queue. */ ost::CryptoContext* _remoteCryptoCtx; + /** Local srtp crypto context to be set into outgoing data queue. */ ost::CryptoContext* _localCryptoCtx; }; -- GitLab