00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 2006 - 2007, Mikael Magnusson 00005 * 00006 * Mikael Magnusson <mikma@users.sourceforge.net> 00007 * 00008 * See http://www.asterisk.org for more information about 00009 * the Asterisk project. Please do not directly contact 00010 * any of the maintainers of this project for assistance; 00011 * the project provides a web site, mailing lists and IRC 00012 * channels for your use. 00013 * 00014 * This program is free software, distributed under the terms of 00015 * the GNU General Public License Version 2. See the LICENSE file 00016 * at the top of the source tree. 00017 */ 00018 00019 /*! \file sip_srtp.c 00020 * 00021 * \brief SIP Secure RTP (SRTP) 00022 * 00023 * Specified in RFC 3711 00024 * 00025 * \author Mikael Magnusson <mikma@users.sourceforge.net> 00026 */ 00027 00028 #include "asterisk.h" 00029 00030 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 268894 $") 00031 00032 #include "asterisk/utils.h" 00033 #include "include/srtp.h" 00034 00035 struct sip_srtp *sip_srtp_alloc(void) 00036 { 00037 struct sip_srtp *srtp; 00038 00039 srtp = ast_calloc(1, sizeof(*srtp)); 00040 00041 return srtp; 00042 } 00043 00044 void sip_srtp_destroy(struct sip_srtp *srtp) 00045 { 00046 if (srtp->crypto) { 00047 sdp_crypto_destroy(srtp->crypto); 00048 } 00049 srtp->crypto = NULL; 00050 ast_free(srtp); 00051 }