1 diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/config.hw srtp/config.hw 2 --- srtp-pristine/config.hw 2007-05-23 13:40:21.000000000 -0400 3 +++ srtp/config.hw 2009-04-22 17:58:01.000000000 -0400 4 @@ -1,7 +1,7 @@ 5 /* crypto/include/config.h. Generated by configure. */ 6 /* config_in.h. Generated from configure.in by autoheader. */ 7 8 -#ifdef (_MSC_VER >= 1400) 9 +#if (_MSC_VER >= 1400) 10 # define HAVE_RAND_S 1 11 #endif 12 13 diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/crypto/cipher/aes_icm.c srtp/crypto/cipher/aes_icm.c 14 --- srtp-pristine/crypto/cipher/aes_icm.c 2006-07-18 15:45:46.000000000 -0400 15 +++ srtp/crypto/cipher/aes_icm.c 2009-04-22 17:58:01.000000000 -0400 16 @@ -210,7 +210,7 @@ aes_icm_set_octet(aes_icm_ctx_t *c, 17 ((high32(octet_num) & 0x0f)<<(32-4)) | 18 (low32(octet_num) >> 4)); 19 #else 20 - int tail_num = octet_num % 16; 21 + int tail_num = (int)(octet_num % 16); 22 uint64_t block_num = octet_num / 16; 23 #endif 24 25 diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/install-win.bat srtp/install-win.bat 26 --- srtp-pristine/install-win.bat 1969-12-31 19:00:00.000000000 -0500 27 +++ srtp/install-win.bat 2009-04-22 17:58:01.000000000 -0400 28 @@ -0,0 +1,31 @@ 29 +:: Installs from srtp windows build directory to directory specified on 30 +:: command line 31 + 32 + 33 +@if "%1"=="" ( 34 + echo "Usage: %~nx0 destdir" 35 + exit /b 1 36 +) else ( 37 + set destdir=%1 38 +) 39 + 40 +@if not exist %destdir% ( 41 + echo %destdir% not found 42 + exit /b 1 43 +) 44 + 45 +@for %%d in (include\srtp.h crypto\include\crypto.h Debug\srtp.lib Release\srtp.lib) do ( 46 + if not exist "%%d" ( 47 + echo "%%d not found: are you in the right directory?" 48 + exit /b 1 49 + ) 50 +) 51 + 52 +mkdir %destdir%\include 53 +mkdir %destdir%\include\srtp 54 +mkdir %destdir%\lib 55 + 56 +copy include\*.h %destdir%\include\srtp 57 +copy crypto\include\*.h %destdir%\include\srtp 58 +copy Release\srtp.lib %destdir%\lib\srtp.lib 59 +copy Debug\srtp.lib %destdir%\lib\srtpd.lib 60 diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp/ekt.c srtp/srtp/ekt.c 61 --- srtp-pristine/srtp/ekt.c 2007-06-15 14:36:09.000000000 -0400 62 +++ srtp/srtp/ekt.c 2009-04-22 18:47:06.000000000 -0400 63 @@ -91,27 +91,27 @@ ekt_octets_after_base_tag(ekt_stream_t e 64 } 65 66 inline ekt_spi_t 67 -srtcp_packet_get_ekt_spi(const void *packet_start, unsigned pkt_octet_len) { 68 - void *spi_location; 69 +srtcp_packet_get_ekt_spi(const uint8_t *packet_start, unsigned pkt_octet_len) { 70 + const uint8_t *spi_location; 71 72 spi_location = packet_start + (pkt_octet_len - EKT_SPI_LEN); 73 74 - return *((ekt_spi_t *)spi_location); 75 + return *((const ekt_spi_t *)spi_location); 76 } 77 78 inline uint32_t 79 -srtcp_packet_get_ekt_roc(const void *packet_start, unsigned pkt_octet_len) { 80 - void *roc_location; 81 +srtcp_packet_get_ekt_roc(const uint8_t *packet_start, unsigned pkt_octet_len) { 82 + const uint8_t *roc_location; 83 84 roc_location = packet_start + (pkt_octet_len - EKT_OCTETS_AFTER_ROC); 85 86 - return *((uint32_t *)roc_location); 87 + return *((const uint32_t *)roc_location); 88 } 89 90 -inline void * 91 -srtcp_packet_get_emk_location(const void *packet_start, 92 +inline const uint8_t * 93 +srtcp_packet_get_emk_location(const uint8_t *packet_start, 94 unsigned pkt_octet_len) { 95 - void *location; 96 + const uint8_t *location; 97 98 location = packet_start + (pkt_octet_len - EKT_OCTETS_AFTER_BASE_TAG); 99 100 @@ -161,7 +161,7 @@ srtp_stream_init_from_ekt(srtp_stream_t 101 const void *srtcp_hdr, 102 unsigned pkt_octet_len) { 103 err_status_t err; 104 - uint8_t *master_key; 105 + const uint8_t *master_key; 106 srtp_policy_t srtp_policy; 107 unsigned master_key_len; 108 uint32_t roc; 109 @@ -179,7 +179,7 @@ srtp_stream_init_from_ekt(srtp_stream_t 110 111 /* decrypt the Encrypted Master Key field */ 112 master_key = srtcp_packet_get_emk_location(srtcp_hdr, pkt_octet_len); 113 - aes_decrypt_with_raw_key(master_key, stream->ekt->data->ekt_dec_key); 114 + aes_decrypt_with_raw_key((void*)master_key, stream->ekt->data->ekt_dec_key); 115 116 /* set the SRTP ROC */ 117 roc = srtcp_packet_get_ekt_roc(srtcp_hdr, pkt_octet_len); 118 @@ -201,7 +201,7 @@ ekt_write_data(ekt_stream_t ekt, 119 uint32_t roc; 120 uint16_t isn; 121 unsigned emk_len; 122 - void *packet; 123 + uint8_t *packet; 124 125 /* if the pointer ekt is NULL, then EKT is not in effect */ 126 if (!ekt) { 127 @@ -211,7 +211,7 @@ ekt_write_data(ekt_stream_t ekt, 128 129 /* write zeros into the location of the base tag */ 130 octet_string_set_to_zero(base_tag, base_tag_len); 131 - packet = base_tag + base_tag_len; 132 + packet = (uint8_t*)base_tag + base_tag_len; 133 134 /* copy encrypted master key into packet */ 135 emk_len = ekt_octets_after_base_tag(ekt); 136 @@ -221,14 +221,14 @@ ekt_write_data(ekt_stream_t ekt, 137 packet += emk_len; 138 139 /* copy ROC into packet */ 140 - roc = pkt_index >> 16; 141 + roc = (uint32_t)(pkt_index >> 16); 142 *((uint32_t *)packet) = be32_to_cpu(roc); 143 debug_print(mod_srtp, "writing EKT ROC: %s,", 144 octet_string_hex_string(packet, sizeof(roc))); 145 packet += sizeof(roc); 146 147 /* copy ISN into packet */ 148 - isn = pkt_index; 149 + isn = (uint16_t)pkt_index; 150 *((uint16_t *)packet) = htons(isn); 151 debug_print(mod_srtp, "writing EKT ISN: %s,", 152 octet_string_hex_string(packet, sizeof(isn))); 153 diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp.def srtp/srtp.def 154 --- srtp-pristine/srtp.def 2006-05-22 16:46:21.000000000 -0400 155 +++ srtp/srtp.def 2009-04-22 17:58:01.000000000 -0400 156 @@ -89,4 +89,3 @@ aes_icm_encrypt_ismacryp 157 aes_icm_alloc_ismacryp 158 crypto_alloc 159 crypto_free 160 -\ No newline at end of file 161 \ No newline at end of file 162 diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp.sln srtp/srtp.sln 163 --- srtp-pristine/srtp.sln 1969-12-31 19:00:00.000000000 -0500 164 +++ srtp/srtp.sln 2009-04-22 17:58:01.000000000 -0400 165 @@ -0,0 +1,26 @@ 166 + 167 +Microsoft Visual Studio Solution File, Format Version 9.00 168 +# Visual C++ Express 2005 169 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srtp", "srtp.vcproj", "{EEF031CB-FED8-451E-A471-91EC8D4F6750}" 170 +EndProject 171 +Global 172 + GlobalSection(SolutionConfigurationPlatforms) = preSolution 173 + Debug Dll|Win32 = Debug Dll|Win32 174 + Debug|Win32 = Debug|Win32 175 + Release Dll|Win32 = Release Dll|Win32 176 + Release|Win32 = Release|Win32 177 + EndGlobalSection 178 + GlobalSection(ProjectConfigurationPlatforms) = postSolution 179 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug Dll|Win32.ActiveCfg = Debug Dll|Win32 180 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug Dll|Win32.Build.0 = Debug Dll|Win32 181 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32 182 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32 183 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release Dll|Win32.ActiveCfg = Release Dll|Win32 184 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release Dll|Win32.Build.0 = Release Dll|Win32 185 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32 186 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32 187 + EndGlobalSection 188 + GlobalSection(SolutionProperties) = preSolution 189 + HideSolutionNode = FALSE 190 + EndGlobalSection 191 +EndGlobal 192 diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp.vcproj srtp/srtp.vcproj 193 --- srtp-pristine/srtp.vcproj 2006-05-22 16:46:21.000000000 -0400 194 +++ srtp/srtp.vcproj 2009-04-22 17:58:01.000000000 -0400 195 @@ -49,7 +49,7 @@ 196 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H" 197 MinimalRebuild="true" 198 BasicRuntimeChecks="3" 199 - RuntimeLibrary="3" 200 + RuntimeLibrary="1" 201 StructMemberAlignment="0" 202 UsePrecompiledHeader="0" 203 WarningLevel="3" 204 @@ -116,7 +116,7 @@ 205 Name="VCCLCompilerTool" 206 AdditionalIncludeDirectories="crypto/include;include" 207 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H" 208 - RuntimeLibrary="2" 209 + RuntimeLibrary="0" 210 StructMemberAlignment="0" 211 UsePrecompiledHeader="0" 212 WarningLevel="3" 213 @@ -324,6 +324,10 @@ 214 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" 215 > 216 <File 217 + RelativePath=".\srtp\ekt.c" 218 + > 219 + </File> 220 + <File 221 RelativePath=".\srtp\srtp.c" 222 > 223 </File> 224 @@ -484,10 +488,6 @@ 225 > 226 </File> 227 <File 228 - RelativePath=".\crypto\include\crypto_math.h" 229 - > 230 - </File> 231 - <File 232 RelativePath=".\crypto\include\crypto_types.h" 233 > 234 </File> 235 @@ -500,6 +500,10 @@ 236 > 237 </File> 238 <File 239 + RelativePath=".\include\ekt.h" 240 + > 241 + </File> 242 + <File 243 RelativePath=".\crypto\include\err.h" 244 > 245 </File> 246 @@ -516,10 +520,6 @@ 247 > 248 </File> 249 <File 250 - RelativePath=".\crypto\include\kernel_compat.h" 251 - > 252 - </File> 253 - <File 254 RelativePath=".\crypto\include\key.h" 255 > 256 </File> 257 @@ -548,10 +548,6 @@ 258 > 259 </File> 260 <File 261 - RelativePath=".\include\rtp.h" 262 - > 263 - </File> 264 - <File 265 RelativePath=".\crypto\include\sha1.h" 266 > 267 </File> 268 @@ -560,15 +556,15 @@ 269 > 270 </File> 271 <File 272 - RelativePath=".\crypto\include\stat.h" 273 + RelativePath=".\include\srtp_priv.h" 274 > 275 </File> 276 <File 277 - RelativePath=".\include\ut_sim.h" 278 + RelativePath=".\crypto\include\stat.h" 279 > 280 </File> 281 <File 282 - RelativePath=".\crypto\include\xfm.h" 283 + RelativePath=".\include\ut_sim.h" 284 > 285 </File> 286 </Filter> 287 @@ -579,6 +575,10 @@ 288 > 289 </Filter> 290 <File 291 + RelativePath=".\config.hw" 292 + > 293 + </File> 294 + <File 295 RelativePath=".\srtp.def" 296 > 297 </File> 298