Permalink
Browse files

works on vc7++, cuurently an exe target, must point project to openss…

…l. Copy config.h_win32vc7 to config.h
  • Loading branch information...
Derek MacDonald
Derek MacDonald committed Jul 12, 2006
1 parent 3c45e0c commit 17127da0dc383db8e2e33d5c3c0d4d346a2f8dda
View
@@ -1,4 +1,7 @@
+Debug
Makefile
+Root
+autom4te.cache
config.log
config.status
-autom4te.cache
+fixcvs.sh
View
@@ -1358,7 +1358,7 @@ static uint32_t U4[256] = {
extern debug_module_t mod_aes_icm;
-inline void
+void
aes_expand_encryption_key(const v128_t *key,
aes_expanded_key_t expanded_key) {
int i;
@@ -1411,7 +1411,7 @@ aes_expand_encryption_key(const v128_t *key,
}
}
-inline void
+void
aes_expand_decryption_key(const v128_t *key,
aes_expanded_key_t expanded_key) {
int i;
View
@@ -68,7 +68,7 @@ aes_cbc_alloc(cipher_t **c, int key_len) {
/* allocate memory a cipher of type aes_icm */
tmp = (sizeof(aes_cbc_ctx_t) + sizeof(cipher_t));
- pointer = crypto_alloc(tmp);
+ pointer = (uint8_t*)crypto_alloc(tmp);
if (pointer == NULL)
return err_status_alloc_fail;
@@ -135,7 +135,7 @@ err_status_t
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv) {
int i;
/* v128_t *input = iv; */
- uint8_t *input = iv;
+ uint8_t *input = (uint8_t*) iv;
/* set state and 'previous' block to iv */
for (i=0; i < 16; i++)
View
@@ -109,7 +109,7 @@ aes_icm_alloc_ismacryp(cipher_t **c, int key_len, int forIsmacryp) {
/* allocate memory a cipher of type aes_icm */
tmp = (sizeof(aes_icm_ctx_t) + sizeof(cipher_t));
- pointer = crypto_alloc(tmp);
+ pointer = (uint8_t*)crypto_alloc(tmp);
if (pointer == NULL)
return err_status_alloc_fail;
@@ -256,7 +256,7 @@ aes_icm_set_octet(aes_icm_ctx_t *c,
err_status_t
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv) {
- v128_t *nonce = iv;
+ v128_t *nonce = (v128_t *) iv;
debug_print(mod_aes_icm,
"setting iv: %s", v128_hex_string(nonce));
View
@@ -383,7 +383,7 @@ cipher_bits_per_second(cipher_t *c, int octets_in_buffer, int num_trials) {
unsigned char *enc_buf;
unsigned int len = octets_in_buffer;
- enc_buf = crypto_alloc(octets_in_buffer);
+ enc_buf = (unsigned char*) crypto_alloc(octets_in_buffer);
if (enc_buf == NULL)
return 0; /* indicate bad parameters by returning null */
@@ -61,7 +61,7 @@ null_cipher_alloc(cipher_t **c, int key_len) {
"allocating cipher with key length %d", key_len);
/* allocate memory a cipher of type null_cipher */
- pointer = crypto_alloc(sizeof(null_cipher_ctx_t) + sizeof(cipher_t));
+ pointer = (uint8_t*)crypto_alloc(sizeof(null_cipher_ctx_t) + sizeof(cipher_t));
if (pointer == NULL)
return err_status_alloc_fail;
View
@@ -74,7 +74,7 @@ hmac_alloc(auth_t **a, int key_len, int out_len) {
return err_status_bad_param;
/* allocate memory for auth and hmac_ctx_t structures */
- pointer = crypto_alloc(sizeof(hmac_ctx_t) + sizeof(auth_t));
+ pointer = (uint8_t*)crypto_alloc(sizeof(hmac_ctx_t) + sizeof(auth_t));
if (pointer == NULL)
return err_status_alloc_fail;
@@ -180,7 +180,7 @@ hmac_compute(hmac_ctx_t *state, const void *message,
return err_status_bad_param;
/* hash message, copy output into H */
- hmac_update(state, message, msg_octets);
+ hmac_update(state, (const uint8_t*)message, msg_octets);
sha1_final(&state->ctx, H);
/*
View
@@ -61,7 +61,7 @@ null_auth_alloc(auth_t **a, int key_len, int out_len) {
debug_print(mod_auth, " tag length %d", out_len);
/* allocate memory for auth and null_auth_ctx_t structures */
- pointer = crypto_alloc(sizeof(null_auth_ctx_t) + sizeof(auth_t));
+ pointer = (uint8_t*)crypto_alloc(sizeof(null_auth_ctx_t) + sizeof(auth_t));
if (pointer == NULL)
return err_status_alloc_fail;
View
@@ -55,11 +55,11 @@
typedef v128_t aes_expanded_key_t[11];
-inline void
+void
aes_expand_encryption_key(const v128_t *key,
aes_expanded_key_t expanded_key);
-inline void
+void
aes_expand_decryption_key(const v128_t *key,
aes_expanded_key_t expanded_key);
View
@@ -178,7 +178,7 @@ typedef struct cipher_t {
(((c)->type)->decrypt(((c)->state), (buf), (len)))
#define cipher_set_iv(c, n) \
- ((c) ? (((c)->type)->set_iv(((c)->state), (n))) : \
+ ((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n))) : \
err_status_no_such_op)
err_status_t
@@ -47,7 +47,6 @@
#ifndef _DATATYPES_H
#define _DATATYPES_H
-#include "integers.h" /* definitions of uint32_t, et cetera */
#include "alloc.h"
#include <stdarg.h>
@@ -62,6 +61,8 @@
# include <winsock2.h>
# endif
#endif
+#include "integers.h" /* definitions of uint32_t, et cetera */
+
/* if DATATYPES_USE_MACROS is defined, then little functions are macros */
#define DATATYPES_USE_MACROS
@@ -313,7 +314,7 @@ v128_right_shift(v128_t *x, int index);
#ifdef DATATYPES_USE_MACROS /* little functions are really macros */
-
+
#define v128_set_to_zero(z) _v128_set_to_zero(z)
#define v128_copy(z, x) _v128_copy(z, x)
#define v128_xor(z, x, y) _v128_xor(z, x, y)
View
@@ -106,7 +106,7 @@ nibble_to_hex_char(uint8_t nibble) {
char *
octet_string_hex_string(const void *s, int length) {
- const uint8_t *str = s;
+ const uint8_t *str = (const uint8_t *)s;
int i;
/* double length, since one octet takes two hex characters */
View
@@ -208,7 +208,7 @@ stat_test_rand_source(rand_source_func_t get_rand_bytes) {
uint16_t gaps[6] = { 0, 0, 0, 0, 0, 0 };
uint16_t lo_value[6] = { 2315, 1114, 527, 240, 103, 103 };
uint16_t hi_value[6] = { 2685, 1386, 723, 384, 209, 209 };
- int16_t state = 0;
+ int state = 0;
uint16_t mask;
/* counters for monobit, poker, and runs tests are initialized above */
View
@@ -92,7 +92,7 @@ ctr_prng_get_octet_string(void *dest, uint32_t len) {
/*
* write prng output
*/
- status = aes_icm_output(&ctr_prng.state, dest, len);
+ status = aes_icm_output(&ctr_prng.state, (uint8_t*)dest, len);
if (status)
return status;
View
@@ -125,7 +125,7 @@ rand_source_get_octet_string(void *dest, uint32_t len) {
#else
/* Generic C-library (rand()) version */
/* This is a random source of last resort */
- uint8_t *dst = dest;
+ uint8_t *dst = (uint8_t *)dest;
while (len)
{
int val = rand();
View
@@ -902,7 +902,6 @@ srtp_install_event_handler(srtp_event_handler_func_t func);
/**
* @}
*/
-
/* in host order, so outside the #if */
#define SRTCP_E_BIT 0x80000000
/* for byte-access */
View
@@ -114,7 +114,7 @@ srtp_stream_alloc(srtp_stream_ctx_t **str_ptr,
}
/* allocate key limit structure */
- str->limit = crypto_alloc(sizeof(key_limit_ctx_t));
+ str->limit = (key_limit_ctx_t*) crypto_alloc(sizeof(key_limit_ctx_t));
if (str->limit == NULL) {
auth_dealloc(str->rtp_auth);
cipher_dealloc(str->rtp_cipher);
@@ -361,7 +361,7 @@ srtp_stream_init_keys(srtp_stream_ctx_t *srtp, const void *key) {
uint8_t tmp_key[MAX_SRTP_KEY_LEN];
/* initialize KDF state */
- srtp_kdf_init(&kdf, key);
+ srtp_kdf_init(&kdf, (const uint8_t *)key);
/* generate encryption key */
srtp_kdf_generate(&kdf, label_rtp_encryption,
@@ -570,7 +570,7 @@ srtp_stream_init(srtp_stream_ctx_t *srtp,
err_status_t
srtp_protect(srtp_ctx_t *ctx, void *rtp_hdr, int *pkt_octet_len) {
- srtp_hdr_t *hdr = rtp_hdr;
+ srtp_hdr_t *hdr = (srtp_hdr_t *)rtp_hdr;
uint32_t *enc_start; /* pointer to start of encrypted portion */
uint32_t *auth_start; /* pointer to start of auth. portion */
unsigned enc_octet_len = 0; /* number of octets in encrypted portion */
@@ -810,7 +810,7 @@ srtp_stream_init(srtp_stream_ctx_t *srtp,
err_status_t
srtp_unprotect(srtp_ctx_t *ctx, void *srtp_hdr, int *pkt_octet_len) {
- srtp_hdr_t *hdr = srtp_hdr;
+ srtp_hdr_t *hdr = (srtp_hdr_t *)srtp_hdr;
uint32_t *enc_start; /* pointer to start of encrypted portion */
uint32_t *auth_start; /* pointer to start of auth. portion */
uint32_t enc_octet_len = 0;/* number of octets in encrypted portion */
@@ -899,7 +899,7 @@ srtp_unprotect(srtp_ctx_t *ctx, void *srtp_hdr, int *pkt_octet_len) {
#else
iv.v64[1] = be64_to_cpu(est << 16);
#endif
- status = aes_icm_set_iv(stream->rtp_cipher->state, &iv);
+ status = aes_icm_set_iv((aes_icm_ctx_t*)stream->rtp_cipher->state, &iv);
} else {
/* no particular format - set the iv to the pakcet index */
@@ -1418,7 +1418,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p) {
err_status_t
srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len) {
- srtcp_hdr_t *hdr = rtcp_hdr;
+ srtcp_hdr_t *hdr = (srtcp_hdr_t *)rtcp_hdr;
uint32_t *enc_start; /* pointer to start of encrypted portion */
uint32_t *auth_start; /* pointer to start of auth. portion */
uint32_t *trailer; /* pointer to start of trailer */
@@ -1530,7 +1530,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len) {
iv.v32[1] = hdr->ssrc; /* still in network order! */
iv.v32[2] = htonl(seq_num >> 16);
iv.v32[3] = htonl(seq_num << 16);
- status = aes_icm_set_iv(stream->rtcp_cipher->state, &iv);
+ status = aes_icm_set_iv((aes_icm_ctx_t*)stream->rtcp_cipher->state, &iv);
} else {
v128_t iv;
@@ -1597,7 +1597,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len) {
err_status_t
srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len) {
- srtcp_hdr_t *hdr = srtcp_hdr;
+ srtcp_hdr_t *hdr = (srtcp_hdr_t *)srtcp_hdr;
uint32_t *enc_start; /* pointer to start of encrypted portion */
uint32_t *auth_start; /* pointer to start of auth. portion */
uint32_t *trailer; /* pointer to start of trailer */
@@ -1683,7 +1683,7 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len) {
iv.v32[1] = hdr->ssrc; /* still in network order! */
iv.v32[2] = htonl(seq_num >> 16);
iv.v32[3] = htonl(seq_num << 16);
- status = aes_icm_set_iv(stream->rtcp_cipher->state, &iv);
+ status = aes_icm_set_iv((aes_icm_ctx_t*)stream->rtcp_cipher->state, &iv);
} else {
v128_t iv;
View
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSRTP", "srtp7.vcproj", "{7E1E1308-F82E-4DD3-B25C-CD12756A1DD9}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {7E1E1308-F82E-4DD3-B25C-CD12756A1DD9}.Debug.ActiveCfg = Debug|Win32
+ {7E1E1308-F82E-4DD3-B25C-CD12756A1DD9}.Debug.Build.0 = Debug|Win32
+ {7E1E1308-F82E-4DD3-B25C-CD12756A1DD9}.Release.ActiveCfg = Release|Win32
+ {7E1E1308-F82E-4DD3-B25C-CD12756A1DD9}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
Oops, something went wrong.

0 comments on commit 17127da

Please sign in to comment.