[asterisk-commits] twilson: branch group/srtp r166504 - in /team/group/srtp: ./ build_tools/ cha...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 22 18:59:44 CST 2008
Author: twilson
Date: Mon Dec 22 18:59:43 2008
New Revision: 166504
URL: http://svn.digium.com/view/asterisk?view=rev&rev=166504
Log:
Remove MIKEY support from this branch. MIKEY support is still available at http://svn.digium.com/svn/asterisk/team/group/srtp_mikey
Removed:
team/group/srtp/channels/sdp_mikey.c
team/group/srtp/channels/sdp_mikey.h
team/group/srtp/include/asterisk/mikey.h
team/group/srtp/res/mikey.cc
team/group/srtp/res/mikey.h
team/group/srtp/res/res_mikey.c
Modified:
team/group/srtp/CREDITS
team/group/srtp/build_tools/menuselect-deps.in
team/group/srtp/channels/Makefile
team/group/srtp/channels/chan_sip.c
team/group/srtp/channels/sip_srtp.c
team/group/srtp/channels/sip_srtp.h
team/group/srtp/configure
team/group/srtp/configure.ac
team/group/srtp/include/asterisk/autoconfig.h.in
team/group/srtp/include/asterisk/rtp.h
team/group/srtp/main/cryptostub.c
team/group/srtp/main/rtp.c
team/group/srtp/makeopts.in
team/group/srtp/res/Makefile
team/group/srtp/res/res_srtp.c
Modified: team/group/srtp/CREDITS
URL: http://svn.digium.com/view/asterisk/team/group/srtp/CREDITS?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/CREDITS (original)
+++ team/group/srtp/CREDITS Mon Dec 22 18:59:43 2008
@@ -153,7 +153,7 @@
George Konstantoulakis - Support for Greek in voicemail added by InAccess
Networks (work funded by HOL, www.hol.gr) gkon(AT)inaccessnetworks.com
-Mikael Magnusson - Provided SRTP support in RTP, and SRTP and MIKEY support in the SIP channel
+Mikael Magnusson - Provided SRTP support in RTP, and SRTP support in the SIP channel
mikma at users.sourceforge.net
Daniel Nylander - Support for Swedish and Norwegian languages in voicemail.
Modified: team/group/srtp/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/group/srtp/build_tools/menuselect-deps.in?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/build_tools/menuselect-deps.in (original)
+++ team/group/srtp/build_tools/menuselect-deps.in Mon Dec 22 18:59:43 2008
@@ -20,11 +20,7 @@
LDAP=@PBX_LDAP@
LTDL=@PBX_LTDL@
LUA=@PBX_LUA@
-MCRYPTO=@PBX_MCRYPTO@
-MIKEY=@PBX_MIKEY@
MISDN=@PBX_MISDN@
-MNETUTIL=@PBX_MNETUTIL@
-MUTIL=@PBX_MUTIL@
NBS=@PBX_NBS@
NETSNMP=@PBX_NETSNMP@
NEWT=@PBX_NEWT@
Modified: team/group/srtp/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/srtp/channels/Makefile?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/channels/Makefile (original)
+++ team/group/srtp/channels/Makefile Mon Dec 22 18:59:43 2008
@@ -92,7 +92,7 @@
$(CMD_PREFIX) $(CXX) $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
endif
-chan_sip.so: sip_srtp.o sdp_crypto.o sdp_mikey.o
+chan_sip.so: sip_srtp.o sdp_crypto.o
chan_misdn.o: ASTCFLAGS+=-Imisdn
Modified: team/group/srtp/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/srtp/channels/chan_sip.c?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/channels/chan_sip.c (original)
+++ team/group/srtp/channels/chan_sip.c Mon Dec 22 18:59:43 2008
@@ -269,7 +269,6 @@
#include "sip_srtp.h"
#include "sdp_crypto.h"
-#include "sdp_mikey.h"
/*** DOCUMENTATION
<application name="SIPDtmfMode" language="en_US">
@@ -2520,7 +2519,6 @@
/*----- SRTP interface functions */
static int setup_srtp(struct sip_pvt *p);
static int process_crypto(struct sip_pvt *p, const char *a);
-static int process_mikey(struct sip_pvt *p, const char *a);
/*------ T38 Support --------- */
static int sip_handle_t38_reinvite(struct ast_channel *chan, struct sip_pvt *pvt, int reinvite);
@@ -4921,19 +4919,6 @@
ast_clear_flag(p->srtp, SRTP_CRYPTO_ENABLE);
} else {
ast_log(LOG_WARNING,"Invalid SIPSRTP_CRYPTO value (%s), enable or disable expected\n", ast_var_value(current));
- }
- } else if (!strcasecmp(ast_var_name(current), "SIPSRTP_MIKEY")) {
- if (!p->srtp && setup_srtp(p) < 0) {
- ast_log(LOG_WARNING, "SRTP setup failed\n");
- return -1;
- }
-
- if (!strcasecmp(ast_var_value(current), "enable")) {
- ast_set_flag(p->srtp, SRTP_MIKEY_ENABLE);
- } else if (!strcasecmp(ast_var_value(current), "disable")) {
- ast_clear_flag(p->srtp, SRTP_MIKEY_ENABLE);
- } else {
- ast_log(LOG_WARNING,"Invalid SIPSRTP_MIKEY value (%s), enable or disable expected\n", ast_var_value(current));
}
} else if (!strcasecmp(ast_var_name(current), "T38CALL")) {
p->t38.state = T38_LOCAL_DIRECT;
@@ -7675,7 +7660,7 @@
process_crypto(p, a);
continue;
} else if (!strncasecmp(a, "key-mgmt:mikey ", (size_t) 15)) {
- process_mikey(p, a);
+ ast_log(LOG_NOTICE, "Asterisk currently does not support MIKEY key negotiation\n");
continue;
} else if (!strcasecmp(a, "inactive")) {
if (sendonly == -1)
@@ -7777,7 +7762,7 @@
}
}
- if (secure_audio && !(p->srtp && (ast_test_flag(p->srtp, SRTP_CRYPTO_OFFER_OK) || ast_test_flag(p->srtp, SRTP_MIKEY_OFFER_OK)))) {
+ if (secure_audio && !(p->srtp && (ast_test_flag(p->srtp, SRTP_CRYPTO_OFFER_OK)))) {
ast_log(LOG_WARNING, "Can't provide secure audio requested in SDP offer\n");
return -2;
}
@@ -7893,7 +7878,7 @@
change_t38_state(p, T38_DISABLED);
}
- if (secure_video && !(p->srtp && (ast_test_flag(p->srtp, SRTP_CRYPTO_OFFER_OK) || ast_test_flag(p->srtp, SRTP_MIKEY_OFFER_OK)))) {
+ if (secure_video && !(p->srtp && (ast_test_flag(p->srtp, SRTP_CRYPTO_OFFER_OK)))) {
ast_log(LOG_WARNING, "Can't provide secure video requested in SDP offer\n");
return -2;
}
@@ -9104,7 +9089,6 @@
struct ast_str *a_video = ast_str_alloca(1024); /* Attributes for video */
struct ast_str *a_text = ast_str_alloca(1024); /* Attributes for text */
const char *a_crypto = NULL;
- const char *a_mikey = NULL;
int x;
int capability;
@@ -9173,9 +9157,7 @@
/* Set encryption properties */
if (srtp) {
- if (srtp->mikey) {
- a_mikey = sdp_mikey_attrib(srtp->mikey);
- } else if (srtp->crypto) {
+ if (srtp->crypto) {
a_crypto = sdp_crypto_attrib(srtp->crypto);
} else {
if (ast_test_flag(p->srtp, SRTP_CRYPTO_ENABLE)) {
@@ -9185,21 +9167,14 @@
a_crypto = sdp_crypto_attrib(srtp->crypto);
}
}
-
- if (ast_test_flag(p->srtp, SRTP_MIKEY_ENABLE)) {
- srtp->mikey = sdp_mikey_setup(p->peersecret, p->rtp);
- if (srtp->mikey && (sdp_mikey_offer(srtp->mikey, p->rtp) >= 0)) {
- a_mikey = sdp_mikey_attrib(srtp->mikey);
- }
- }
- }
-
- if (!a_crypto && !a_mikey) {
- ast_log(LOG_WARNING, "No SRTP key management enabled (MIKEY or CRYPTO)\n");
- }
- }
-
- if ((a_crypto || a_mikey) && !ast_test_flag(srtp, SRTP_ENCR_OPTIONAL)) {
+ }
+
+ if (!a_crypto) {
+ ast_log(LOG_WARNING, "No SRTP key management enabled\n");
+ }
+ }
+
+ if ((a_crypto) && !ast_test_flag(srtp, SRTP_ENCR_OPTIONAL)) {
protocol = "SAVP";
} else {
protocol = "AVP";
@@ -9377,9 +9352,6 @@
}
}
- if (a_mikey)
- len += strlen(a_mikey);
-
add_header(resp, "Content-Type", "application/sdp");
add_header_contentLength(resp, len);
add_line(resp, version);
@@ -9403,9 +9375,6 @@
add_line(resp, m_text->str);
add_line(resp, a_text->str);
add_line(resp, hold); /* Repeat hold for the text stream */
- }
- if (a_mikey) {
- add_line(resp, a_mikey);
}
if (a_crypto) {
add_line(resp, a_crypto);
@@ -23952,34 +23921,6 @@
return 0;
}
-static int process_mikey(struct sip_pvt *p, const char *a)
-{
- if (!p->srtp) {
- if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
- ast_log(LOG_WARNING, "Ignoring unexpected mikey attribute in SDP answer\n");
- return -1;
- }
-
- if (setup_srtp(p) < 0) {
- ast_log(LOG_WARNING, "Can't setup crypto\n");
- return -1;
- }
- }
-
- if (!(p->srtp->mikey = sdp_mikey_setup(p->peersecret, p->rtp))) {
- ast_log(LOG_WARNING, "Can't setup MIKEY\n");
- return -1;
- }
-
- if (sdp_mikey_process(p->srtp->mikey, a + 15, p->rtp) < 0) {
- return -1;
- }
-
- ast_set_flag(p->srtp, SRTP_MIKEY_OFFER_OK);
-
- return -1;
-}
-
/*! \brief Send all MWI subscriptions */
static void sip_send_all_mwi_subscriptions(void)
{
@@ -24090,7 +24031,6 @@
static int load_module(void)
{
ast_verbose("SIP channel loading...\n");
- sdp_mikey_init();
/* the fact that ao2_containers can't resize automatically is a major worry! */
/* if the number of objects gets above MAX_XXX_BUCKETS, things will slow down */
peers = ao2_t_container_alloc(hash_peer_size, peer_hash_cb, peer_cmp_cb, "allocate peers");
@@ -24297,8 +24237,6 @@
ast_unload_realtime("sipregs");
ast_unload_realtime("sippeers");
- sdp_mikey_uninit();
-
return 0;
}
Modified: team/group/srtp/channels/sip_srtp.c
URL: http://svn.digium.com/view/asterisk/team/group/srtp/channels/sip_srtp.c?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/channels/sip_srtp.c (original)
+++ team/group/srtp/channels/sip_srtp.c Mon Dec 22 18:59:43 2008
@@ -48,9 +48,4 @@
sdp_crypto_destroy(srtp->crypto);
}
srtp->crypto = NULL;
-
- if (srtp->mikey) {
- sdp_mikey_destroy(srtp->mikey);
- }
- srtp->mikey = NULL;
}
Modified: team/group/srtp/channels/sip_srtp.h
URL: http://svn.digium.com/view/asterisk/team/group/srtp/channels/sip_srtp.h?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/channels/sip_srtp.h (original)
+++ team/group/srtp/channels/sip_srtp.h Mon Dec 22 18:59:43 2008
@@ -29,20 +29,16 @@
#define _SIP_SRTP_H
#include "sdp_crypto.h"
-#include "sdp_mikey.h"
/* SRTP flags */
#define SRTP_ENCR_OPTIONAL (1<<1) /* SRTP encryption optional */
-#define SRTP_CRYPTO_ENABLE (1<<3)
-#define SRTP_MIKEY_ENABLE (1<<4)
-#define SRTP_CRYPTO_OFFER_OK (1<<5)
-#define SRTP_MIKEY_OFFER_OK (1<<6)
+#define SRTP_CRYPTO_ENABLE (1<<2)
+#define SRTP_CRYPTO_OFFER_OK (1<<3)
/*! \brief structure for secure RTP audio */
struct sip_srtp {
unsigned int flags;
struct sdp_crypto *crypto;
- struct sdp_mikey *mikey;
};
/*!
@@ -58,17 +54,4 @@
*/
void sip_srtp_destroy(struct sip_srtp *srtp);
-#if 0
-struct sip_sdp_keymgmt {
- int (*init)(void);
- void (*uninit)(void);
- struct sdp_keymgmt *(*setup)(const char *peersecret, struct ast_rtp *rtp);
- void (*destroy)(struct sdp_keymgmt *p);
- int (*offer)(struct sdp_keymgmt *p, struct ast_rtp *rtp);
- const char *(*attrib)(struct sdp_keymgmt *p);
- /* FIX attr offset */
- int (*process)(struct sdp_keymgmt *p, const char *attr, struct ast_rtp *rtp);
-};
-#endif
-
#endif /* _SIP_SRTP_H */
Modified: team/group/srtp/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/srtp/configure.ac?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/configure.ac (original)
+++ team/group/srtp/configure.ac Mon Dec 22 18:59:43 2008
@@ -246,11 +246,7 @@
AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
AST_EXT_LIB_SETUP([LTDL], [libtool], [ltdl])
AST_EXT_LIB_SETUP([LUA], [Lua], [lua])
-AST_EXT_LIB_SETUP([MCRYPTO], [Minisip Cryptography Library], [mcrypto])
-AST_EXT_LIB_SETUP([MIKEY], [Minisip Multimedia Internet Keying], [mikey])
AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
-AST_EXT_LIB_SETUP([MNETUTIL], [Minisip Network Utility Toolkit], [mnetutil])
-AST_EXT_LIB_SETUP([MUTIL], [Minisip Utility Toolkit], [mutil])
AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
@@ -1593,11 +1589,6 @@
fi
fi
-AST_EXT_LIB_CHECK([MUTIL], [mutil], [], [libmutil/stringutils.h], [-lmutil])
-AST_EXT_LIB_CHECK([MNETUTIL], [mnetutil], [], [libmnetutil/init.h], [-lmnetutil])
-AST_EXT_LIB_CHECK([MCRYPTO], [mcrypto], [], [libmcrypto/SipSimSoft.h], [-lmcrypto])
-AST_EXT_LIB_CHECK([MIKEY], [mikey], [], [libmikey/Mikey.h], [-lmikey])
-
AC_LANG_POP
AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
Modified: team/group/srtp/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/group/srtp/include/asterisk/autoconfig.h.in?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/include/asterisk/autoconfig.h.in (original)
+++ team/group/srtp/include/asterisk/autoconfig.h.in Mon Dec 22 18:59:43 2008
@@ -494,12 +494,6 @@
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
-/* Define this to indicate the ${MCRYPTO_DESCRIP} library */
-#undef HAVE_MCRYPTO
-
-/* Define to indicate the ${MCRYPTO_DESCRIP} library version */
-#undef HAVE_MCRYPTO_VERSION
-
/* Define to 1 if you have the `memchr' function. */
#undef HAVE_MEMCHR
@@ -512,12 +506,6 @@
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define this to indicate the ${MIKEY_DESCRIP} library */
-#undef HAVE_MIKEY
-
-/* Define to indicate the ${MIKEY_DESCRIP} library version */
-#undef HAVE_MIKEY_VERSION
-
/* Define this to indicate the ${MISDN_DESCRIP} library */
#undef HAVE_MISDN
@@ -542,20 +530,8 @@
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
-/* Define this to indicate the ${MNETUTIL_DESCRIP} library */
-#undef HAVE_MNETUTIL
-
-/* Define to indicate the ${MNETUTIL_DESCRIP} library version */
-#undef HAVE_MNETUTIL_VERSION
-
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
-
-/* Define this to indicate the ${MUTIL_DESCRIP} library */
-#undef HAVE_MUTIL
-
-/* Define to indicate the ${MUTIL_DESCRIP} library version */
-#undef HAVE_MUTIL_VERSION
/* Define this to indicate the ${NBS_DESCRIP} library */
#undef HAVE_NBS
@@ -1266,6 +1242,9 @@
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
/* Define like PROTOTYPES; this can be used by system headers. */
#undef __PROTOTYPES
Modified: team/group/srtp/include/asterisk/rtp.h
URL: http://svn.digium.com/view/asterisk/team/group/srtp/include/asterisk/rtp.h?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/include/asterisk/rtp.h (original)
+++ team/group/srtp/include/asterisk/rtp.h Mon Dec 22 18:59:43 2008
@@ -145,29 +145,11 @@
AST_F8_128_HMAC_SHA1_80 = 3
};
-enum ast_srtp_ealg {
- AST_MIKEY_SRTP_EALG_NULL = 0,
- AST_MIKEY_SRTP_EALG_AESCM = 1
-};
-
-enum ast_srtp_aalg {
- AST_MIKEY_SRTP_AALG_NULL = 0,
- AST_MIKEY_SRTP_AALG_SHA1HMAC = 1
-};
-
struct ast_srtp_policy_res {
struct ast_srtp_policy *(*alloc)(void);
void (*destroy)(struct ast_srtp_policy *policy);
int (*set_suite)(struct ast_srtp_policy *policy, enum ast_srtp_suite suite);
int (*set_master_key)(struct ast_srtp_policy *policy, const unsigned char *key, size_t key_len, const unsigned char *salt, size_t salt_len);
- int (*set_encr_alg)(struct ast_srtp_policy *policy, enum ast_srtp_ealg ealg);
- int (*set_auth_alg)(struct ast_srtp_policy *policy, enum ast_srtp_aalg aalg);
- void (*set_encr_keylen)(struct ast_srtp_policy *policy, int ekeyl);
- void (*set_auth_keylen)(struct ast_srtp_policy *policy, int akeyl);
- void (*set_srtp_auth_taglen)(struct ast_srtp_policy *policy, int autht);
- void (*set_srtp_encr_enable)(struct ast_srtp_policy *policy, int enable);
- void (*set_srtcp_encr_enable)(struct ast_srtp_policy *policy, int enable);
- void (*set_srtp_auth_enable)(struct ast_srtp_policy *policy, int enable);
void (*set_ssrc)(struct ast_srtp_policy *policy, unsigned long ssrc, int inbound);
};
@@ -378,11 +360,6 @@
struct ast_srtp_policy *ast_srtp_policy_alloc(void);
int ast_srtp_policy_set_suite(struct ast_srtp_policy *policy, enum ast_srtp_suite suite);
int ast_srtp_policy_set_master_key(struct ast_srtp_policy *policy, const unsigned char *key, size_t key_len, const unsigned char *salt, size_t salt_len);
-int ast_srtp_policy_set_encr_alg(struct ast_srtp_policy *policy, enum ast_srtp_ealg ealg);
-int ast_srtp_policy_set_auth_alg(struct ast_srtp_policy *policy, enum ast_srtp_aalg aalg);
-void ast_srtp_policy_set_encr_keylen(struct ast_srtp_policy *policy, int ekeyl);
-void ast_srtp_policy_set_auth_keylen(struct ast_srtp_policy *policy, int akeyl);
-void ast_srtp_policy_set_srtp_auth_taglen(struct ast_srtp_policy *policy, int autht);
void ast_srtp_policy_set_srtp_encr_enable(struct ast_srtp_policy *policy, int enable);
void ast_srtp_policy_set_srtcp_encr_enable(struct ast_srtp_policy *policy, int enable);
void ast_srtp_policy_set_srtp_auth_enable(struct ast_srtp_policy *policy, int enable);
Modified: team/group/srtp/main/cryptostub.c
URL: http://svn.digium.com/view/asterisk/team/group/srtp/main/cryptostub.c?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/main/cryptostub.c (original)
+++ team/group/srtp/main/cryptostub.c Mon Dec 22 18:59:43 2008
@@ -28,7 +28,6 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/crypto.h"
-#include "asterisk/mikey.h"
#include "asterisk/logger.h"
static struct ast_key *stub_ast_key_get(const char *kname, int ktype)
@@ -67,26 +66,3 @@
build_stub(ast_sign_bin, struct ast_key *key, const char *msg, int msglen, unsigned char *sig);
build_stub(ast_encrypt_bin, unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);
build_stub(ast_decrypt_bin, unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);
-
-static struct ast_mikey_res *g_ast_mikey_res = NULL;
-
-int ast_register_mikey(struct ast_mikey_res *mikey_res)
-{
- g_ast_mikey_res = mikey_res;
- return 0;
-}
-
-int ast_unregister_mikey(struct ast_mikey_res *mikey_res)
-{
- if (g_ast_mikey_res == mikey_res) {
- g_ast_mikey_res = NULL;
- return 0;
- }
-
- return -1;
-}
-
-struct ast_mikey_res *ast_get_mikey(void)
-{
- return g_ast_mikey_res;
-}
Modified: team/group/srtp/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/group/srtp/main/rtp.c?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/main/rtp.c (original)
+++ team/group/srtp/main/rtp.c Mon Dec 22 18:59:43 2008
@@ -1229,79 +1229,6 @@
}
return g_policy_res->set_master_key(policy, key, key_len, salt, salt_len);
-}
-
-int ast_srtp_policy_set_encr_alg(struct ast_srtp_policy *policy, enum ast_srtp_ealg ealg)
-{
- if (!g_policy_res) {
- return -1;
- }
-
- return g_policy_res->set_encr_alg(policy, ealg);
-}
-
-int ast_srtp_policy_set_auth_alg(struct ast_srtp_policy *policy, enum ast_srtp_aalg aalg)
-{
- if (!g_policy_res) {
- return -1;
- }
-
- return g_policy_res->set_auth_alg(policy, aalg);
-}
-
-void ast_srtp_policy_set_encr_keylen(struct ast_srtp_policy *policy, int ekeyl)
-{
- if (!g_policy_res) {
- return;
- }
-
- g_policy_res->set_encr_keylen(policy, ekeyl);
-}
-
-void ast_srtp_policy_set_auth_keylen(struct ast_srtp_policy *policy, int akeyl)
-{
- if (!g_policy_res) {
- return;
- }
-
- g_policy_res->set_auth_keylen(policy, akeyl);
-}
-
-void ast_srtp_policy_set_srtp_auth_taglen(struct ast_srtp_policy *policy, int autht)
-{
- if (!g_policy_res) {
- return;
- }
-
- g_policy_res->set_srtp_auth_taglen(policy, autht);
-}
-
-void ast_srtp_policy_set_srtp_encr_enable(struct ast_srtp_policy *policy, int enable)
-{
- if (!g_policy_res) {
- return;
- }
-
- g_policy_res->set_srtp_encr_enable(policy, enable);
-}
-
-void ast_srtp_policy_set_srtcp_encr_enable(struct ast_srtp_policy *policy, int enable)
-{
- if (!g_policy_res) {
- return;
- }
-
- g_policy_res->set_srtcp_encr_enable(policy, enable);
-}
-
-void ast_srtp_policy_set_srtp_auth_enable(struct ast_srtp_policy *policy,
- int enable)
-{
- if (!g_policy_res) {
- return;
- }
-
- g_policy_res->set_srtp_auth_enable(policy, enable);
}
int ast_srtp_get_random(unsigned char *key, size_t len)
Modified: team/group/srtp/makeopts.in
URL: http://svn.digium.com/view/asterisk/team/group/srtp/makeopts.in?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/makeopts.in (original)
+++ team/group/srtp/makeopts.in Mon Dec 22 18:59:43 2008
@@ -121,18 +121,6 @@
LUA_INCLUDE=@LUA_INCLUDE@
LUA_LIB=@LUA_LIB@
-MUTIL_INCLUDE=@MUTIL_INCLUDE@
-MUTIL_LIB=@MUTIL_LIB@
-
-MNETUTIL_INCLUDE=@MNETUTIL_INCLUDE@
-MNETUTIL_LIB=@MNETUTIL_LIB@
-
-MCRYPTO_INCLUDE=@MCRYPTO_INCLUDE@
-MCRYPTO_LIB=@MCRYPTO_LIB@
-
-MIKEY_INCLUDE=@MIKEY_INCLUDE@
-MIKEY_LIB=@MIKEY_LIB@
-
NBS_INCLUDE=@NBS_INCLUDE@
NBS_LIB=@NBS_LIB@
Modified: team/group/srtp/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/srtp/res/Makefile?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/res/Makefile (original)
+++ team/group/srtp/res/Makefile Mon Dec 22 18:59:43 2008
@@ -43,10 +43,6 @@
$(if $(filter res_snmp,$(EMBEDDED_MODS)),modules.link,res_snmp.so): snmp/agent.o
-mikey.oo: ASTCFLAGS+=$(MUTIL_INCLUDE) $(MCRYPTO_INCLUDE) $(MIKEY_INCLUDE)
-res_mikey.so: res_mikey.o mikey.oo
-res_mikey.so: LIBS+=$(MIKEY_LIB) $(MCRYPTO_LIB) $(MUTIL_LIB)
-
$(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o
ael/ael_lex.c:
Modified: team/group/srtp/res/res_srtp.c
URL: http://svn.digium.com/view/asterisk/team/group/srtp/res/res_srtp.c?view=diff&rev=166504&r1=166503&r2=166504
==============================================================================
--- team/group/srtp/res/res_srtp.c (original)
+++ team/group/srtp/res/res_srtp.c Mon Dec 22 18:59:43 2008
@@ -34,11 +34,11 @@
/* The SIP channel will automatically use sdescriptions if received in a SDP offer,
and res_srtp is loaded. SRTP with sdescriptions key exchange can be activated
- in outgoing offers by setting _SIP_SRTP_SDES=1 in extension.conf before executing Dial
+ in outgoing offers by setting _SIPSRTP_CRYPTO=enable in extension.conf before executing Dial
The dial fails if the callee doesn't support SRTP and sdescriptions.
- exten => 2345,1,Set(_SIP_SRTP_SDES=1)
+ exten => 2345,1,Set(_SIPSRTP_CRYPTO=enable)
exten => 2345,2,Dial(SIP/1001)
NOTE: Since chan_sip does not support TLS, this is just a first step
@@ -87,14 +87,6 @@
static void res_srtp_policy_destroy(struct ast_srtp_policy *policy);
static int res_srtp_policy_set_suite(struct ast_srtp_policy *policy, enum ast_srtp_suite suite);
static int res_srtp_policy_set_master_key(struct ast_srtp_policy *policy, const unsigned char *key, size_t key_len, const unsigned char *salt, size_t salt_len);
-static int res_srtp_policy_set_encr_alg(struct ast_srtp_policy *policy, enum ast_srtp_ealg ealg);
-static int res_srtp_policy_set_auth_alg(struct ast_srtp_policy *policy, enum ast_srtp_aalg aalg);
-static void res_srtp_policy_set_encr_keylen(struct ast_srtp_policy *policy, int ekeyl);
-static void res_srtp_policy_set_auth_keylen(struct ast_srtp_policy *policy, int akeyl);
-static void res_srtp_policy_set_srtp_auth_taglen(struct ast_srtp_policy *policy, int autht);
-static void res_srtp_policy_set_srtp_encr_enable(struct ast_srtp_policy *policy, int enable);
-static void res_srtp_policy_set_srtcp_encr_enable(struct ast_srtp_policy *policy, int enable);
-static void res_srtp_policy_set_srtp_auth_enable(struct ast_srtp_policy *policy, int enable);
static void res_srtp_policy_set_ssrc(struct ast_srtp_policy *policy, unsigned long ssrc, int inbound);
static struct ast_srtp_res srtp_res = {
@@ -112,14 +104,6 @@
.destroy = res_srtp_policy_destroy,
.set_suite = res_srtp_policy_set_suite,
.set_master_key = res_srtp_policy_set_master_key,
- .set_encr_alg = res_srtp_policy_set_encr_alg,
- .set_auth_alg = res_srtp_policy_set_auth_alg,
- .set_encr_keylen = res_srtp_policy_set_encr_keylen,
- .set_auth_keylen = res_srtp_policy_set_auth_keylen,
- .set_srtp_auth_taglen = res_srtp_policy_set_srtp_auth_taglen,
- .set_srtp_encr_enable = res_srtp_policy_set_srtp_encr_enable,
- .set_srtcp_encr_enable = res_srtp_policy_set_srtcp_encr_enable,
- .set_srtp_auth_enable = res_srtp_policy_set_srtp_auth_enable,
.set_ssrc = res_srtp_policy_set_ssrc
};
@@ -281,88 +265,6 @@
return 0;
}
-static int res_srtp_policy_set_encr_alg(struct ast_srtp_policy *policy, enum ast_srtp_ealg ealg)
-{
- int type = -1;
-
- switch (ealg) {
- case AST_MIKEY_SRTP_EALG_NULL:
- type = NULL_CIPHER;
- break;
- case AST_MIKEY_SRTP_EALG_AESCM:
- type = AES_128_ICM;
- break;
- default:
- return -1;
- }
-
- policy->sp.rtp.cipher_type = type;
- policy->sp.rtcp.cipher_type = type;
-
- return 0;
-}
-
-static int res_srtp_policy_set_auth_alg(struct ast_srtp_policy *policy, enum ast_srtp_aalg aalg)
-{
- int type = -1;
-
- switch (aalg) {
- case AST_MIKEY_SRTP_AALG_NULL:
- type = NULL_AUTH;
- break;
- case AST_MIKEY_SRTP_AALG_SHA1HMAC:
- type = HMAC_SHA1;
- break;
- default:
- return -1;
- }
-
- policy->sp.rtp.auth_type = type;
- policy->sp.rtcp.auth_type = type;
-
- return 0;
-}
-
-static void res_srtp_policy_set_encr_keylen(struct ast_srtp_policy *policy, int ekeyl)
-{
- policy->sp.rtp.cipher_key_len = ekeyl;
- policy->sp.rtcp.cipher_key_len = ekeyl;
-}
-
-static void res_srtp_policy_set_auth_keylen(struct ast_srtp_policy *policy, int akeyl)
-{
- policy->sp.rtp.auth_key_len = akeyl;
- policy->sp.rtcp.auth_key_len = akeyl;
-}
-
-static void res_srtp_policy_set_srtp_auth_taglen(struct ast_srtp_policy *policy, int autht)
-{
- policy->sp.rtp.auth_tag_len = autht;
- policy->sp.rtcp.auth_tag_len = autht;
-
-}
-
-static void res_srtp_policy_set_srtp_encr_enable(struct ast_srtp_policy *policy, int enable)
-{
- int serv = enable ? sec_serv_conf : sec_serv_none;
-
- policy->sp.rtp.sec_serv = (policy->sp.rtp.sec_serv & ~sec_serv_conf) | serv;
-}
-
-static void res_srtp_policy_set_srtcp_encr_enable(struct ast_srtp_policy *policy, int enable)
-{
- int serv = enable ? sec_serv_conf : sec_serv_none;
-
- policy->sp.rtcp.sec_serv = (policy->sp.rtcp.sec_serv & ~sec_serv_conf) | serv;
-}
-
-static void res_srtp_policy_set_srtp_auth_enable(struct ast_srtp_policy *policy, int enable)
-{
- int serv = enable ? sec_serv_auth : sec_serv_none;
-
- policy->sp.rtp.sec_serv = (policy->sp.rtp.sec_serv & ~sec_serv_auth) | serv;
-}
-
static int res_srtp_get_random(unsigned char *key, size_t len)
{
return crypto_get_random(key, len) != err_status_ok ? -1: 0;
More information about the asterisk-commits
mailing list