From 7b6e7703cdeeecae28552f589f249a6ab7f6c4d2 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 29 May 2014 14:20:50 +0200 Subject: Make typedef for framelists. Add some error handling in SRTP class. Make new instance protection mechanism for SRTP. Make some error handling in lrtp public API. --- src/srtp.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/srtp.h') diff --git a/src/srtp.h b/src/srtp.h index 3d8b697..66197bb 100644 --- a/src/srtp.h +++ b/src/srtp.h @@ -30,25 +30,36 @@ #include +#include "lrtp.h" #include "rtp.h" +#include "compat.h" #define MAX_KEY_LEN 64 #define MASTER_KEY_LEN 30 class SRTP { public: - SRTP(std::string key, unsigned int ssrc); + SRTP(std::string key, unsigned int ssrc) _throw(enum lrtp_status_t); ~SRTP(); - int encrypt(char *packet, size_t size); - int decrypt(char *packet, size_t size); + int encrypt(char *packet, size_t size) _throw(enum lrtp_status_t); + int decrypt(char *packet, size_t size) _throw(enum lrtp_status_t); private: + class SRTPInstance { + public: + SRTPInstance() _throw(enum lrtp_status_t); + ~SRTPInstance() _throw(enum lrtp_status_t); + }; + + SRTPInstance instance; + struct prv; struct prv *prv; - void setupKey(const std::string &key); - void setupPolicy(bool confidentiality, bool authentication); + void setupKey(const std::string &key) _throw(enum lrtp_status_t); + void setupPolicy(bool confidentiality, bool authentication) + _throw(enum lrtp_status_t); }; #endif/*__LRTP_SRTP_H__*/ -- cgit v1.2.3