diff options
Diffstat (limited to 'thirdparties/iphone/include/srtp')
34 files changed, 915 insertions, 912 deletions
diff --git a/thirdparties/iphone/include/srtp/aes.h b/thirdparties/iphone/include/srtp/aes.h index 2881337..97fdb63 100755 --- a/thirdparties/iphone/include/srtp/aes.h +++ b/thirdparties/iphone/include/srtp/aes.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -55,19 +55,19 @@ /* aes internals */ typedef struct { - v128_t round[15]; - int num_rounds; + v128_t round[15]; + int num_rounds; } aes_expanded_key_t; err_status_t aes_expand_encryption_key(const uint8_t *key, - int key_len, - aes_expanded_key_t *expanded_key); + int key_len, + aes_expanded_key_t *expanded_key); err_status_t aes_expand_decryption_key(const uint8_t *key, - int key_len, - aes_expanded_key_t *expanded_key); + int key_len, + aes_expanded_key_t *expanded_key); void aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key); @@ -77,7 +77,7 @@ aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key); #if 0 /* - * internal functions + * internal functions */ void @@ -85,6 +85,6 @@ aes_init_sbox(void); void aes_compute_tables(void); -#endif +#endif #endif /* _AES_H */ diff --git a/thirdparties/iphone/include/srtp/aes_cbc.h b/thirdparties/iphone/include/srtp/aes_cbc.h index bc4e41a..7abd6d6 100755 --- a/thirdparties/iphone/include/srtp/aes_cbc.h +++ b/thirdparties/iphone/include/srtp/aes_cbc.h @@ -15,36 +15,36 @@ #include "cipher.h" typedef struct { - v128_t state; /* cipher chaining state */ - v128_t previous; /* previous ciphertext block */ - aes_expanded_key_t expanded_key; /* the cipher key */ + v128_t state; /* cipher chaining state */ + v128_t previous; /* previous ciphertext block */ + aes_expanded_key_t expanded_key; /* the cipher key */ } aes_cbc_ctx_t; err_status_t aes_cbc_set_key(aes_cbc_ctx_t *c, - const unsigned char *key); + const unsigned char *key); err_status_t -aes_cbc_encrypt(aes_cbc_ctx_t *c, - unsigned char *buf, - unsigned int *bytes_in_data); +aes_cbc_encrypt(aes_cbc_ctx_t *c, + unsigned char *buf, + unsigned int *bytes_in_data); err_status_t -aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, - int key_len, cipher_direction_t dir); +aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, + int key_len, cipher_direction_t dir); err_status_t aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv); err_status_t aes_cbc_nist_encrypt(aes_cbc_ctx_t *c, - unsigned char *data, - unsigned int *bytes_in_data); + unsigned char *data, + unsigned int *bytes_in_data); err_status_t aes_cbc_nist_decrypt(aes_cbc_ctx_t *c, - unsigned char *data, - unsigned int *bytes_in_data); + unsigned char *data, + unsigned int *bytes_in_data); #endif /* AES_CBC_H */ diff --git a/thirdparties/iphone/include/srtp/aes_icm.h b/thirdparties/iphone/include/srtp/aes_icm.h index dac0cdc..6ed032e 100755 --- a/thirdparties/iphone/include/srtp/aes_icm.h +++ b/thirdparties/iphone/include/srtp/aes_icm.h @@ -15,43 +15,43 @@ #include "cipher.h" typedef struct { - v128_t counter; /* holds the counter value */ - v128_t offset; /* initial offset value */ - v128_t keystream_buffer; /* buffers bytes of keystream */ - aes_expanded_key_t expanded_key; /* the cipher key */ - int bytes_in_buffer; /* number of unused bytes in buffer */ + v128_t counter; /* holds the counter value */ + v128_t offset; /* initial offset value */ + v128_t keystream_buffer; /* buffers bytes of keystream */ + aes_expanded_key_t expanded_key; /* the cipher key */ + int bytes_in_buffer; /* number of unused bytes in buffer */ } aes_icm_ctx_t; err_status_t aes_icm_context_init(aes_icm_ctx_t *c, - const unsigned char *key, - int key_len); + const unsigned char *key, + int key_len); err_status_t aes_icm_set_iv(aes_icm_ctx_t *c, void *iv); err_status_t aes_icm_encrypt(aes_icm_ctx_t *c, - unsigned char *buf, unsigned int *bytes_to_encr); + unsigned char *buf, unsigned int *bytes_to_encr); err_status_t aes_icm_output(aes_icm_ctx_t *c, - unsigned char *buf, int bytes_to_output); + unsigned char *buf, int bytes_to_output); -err_status_t +err_status_t aes_icm_dealloc(cipher_t *c); - -err_status_t -aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c, - unsigned char *buf, - unsigned int *enc_len, - int forIsmacryp); - -err_status_t -aes_icm_alloc_ismacryp(cipher_t **c, - int key_len, - int forIsmacryp); + +err_status_t +aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c, + unsigned char *buf, + unsigned int *enc_len, + int forIsmacryp); + +err_status_t +aes_icm_alloc_ismacryp(cipher_t **c, + int key_len, + int forIsmacryp); #endif /* AES_ICM_H */ diff --git a/thirdparties/iphone/include/srtp/alloc.h b/thirdparties/iphone/include/srtp/alloc.h index 5980eed..306e5f4 100755 --- a/thirdparties/iphone/include/srtp/alloc.h +++ b/thirdparties/iphone/include/srtp/alloc.h @@ -1,32 +1,32 @@ /* * alloc.h * - * interface to memory allocation and deallocation, with optional debugging + * interface to memory allocation and deallocation, with optional debugging * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/thirdparties/iphone/include/srtp/auth.h b/thirdparties/iphone/include/srtp/auth.h index 5b5e4b2..4d03d08 100755 --- a/thirdparties/iphone/include/srtp/auth.h +++ b/thirdparties/iphone/include/srtp/auth.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -46,7 +46,7 @@ #ifndef AUTH_H #define AUTH_H -#include "datatypes.h" +#include "datatypes.h" #include "err.h" /* error codes */ #include "crypto.h" /* for auth_type_id_t */ #include "crypto_types.h" /* for values of auth_type_id_t */ @@ -55,22 +55,22 @@ typedef struct auth_type_t *auth_type_pointer; typedef struct auth_t *auth_pointer_t; typedef err_status_t (*auth_alloc_func) - (auth_pointer_t *ap, int key_len, int out_len); +(auth_pointer_t *ap, int key_len, int out_len); typedef err_status_t (*auth_init_func) - (void *state, const uint8_t *key, int key_len); +(void *state, const uint8_t *key, int key_len); typedef err_status_t (*auth_dealloc_func)(auth_pointer_t ap); typedef err_status_t (*auth_compute_func) - (void *state, uint8_t *buffer, int octets_to_auth, - int tag_len, uint8_t *tag); +(void *state, uint8_t *buffer, int octets_to_auth, + int tag_len, uint8_t *tag); typedef err_status_t (*auth_update_func) - (void *state, uint8_t *buffer, int octets_to_auth); +(void *state, uint8_t *buffer, int octets_to_auth); typedef err_status_t (*auth_start_func)(void *state); - + /* some syntactic sugar on these function types */ #define auth_type_alloc(at, a, klen, outlen) \ @@ -109,40 +109,40 @@ auth_get_prefix_length(const struct auth_t *a); */ typedef struct auth_test_case_t { - int key_length_octets; /* octets in key */ - uint8_t *key; /* key */ - int data_length_octets; /* octets in data */ - uint8_t *data; /* data */ - int tag_length_octets; /* octets in tag */ - uint8_t *tag; /* tag */ - struct auth_test_case_t *next_test_case; /* pointer to next testcase */ + int key_length_octets; /* octets in key */ + uint8_t *key; /* key */ + int data_length_octets; /* octets in data */ + uint8_t *data; /* data */ + int tag_length_octets; /* octets in tag */ + uint8_t *tag; /* tag */ + struct auth_test_case_t *next_test_case; /* pointer to next testcase */ } auth_test_case_t; /* auth_type_t */ typedef struct auth_type_t { - auth_alloc_func alloc; - auth_dealloc_func dealloc; - auth_init_func init; - auth_compute_func compute; - auth_update_func update; - auth_start_func start; - char *description; - int ref_count; - auth_test_case_t *test_data; - debug_module_t *debug; - auth_type_id_t id; + auth_alloc_func alloc; + auth_dealloc_func dealloc; + auth_init_func init; + auth_compute_func compute; + auth_update_func update; + auth_start_func start; + char *description; + int ref_count; + auth_test_case_t *test_data; + debug_module_t *debug; + auth_type_id_t id; } auth_type_t; typedef struct auth_t { - auth_type_t *type; - void *state; - int out_len; /* length of output tag in octets */ - int key_len; /* length of key in octets */ - int prefix_len; /* length of keystream prefix */ + auth_type_t *type; + void *state; + int out_len; /* length of output tag in octets */ + int key_len; /* length of key in octets */ + int prefix_len; /* length of keystream prefix */ } auth_t; -/* +/* * auth_type_self_test() tests an auth_type against test cases * provided in an array of values of key/message/tag that is known to * be good @@ -151,7 +151,7 @@ typedef struct auth_t { err_status_t auth_type_self_test(const auth_type_t *at); -/* +/* * auth_type_test() tests an auth_type against external test cases * provided in an array of values of key/message/tag that is known to * be good diff --git a/thirdparties/iphone/include/srtp/cipher.h b/thirdparties/iphone/include/srtp/cipher.h index eff6dd1..9529153 100755 --- a/thirdparties/iphone/include/srtp/cipher.h +++ b/thirdparties/iphone/include/srtp/cipher.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -46,7 +46,7 @@ #ifndef CIPHER_H #define CIPHER_H -#include "datatypes.h" +#include "datatypes.h" #include "rdbx.h" /* for xtd_seq_num_t */ #include "err.h" /* for error codes */ #include "crypto.h" /* for cipher_type_id_t */ @@ -54,17 +54,17 @@ /** - * @brief cipher_direction_t defines a particular cipher operation. + * @brief cipher_direction_t defines a particular cipher operation. * * A cipher_direction_t is an enum that describes a particular cipher * operation, i.e. encryption or decryption. For some ciphers, this * distinction does not matter, but for others, it is essential. */ -typedef enum { - direction_encrypt, /**< encryption (convert plaintext to ciphertext) */ - direction_decrypt, /**< decryption (convert ciphertext to plaintext) */ - direction_any /**< encryption or decryption */ +typedef enum { + direction_encrypt, /**< encryption (convert plaintext to ciphertext) */ + direction_decrypt, /**< decryption (convert ciphertext to plaintext) */ + direction_any /**< encryption or decryption */ } cipher_direction_t; /* @@ -76,13 +76,13 @@ typedef struct cipher_type_t *cipher_type_pointer_t; typedef struct cipher_t *cipher_pointer_t; /* - * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t + * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t */ typedef err_status_t (*cipher_alloc_func_t) - (cipher_pointer_t *cp, int key_len); +(cipher_pointer_t *cp, int key_len); -/* +/* * a cipher_init_func_t [re-]initializes a cipher_t with a given key * and direction (i.e., encrypt or decrypt) */ @@ -97,24 +97,24 @@ typedef err_status_t (*cipher_dealloc_func_t)(cipher_pointer_t cp); /* a cipher_set_segment_func_t sets the segment index of a cipher_t */ typedef err_status_t (*cipher_set_segment_func_t) - (void *state, xtd_seq_num_t idx); +(void *state, xtd_seq_num_t idx); /* a cipher_encrypt_func_t encrypts data in-place */ typedef err_status_t (*cipher_encrypt_func_t) - (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt); +(void *state, uint8_t *buffer, unsigned int *octets_to_encrypt); /* a cipher_decrypt_func_t decrypts data in-place */ typedef err_status_t (*cipher_decrypt_func_t) - (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt); +(void *state, uint8_t *buffer, unsigned int *octets_to_decrypt); -/* +/* * a cipher_set_iv_func_t function sets the current initialization vector */ typedef err_status_t (*cipher_set_iv_func_t) - (cipher_pointer_t cp, void *iv); +(cipher_pointer_t cp, void *iv); /* * cipher_test_case_t is a (list of) key, salt, xtd_seq_num_t, @@ -125,30 +125,30 @@ typedef err_status_t (*cipher_set_iv_func_t) */ typedef struct cipher_test_case_t { - int key_length_octets; /* octets in key */ - uint8_t *key; /* key */ - uint8_t *idx; /* packet index */ - int plaintext_length_octets; /* octets in plaintext */ - uint8_t *plaintext; /* plaintext */ - int ciphertext_length_octets; /* octets in plaintext */ - uint8_t *ciphertext; /* ciphertext */ - struct cipher_test_case_t *next_test_case; /* pointer to next testcase */ + int key_length_octets; /* octets in key */ + uint8_t *key; /* key */ + uint8_t *idx; /* packet index */ + int plaintext_length_octets; /* octets in plaintext */ + uint8_t *plaintext; /* plaintext */ + int ciphertext_length_octets; /* octets in plaintext */ + uint8_t *ciphertext; /* ciphertext */ + struct cipher_test_case_t *next_test_case; /* pointer to next testcase */ } cipher_test_case_t; /* cipher_type_t defines the 'metadata' for a particular cipher type */ typedef struct cipher_type_t { - cipher_alloc_func_t alloc; - cipher_dealloc_func_t dealloc; - cipher_init_func_t init; - cipher_encrypt_func_t encrypt; - cipher_encrypt_func_t decrypt; - cipher_set_iv_func_t set_iv; - char *description; - int ref_count; - cipher_test_case_t *test_data; - debug_module_t *debug; - cipher_type_id_t id; + cipher_alloc_func_t alloc; + cipher_dealloc_func_t dealloc; + cipher_init_func_t init; + cipher_encrypt_func_t encrypt; + cipher_encrypt_func_t decrypt; + cipher_set_iv_func_t set_iv; + char *description; + int ref_count; + cipher_test_case_t *test_data; + debug_module_t *debug; + cipher_type_id_t id; } cipher_type_t; /* @@ -157,11 +157,11 @@ typedef struct cipher_type_t { */ typedef struct cipher_t { - cipher_type_t *type; - void *state; - int key_len; + cipher_type_t *type; + void *state; + int key_len; #ifdef FORCE_64BIT_ALIGN - int pad; + int pad; #endif } cipher_t; @@ -181,7 +181,7 @@ typedef struct cipher_t { #define cipher_set_iv(c, n) \ ((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n))) : \ - err_status_no_such_op) + err_status_no_such_op) err_status_t cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output); @@ -193,9 +193,9 @@ int cipher_get_key_length(const cipher_t *c); -/* - * cipher_type_self_test() tests a cipher against test cases provided in - * an array of values of key/xtd_seq_num_t/plaintext/ciphertext +/* + * cipher_type_self_test() tests a cipher against test cases provided in + * an array of values of key/xtd_seq_num_t/plaintext/ciphertext * that is known to be good */ @@ -203,9 +203,9 @@ err_status_t cipher_type_self_test(const cipher_type_t *ct); -/* - * cipher_type_test() tests a cipher against external test cases provided in - * an array of values of key/xtd_seq_num_t/plaintext/ciphertext +/* + * cipher_type_test() tests a cipher against external test cases provided in + * an array of values of key/xtd_seq_num_t/plaintext/ciphertext * that is known to be good */ @@ -216,7 +216,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data); /* * cipher_bits_per_second(c, l, t) computes (and estimate of) the * number of bits that a cipher implementation can encrypt in a second - * + * * c is a cipher (which MUST be allocated and initialized already), l * is the length in octets of the test data to be encrypted, and t is * the number of trials diff --git a/thirdparties/iphone/include/srtp/crypto.h b/thirdparties/iphone/include/srtp/crypto.h index 0e9667d..9d656fa 100755 --- a/thirdparties/iphone/include/srtp/crypto.h +++ b/thirdparties/iphone/include/srtp/crypto.h @@ -2,7 +2,7 @@ * crypto.h * * API for libcrypto - * + * * David A. McGrew * Cisco Systems, Inc. */ @@ -10,7 +10,7 @@ #ifndef CRYPTO_H #define CRYPTO_H -/** +/** * @brief A cipher_type_id_t is an identifier for a particular cipher * type. * @@ -19,10 +19,10 @@ * NULL_CIPHER is avaliable; this cipher leaves the data unchanged, * and can be selected to indicate that no encryption is to take * place. - * + * * @ingroup Ciphers */ -typedef uint32_t cipher_type_id_t; +typedef uint32_t cipher_type_id_t; /** * @brief An auth_type_id_t is an identifier for a particular authentication @@ -33,7 +33,7 @@ typedef uint32_t cipher_type_id_t; * avaliable; this authentication function performs no computation, * and can be selected to indicate that no authentication is to take * place. - * + * * @ingroup Authentication */ typedef uint32_t auth_type_id_t; diff --git a/thirdparties/iphone/include/srtp/crypto_kernel.h b/thirdparties/iphone/include/srtp/crypto_kernel.h index 1acf497..c496174 100755 --- a/thirdparties/iphone/include/srtp/crypto_kernel.h +++ b/thirdparties/iphone/include/srtp/crypto_kernel.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright(c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -46,9 +46,9 @@ #ifndef CRYPTO_KERNEL #define CRYPTO_KERNEL -#include "rand_source.h" +#include "rand_source.h" #include "prng.h" -#include "cipher.h" +#include "cipher.h" #include "auth.h" #include "cryptoalg.h" #include "stat.h" @@ -65,37 +65,37 @@ */ typedef enum { - crypto_kernel_state_insecure, - crypto_kernel_state_secure + crypto_kernel_state_insecure, + crypto_kernel_state_secure } crypto_kernel_state_t; -/* - * linked list of cipher types +/* + * linked list of cipher types */ typedef struct kernel_cipher_type { - cipher_type_id_t id; - cipher_type_t *cipher_type; - struct kernel_cipher_type *next; + cipher_type_id_t id; + cipher_type_t *cipher_type; + struct kernel_cipher_type *next; } kernel_cipher_type_t; -/* - * linked list of auth types +/* + * linked list of auth types */ typedef struct kernel_auth_type { - auth_type_id_t id; - auth_type_t *auth_type; - struct kernel_auth_type *next; + auth_type_id_t id; + auth_type_t *auth_type; + struct kernel_auth_type *next; } kernel_auth_type_t; /* - * linked list of debug modules + * linked list of debug modules */ typedef struct kernel_debug_module { - debug_module_t *mod; - struct kernel_debug_module *next; + debug_module_t *mod; + struct kernel_debug_module *next; } kernel_debug_module_t; @@ -107,10 +107,10 @@ typedef struct kernel_debug_module { */ typedef struct { - crypto_kernel_state_t state; /* current state of kernel */ - kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */ - kernel_auth_type_t *auth_type_list; /* list of all auth func types */ - kernel_debug_module_t *debug_module_list; /* list of all debug modules */ + crypto_kernel_state_t state; /* current state of kernel */ + kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */ + kernel_auth_type_t *auth_type_list; /* list of all auth func types */ + kernel_debug_module_t *debug_module_list; /* list of all debug modules */ } crypto_kernel_t; @@ -125,10 +125,10 @@ typedef struct { * crypto algorithms. Possible return values are: * * err_status_ok initialization successful - * <other> init failure + * <other> init failure * * If any value other than err_status_ok is returned, the - * crypto_kernel MUST NOT be used. + * crypto_kernel MUST NOT be used. */ err_status_t @@ -142,7 +142,7 @@ crypto_kernel_init(void); * values are: * * err_status_ok shutdown successful - * <other> shutdown failure + * <other> shutdown failure * */ @@ -155,7 +155,7 @@ crypto_kernel_shutdown(void); * status report. Possible return values are: * * err_status_ok all tests were passed - * <other> a test failed + * <other> a test failed * */ @@ -184,7 +184,7 @@ crypto_kernel_load_auth_type(auth_type_t *ct, auth_type_id_t id); /* * crypto_kernel_replace_cipher_type(ct, id) - * + * * replaces the crypto kernel's existing cipher for the cipher_type id * with a new one passed in externally. The new cipher must pass all the * existing cipher_type's self tests as well as its own. @@ -195,7 +195,7 @@ crypto_kernel_replace_cipher_type(cipher_type_t *ct, cipher_type_id_t id); /* * crypto_kernel_replace_auth_type(ct, id) - * + * * replaces the crypto kernel's existing cipher for the auth_type id * with a new one passed in externally. The new auth type must pass all the * existing auth_type's self tests as well as its own. @@ -208,43 +208,43 @@ err_status_t crypto_kernel_load_debug_module(debug_module_t *new_dm); /* - * crypto_kernel_alloc_cipher(id, cp, key_len); + * crypto_kernel_alloc_cipher(id, cp, key_len); * * allocates a cipher of type id at location *cp, with key length * key_len octets. Return values are: - * + * * err_status_ok no problems * err_status_alloc_fail an allocation failure occured * err_status_fail couldn't find cipher with identifier 'id' */ err_status_t -crypto_kernel_alloc_cipher(cipher_type_id_t id, - cipher_pointer_t *cp, - int key_len); +crypto_kernel_alloc_cipher(cipher_type_id_t id, + cipher_pointer_t *cp, + int key_len); /* - * crypto_kernel_alloc_auth(id, ap, key_len, tag_len); + * crypto_kernel_alloc_auth(id, ap, key_len, tag_len); * * allocates an auth function of type id at location *ap, with key * length key_len octets and output tag length of tag_len. Return * values are: - * + * * err_status_ok no problems * err_status_alloc_fail an allocation failure occured * err_status_fail couldn't find auth with identifier 'id' */ err_status_t -crypto_kernel_alloc_auth(auth_type_id_t id, - auth_pointer_t *ap, - int key_len, - int tag_len); +crypto_kernel_alloc_auth(auth_type_id_t id, + auth_pointer_t *ap, + int key_len, + int tag_len); /* * crypto_kernel_set_debug_module(mod_name, v) - * + * * sets dynamic debugging to the value v (0 for off, 1 for on) for the * debug module with the name mod_name * @@ -261,7 +261,7 @@ crypto_kernel_set_debug_module(char *mod_name, int v); * random data to the location to which dest points, and returns an * error code. This error code @b must be checked, and if a failure is * reported, the data in the buffer @b must @b not be used. - * + * * @warning If the return code is not checked, then non-random * data may be in the buffer. This function will fail * unless it is called after crypto_kernel_init(). @@ -276,5 +276,5 @@ crypto_kernel_set_debug_module(char *mod_name, int v); */ err_status_t crypto_get_random(unsigned char *buffer, unsigned int length); - + #endif /* CRYPTO_KERNEL */ diff --git a/thirdparties/iphone/include/srtp/crypto_math.h b/thirdparties/iphone/include/srtp/crypto_math.h index 52f0837..4de3912 100755 --- a/thirdparties/iphone/include/srtp/crypto_math.h +++ b/thirdparties/iphone/include/srtp/crypto_math.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -95,7 +95,7 @@ hex_string_to_v64(char *s); /* the matrix A[] is stored in column format, i.e., A[i] is the ith column of the matrix */ -uint8_t +uint8_t A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); void @@ -118,11 +118,11 @@ octet_string_set_to_zero(uint8_t *s, int len); -/* +/* * the matrix A[] is stored in column format, i.e., A[i] is the ith * column of the matrix */ -uint8_t +uint8_t A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); @@ -165,8 +165,8 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); + htonl(tmp >> 32); \ z->v32[0] = ntohl((uint32_t) tmp); \ } - -#endif /* WORDS_BIGENDIAN */ + +#endif /* WORDS_BIGENDIAN */ #endif #ifdef DATATYPES_USE_MACROS /* little functions are really macros */ @@ -176,7 +176,7 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); #define v128_xor(z, x, y) _v128_xor(z, x, y) #define v128_and(z, x, y) _v128_and(z, x, y) #define v128_or(z, x, y) _v128_or(z, x, y) -#define v128_complement(x) _v128_complement(x) +#define v128_complement(x) _v128_complement(x) #define v128_is_eq(x, y) _v128_is_eq(x, y) #define v128_xor_eq(x, y) _v128_xor_eq(x, y) #define v128_get_bit(x, i) _v128_get_bit(x, i) @@ -202,7 +202,7 @@ void v128_and(v128_t *z, v128_t *x, v128_t *y); void -v128_or(v128_t *z, v128_t *x, v128_t *y); +v128_or(v128_t *z, v128_t *x, v128_t *y); void v128_complement(v128_t *x); @@ -211,10 +211,10 @@ int v128_get_bit(const v128_t *x, int i); void -v128_set_bit(v128_t *x, int i) ; +v128_set_bit(v128_t *x, int i) ; void -v128_clear_bit(v128_t *x, int i); +v128_clear_bit(v128_t *x, int i); void v128_set_bit_to(v128_t *x, int i, int y); diff --git a/thirdparties/iphone/include/srtp/crypto_types.h b/thirdparties/iphone/include/srtp/crypto_types.h index 3531710..06a05dc 100755 --- a/thirdparties/iphone/include/srtp/crypto_types.h +++ b/thirdparties/iphone/include/srtp/crypto_types.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright(c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -57,14 +57,14 @@ * (UST) must be used in conjunction with a cipher other than the null * cipher. These functions require a per-message pseudorandom input * that is generated by the cipher. - * + * * The identifiers STRONGHOLD_AUTH and STRONGHOLD_CIPHER identify the * strongest available authentication function and cipher, * respectively. They are resolved at compile time to the strongest * available algorithm. The stronghold algorithms can serve as did * the keep of a medieval fortification; they provide the strongest * defense (or the last refuge). - * + * * @{ */ @@ -72,7 +72,7 @@ * @defgroup Ciphers Cipher Types * * @brief Each cipher type is identified by an unsigned integer. The - * cipher types available in this edition of libSRTP are given + * cipher types available in this edition of libSRTP are given * by the #defines below. * * A cipher_type_id_t is an identifier for a cipher_type; only values @@ -90,56 +90,56 @@ /** * @brief The null cipher performs no encryption. * - * The NULL_CIPHER leaves its inputs unaltered, during both the + * The NULL_CIPHER leaves its inputs unaltered, during both the * encryption and decryption operations. This cipher can be chosen * to indicate that no encryption is to be performed. */ -#define NULL_CIPHER 0 +#define NULL_CIPHER 0 -/** - * @brief AES Integer Counter Mode (AES ICM) +/** + * @brief AES Integer Counter Mode (AES ICM) * - * AES ICM is the variant of counter mode that is used by Secure RTP. + * AES ICM is the variant of counter mode that is used by Secure RTP. * This cipher uses a 16-, 24-, or 32-octet key concatenated with a * 14-octet offset (or salt) value. */ -#define AES_ICM 1 +#define AES_ICM 1 -/** - * @brief AES-128 Integer Counter Mode (AES ICM) +/** + * @brief AES-128 Integer Counter Mode (AES ICM) * AES-128 ICM is a deprecated alternate name for AES ICM. */ #define AES_128_ICM AES_ICM /** - * @brief SEAL 3.0 - * + * @brief SEAL 3.0 + * * SEAL is the Software-Optimized Encryption Algorithm of Coppersmith * and Rogaway. Nota bene: this cipher is IBM proprietary. */ -#define SEAL 2 +#define SEAL 2 -/** - * @brief AES Cipher Block Chaining mode (AES CBC) +/** + * @brief AES Cipher Block Chaining mode (AES CBC) * * AES CBC is the AES Cipher Block Chaining mode. * This cipher uses a 16-, 24-, or 32-octet key. */ -#define AES_CBC 3 +#define AES_CBC 3 -/** - * @brief AES-128 Cipher Block Chaining mode (AES CBC) +/** + * @brief AES-128 Cipher Block Chaining mode (AES CBC) * * AES-128 CBC is a deprecated alternate name for AES CBC. */ -#define AES_128_CBC AES_CBC +#define AES_128_CBC AES_CBC /** * @brief Strongest available cipher. * * This identifier resolves to the strongest cipher type available. */ -#define STRONGHOLD_CIPHER AES_ICM +#define STRONGHOLD_CIPHER AES_ICM /** * @} @@ -149,14 +149,14 @@ /** * @defgroup Authentication Authentication Function Types - * + * * @brief Each authentication function type is identified by an * unsigned integer. The authentication function types available in * this edition of libSRTP are given by the #defines below. * * An auth_type_id_t is an identifier for an authentication function type; - * only values given by the #defines above (or those present in the - * file crypto_types.h) should be used. + * only values given by the #defines above (or those present in the + * file crypto_types.h) should be used. * * The identifier STRONGHOLD_AUTH indicates the strongest available * authentication function, allowing an application to choose the @@ -173,8 +173,8 @@ * * The NULL_AUTH function does nothing, and can be selected to indicate * that authentication should not be performed. - */ -#define NULL_AUTH 0 + */ +#define NULL_AUTH 0 /** * @brief UST with TMMH Version 2 @@ -184,15 +184,15 @@ * than the null cipher. * with a cipher. */ -#define UST_TMMHv2 1 +#define UST_TMMHv2 1 /** - * @brief (UST) AES-128 XORMAC + * @brief (UST) AES-128 XORMAC * * UST_AES_128_XMAC implements AES-128 XORMAC, using UST. Nota bene: * the XORMAC algorithm is IBM proprietary. */ -#define UST_AES_128_XMAC 2 +#define UST_AES_128_XMAC 2 /** * @brief HMAC-SHA1 @@ -200,7 +200,7 @@ * HMAC_SHA1 implements the Hash-based MAC using the NIST Secure * Hash Algorithm version 1 (SHA1). */ -#define HMAC_SHA1 3 +#define HMAC_SHA1 3 /** * @brief Strongest available authentication function. @@ -208,7 +208,7 @@ * This identifier resolves to the strongest available authentication * function. */ -#define STRONGHOLD_AUTH HMAC_SHA1 +#define STRONGHOLD_AUTH HMAC_SHA1 /** * @} diff --git a/thirdparties/iphone/include/srtp/cryptoalg.h b/thirdparties/iphone/include/srtp/cryptoalg.h index d9f0441..ad29fa0 100755 --- a/thirdparties/iphone/include/srtp/cryptoalg.h +++ b/thirdparties/iphone/include/srtp/cryptoalg.h @@ -2,31 +2,31 @@ * cryptoalg.h * * API for authenticated encryption crypto algorithms - * + * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -61,10 +61,10 @@ * The function pointer cryptoalg_func_t points to a function that * implements a crypto transform, and provides a uniform API for * accessing crypto mechanisms. - * - * @param key location of secret key * - * @param clear data to be authenticated but not encrypted + * @param key location of secret key + * + * @param clear data to be authenticated but not encrypted * * @param clear_len length of data to be authenticated but not encrypted * @@ -79,34 +79,34 @@ * length of the ciphertext (after the call) * */ - -typedef err_status_t (*cryptoalg_func_t) - (void *key, - const void *clear, - unsigned clear_len, - void *iv, - void *protect, - unsigned *protected_len); - -typedef + +typedef err_status_t (*cryptoalg_func_t) +(void *key, + const void *clear, + unsigned clear_len, + void *iv, + void *protect, + unsigned *protected_len); + +typedef err_status_t (*cryptoalg_inv_t) - (void *key, /* location of secret key */ - const void *clear, /* data to be authenticated only */ - unsigned clear_len, /* length of data to be authenticated only */ - void *iv, /* location of iv */ - void *opaque, /* data to be decrypted and authenticated */ - unsigned *opaque_len /* location of the length of data to be - * decrypted and authd (before and after) +(void *key, /* location of secret key */ + const void *clear, /* data to be authenticated only */ + unsigned clear_len, /* length of data to be authenticated only */ + void *iv, /* location of iv */ + void *opaque, /* data to be decrypted and authenticated */ + unsigned *opaque_len /* location of the length of data to be + * decrypted and authd (before and after) */ - ); +); typedef struct cryptoalg_ctx_t { - cryptoalg_func_t enc; - cryptoalg_inv_t dec; - unsigned key_len; - unsigned iv_len; - unsigned auth_tag_len; - unsigned max_expansion; + cryptoalg_func_t enc; + cryptoalg_inv_t dec; + unsigned key_len; + unsigned iv_len; + unsigned auth_tag_len; + unsigned max_expansion; } cryptoalg_ctx_t; typedef cryptoalg_ctx_t *cryptoalg_t; @@ -120,7 +120,7 @@ typedef cryptoalg_ctx_t *cryptoalg_t; int cryptoalg_get_id(cryptoalg_t c); -cryptoalg_t +cryptoalg_t cryptoalg_find_by_id(int id); diff --git a/thirdparties/iphone/include/srtp/datatypes.h b/thirdparties/iphone/include/srtp/datatypes.h index e16d895..314a73a 100755 --- a/thirdparties/iphone/include/srtp/datatypes.h +++ b/thirdparties/iphone/include/srtp/datatypes.h @@ -1,6 +1,6 @@ /* * datatypes.h - * + * * data types for bit vectors and finite fields * * David A. McGrew @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -65,31 +65,31 @@ /* if DATATYPES_USE_MACROS is defined, then little functions are macros */ -#define DATATYPES_USE_MACROS +#define DATATYPES_USE_MACROS typedef union { - uint8_t v8[2]; - uint16_t value; + uint8_t v8[2]; + uint16_t value; } v16_t; typedef union { - uint8_t v8[4]; - uint16_t v16[2]; - uint32_t value; + uint8_t v8[4]; + uint16_t v16[2]; + uint32_t value; } v32_t; typedef union { - uint8_t v8[8]; - uint16_t v16[4]; - uint32_t v32[2]; - uint64_t value; + uint8_t v8[8]; + uint16_t v16[4]; + uint32_t v32[2]; + uint64_t value; } v64_t; typedef union { - uint8_t v8[16]; - uint16_t v16[8]; - uint32_t v32[4]; - uint64_t v64[2]; + uint8_t v8[16]; + uint16_t v16[8]; + uint32_t v32[4]; + uint64_t v64[2]; } v128_t; @@ -162,7 +162,7 @@ v128_right_shift(v128_t *x, int shift_index); /* * the following macros define the data manipulation functions - * + * * If DATATYPES_USE_MACROS is defined, then these macros are used * directly (and function call overhead is avoided). Otherwise, * the macros are used through the functions defined in datatypes.c @@ -309,18 +309,18 @@ v128_right_shift(v128_t *x, int shift_index); + htonl(tmp >> 32); \ z->v32[0] = ntohl((uint32_t) tmp); \ } -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ #endif /* 0 */ #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) #define v128_and(z, x, y) _v128_and(z, x, y) #define v128_or(z, x, y) _v128_or(z, x, y) -#define v128_complement(x) _v128_complement(x) +#define v128_complement(x) _v128_complement(x) #define v128_is_eq(x, y) _v128_is_eq(x, y) #define v128_xor_eq(x, y) _v128_xor_eq(x, y) #define v128_get_bit(x, i) _v128_get_bit(x, i) @@ -346,7 +346,7 @@ void v128_and(v128_t *z, v128_t *x, v128_t *y); void -v128_or(v128_t *z, v128_t *x, v128_t *y); +v128_or(v128_t *z, v128_t *x, v128_t *y); void v128_complement(v128_t *x); @@ -355,10 +355,10 @@ int v128_get_bit(const v128_t *x, int i); void -v128_set_bit(v128_t *x, int i) ; +v128_set_bit(v128_t *x, int i) ; void -v128_clear_bit(v128_t *x, int i); +v128_clear_bit(v128_t *x, int i); void v128_set_bit_to(v128_t *x, int i, int y); @@ -379,7 +379,7 @@ octet_string_set_to_zero(uint8_t *s, int len); #ifndef SRTP_KERNEL_LINUX -/* +/* * Convert big endian integers to CPU byte order. */ #ifdef WORDS_BIGENDIAN @@ -395,10 +395,11 @@ octet_string_set_to_zero(uint8_t *s, int len); #if defined(__GNUC__) && defined(HAVE_X86) /* Fall back. */ -static inline uint32_t be32_to_cpu(uint32_t v) { - /* optimized for x86. */ - asm("bswap %0" : "=r" (v) : "0" (v)); - return v; +static inline uint32_t be32_to_cpu(uint32_t v) +{ + /* optimized for x86. */ + asm("bswap %0" : "=r" (v) : "0" (v)); + return v; } # else /* HAVE_X86 */ # ifdef HAVE_NETINET_IN_H @@ -409,15 +410,16 @@ static inline uint32_t be32_to_cpu(uint32_t v) { # define be32_to_cpu(x) ntohl((x)) # endif /* HAVE_X86 */ -static inline uint64_t be64_to_cpu(uint64_t v) { +static inline uint64_t be64_to_cpu(uint64_t v) +{ # ifdef NO_64BIT_MATH - /* use the make64 functions to do 64-bit math */ - v = make64(htonl(low32(v)),htonl(high32(v))); + /* use the make64 functions to do 64-bit math */ + v = make64(htonl(low32(v)),htonl(high32(v))); # else - /* use the native 64-bit math */ - v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32)); + /* use the native 64-bit math */ + v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32)); # endif - return v; + return v; } #endif /* ! SRTP_KERNEL_LINUX */ @@ -425,22 +427,22 @@ static inline uint64_t be64_to_cpu(uint64_t v) { #endif /* WORDS_BIGENDIAN */ /* - * functions manipulating bitvector_t + * functions manipulating bitvector_t * * A bitvector_t consists of an array of words and an integer * representing the number of significant bits stored in the array. * The bits are packed as follows: the least significant bit is that * of word[0], while the most significant bit is the nth most * significant bit of word[m], where length = bits_per_word * m + n. - * + * */ #define bits_per_word 32 #define bytes_per_word 4 typedef struct { - uint32_t length; - uint32_t *word; + uint32_t length; + uint32_t *word; } bitvector_t; diff --git a/thirdparties/iphone/include/srtp/ekt.h b/thirdparties/iphone/include/srtp/ekt.h index b0d888b..d7f9854 100755 --- a/thirdparties/iphone/include/srtp/ekt.h +++ b/thirdparties/iphone/include/srtp/ekt.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2005 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -45,12 +45,12 @@ /* - * EKT implementation strategy - * + * EKT implementation strategy + * * use stream_template approach * * in srtp_unprotect, when a new stream appears, check if template has - * EKT defined, and if it does, then apply EKT processing + * EKT defined, and if it does, then apply EKT processing * * question: will we want to allow key-sharing templates in addition * to EKT templates? could define a new ssrc_type_t that's associated @@ -88,10 +88,10 @@ ekt_octets_after_base_tag(ekt_stream_t ekt); */ typedef struct ekt_policy_ctx_t { - ekt_spi_t spi; /* security parameter index */ - uint8_t ekt_cipher_type; - uint8_t *ekt_key; - struct ekt_policy_ctx_t *next_ekt_policy; + ekt_spi_t spi; /* security parameter index */ + uint8_t ekt_cipher_type; + uint8_t *ekt_key; + struct ekt_policy_ctx_t *next_ekt_policy; } ekt_policy_ctx_t; @@ -101,11 +101,11 @@ typedef struct ekt_policy_ctx_t { */ typedef struct ekt_data_t { - ekt_spi_t spi; - uint8_t ekt_cipher_type; - aes_expanded_key_t ekt_enc_key; - aes_expanded_key_t ekt_dec_key; - struct ekt_data_t *next_ekt_data; + ekt_spi_t spi; + uint8_t ekt_cipher_type; + aes_expanded_key_t ekt_enc_key; + aes_expanded_key_t ekt_dec_key; + struct ekt_data_t *next_ekt_data; } ekt_data_t; /* @@ -116,39 +116,39 @@ typedef struct ekt_data_t { */ typedef struct ekt_stream_ctx_t { - ekt_data_t *data; - uint16_t isn; /* initial sequence number */ - uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN]; + ekt_data_t *data; + uint16_t isn; /* initial sequence number */ + uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN]; } ekt_stream_ctx_t; -err_status_t +err_status_t ekt_alloc(ekt_stream_t *stream_data, ekt_policy_t policy); err_status_t -ekt_stream_init(ekt_stream_t e, - ekt_spi_t spi, - void *ekt_key, - unsigned ekt_cipher_type); +ekt_stream_init(ekt_stream_t e, + ekt_spi_t spi, + void *ekt_key, + unsigned ekt_cipher_type); err_status_t ekt_stream_init_from_policy(ekt_stream_t e, ekt_policy_t p); - + err_status_t -srtp_stream_init_from_ekt(srtp_stream_t stream, - const void *srtcp_hdr, - unsigned pkt_octet_len); - +srtp_stream_init_from_ekt(srtp_stream_t stream, + const void *srtcp_hdr, + unsigned pkt_octet_len); + void ekt_write_data(ekt_stream_t ekt, - uint8_t *base_tag, - unsigned base_tag_len, - int *packet_len, - xtd_seq_num_t pkt_index); + uint8_t *base_tag, + unsigned base_tag_len, + int *packet_len, + xtd_seq_num_t pkt_index); /* * We handle EKT by performing some additional steps before @@ -160,14 +160,14 @@ ekt_write_data(ekt_stream_t ekt, */ err_status_t -ekt_tag_verification_preproces(uint8_t *pkt_tag, - uint8_t *pkt_tag_copy, - unsigned tag_len); +ekt_tag_verification_preproces(uint8_t *pkt_tag, + uint8_t *pkt_tag_copy, + unsigned tag_len); err_status_t ekt_tag_verification_postproces(uint8_t *pkt_tag, - uint8_t *pkt_tag_copy, - unsigned tag_len); + uint8_t *pkt_tag_copy, + unsigned tag_len); /* @@ -178,15 +178,15 @@ ekt_tag_verification_postproces(uint8_t *pkt_tag, * Master Key, the SRTP ROC, the Initial Sequence Number, and SPI * fields. The Base Authentication Tag field is set to the all-zero * value - * + * * When EKT is not used, this function is a no-op. - * + * */ err_status_t srtp_stream_srtcp_auth_tag_generation_preprocess(const srtp_stream_t *s, - uint8_t *pkt_tag, - unsigned pkt_octet_len); + uint8_t *pkt_tag, + unsigned pkt_octet_len); /* it's not clear that a tag_generation_postprocess function is needed */ diff --git a/thirdparties/iphone/include/srtp/err.h b/thirdparties/iphone/include/srtp/err.h index 1a6e170..9a318e5 100755 --- a/thirdparties/iphone/include/srtp/err.h +++ b/thirdparties/iphone/include/srtp/err.h @@ -1,32 +1,32 @@ /* * err.h - * + * * error status codes * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -50,9 +50,9 @@ /** * @defgroup Error Error Codes - * + * * Error status codes are represented by the enumeration err_status_t. - * + * * @{ */ @@ -66,31 +66,31 @@ * */ typedef enum { - err_status_ok = 0, /**< nothing to report */ - err_status_fail = 1, /**< unspecified failure */ - err_status_bad_param = 2, /**< unsupported parameter */ - err_status_alloc_fail = 3, /**< couldn't allocate memory */ - err_status_dealloc_fail = 4, /**< couldn't deallocate properly */ - err_status_init_fail = 5, /**< couldn't initialize */ - err_status_terminus = 6, /**< can't process as much data as requested */ - err_status_auth_fail = 7, /**< authentication failure */ - err_status_cipher_fail = 8, /**< cipher failure */ - err_status_replay_fail = 9, /**< replay check failed (bad index) */ - err_status_replay_old = 10, /**< replay check failed (index too old) */ - err_status_algo_fail = 11, /**< algorithm failed test routine */ - err_status_no_such_op = 12, /**< unsupported operation */ - err_status_no_ctx = 13, /**< no appropriate context found */ - err_status_cant_check = 14, /**< unable to perform desired validation */ - err_status_key_expired = 15, /**< can't use key any more */ - err_status_socket_err = 16, /**< error in use of socket */ - err_status_signal_err = 17, /**< error in use POSIX signals */ - err_status_nonce_bad = 18, /**< nonce check failed */ - err_status_read_fail = 19, /**< couldn't read data */ - err_status_write_fail = 20, /**< couldn't write data */ - err_status_parse_err = 21, /**< error pasring data */ - err_status_encode_err = 22, /**< error encoding data */ - err_status_semaphore_err = 23,/**< error while using semaphores */ - err_status_pfkey_err = 24 /**< error while using pfkey */ + err_status_ok = 0, /**< nothing to report */ + err_status_fail = 1, /**< unspecified failure */ + err_status_bad_param = 2, /**< unsupported parameter */ + err_status_alloc_fail = 3, /**< couldn't allocate memory */ + err_status_dealloc_fail = 4, /**< couldn't deallocate properly */ + err_status_init_fail = 5, /**< couldn't initialize */ + err_status_terminus = 6, /**< can't process as much data as requested */ + err_status_auth_fail = 7, /**< authentication failure */ + err_status_cipher_fail = 8, /**< cipher failure */ + err_status_replay_fail = 9, /**< replay check failed (bad index) */ + err_status_replay_old = 10, /**< replay check failed (index too old) */ + err_status_algo_fail = 11, /**< algorithm failed test routine */ + err_status_no_such_op = 12, /**< unsupported operation */ + err_status_no_ctx = 13, /**< no appropriate context found */ + err_status_cant_check = 14, /**< unable to perform desired validation */ + err_status_key_expired = 15, /**< can't use key any more */ + err_status_socket_err = 16, /**< error in use of socket */ + err_status_signal_err = 17, /**< error in use POSIX signals */ + err_status_nonce_bad = 18, /**< nonce check failed */ + err_status_read_fail = 19, /**< couldn't read data */ + err_status_write_fail = 20, /**< couldn't write data */ + err_status_parse_err = 21, /**< error pasring data */ + err_status_encode_err = 22, /**< error encoding data */ + err_status_semaphore_err = 23,/**< error while using semaphores */ + err_status_pfkey_err = 24 /**< error while using pfkey */ } err_status_t; /** @@ -98,15 +98,15 @@ typedef enum { */ typedef enum { - err_level_emergency = 0, - err_level_alert, - err_level_critical, - err_level_error, - err_level_warning, - err_level_notice, - err_level_info, - err_level_debug, - err_level_none + err_level_emergency = 0, + err_level_alert, + err_level_critical, + err_level_error, + err_level_warning, + err_level_notice, + err_level_info, + err_level_debug, + err_level_none } err_reporting_level_t; /* @@ -144,8 +144,8 @@ err_report(int priority, char *format, ...); */ typedef struct { - int on; /* 1 if debugging is on, 0 if it is off */ - char *name; /* printable name for debug module */ + int on; /* 1 if debugging is on, 0 if it is off */ + char *name; /* printable name for debug module */ } debug_module_t; #ifdef ENABLE_DEBUGGING diff --git a/thirdparties/iphone/include/srtp/getopt_s.h b/thirdparties/iphone/include/srtp/getopt_s.h index 2a6ece3..d3dc33d 100755 --- a/thirdparties/iphone/include/srtp/getopt_s.h +++ b/thirdparties/iphone/include/srtp/getopt_s.h @@ -7,26 +7,26 @@ * */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -45,11 +45,11 @@ #ifndef GETOPT_S_H #define GETOPT_S_H -/* +/* * getopt_s(), optarg_s, and optind_s are small, locally defined * versions of the POSIX standard getopt() interface. */ - + int getopt_s(int argc, char * const argv[], const char *optstring); diff --git a/thirdparties/iphone/include/srtp/gf2_8.h b/thirdparties/iphone/include/srtp/gf2_8.h index 098d37c..bbbabdf 100755 --- a/thirdparties/iphone/include/srtp/gf2_8.h +++ b/thirdparties/iphone/include/srtp/gf2_8.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -54,13 +54,13 @@ typedef uint8_t gf2_8; #define gf2_8_field_polynomial 0x1B /* - * gf2_8_shift(x) returns + * gf2_8_shift(x) returns */ /* - * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x' - * operation, using the field representation from AES; that is, the - * next gf2_8 value in the cyclic representation of that field. The + * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x' + * operation, using the field representation from AES; that is, the + * next gf2_8 value in the cyclic representation of that field. The * value z should be an uint8_t. */ diff --git a/thirdparties/iphone/include/srtp/hmac.h b/thirdparties/iphone/include/srtp/hmac.h index 262c0e2..77468ab 100755 --- a/thirdparties/iphone/include/srtp/hmac.h +++ b/thirdparties/iphone/include/srtp/hmac.h @@ -8,26 +8,26 @@ * */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -50,9 +50,9 @@ #include "sha1.h" typedef struct { - uint8_t opad[64]; - sha1_ctx_t ctx; - sha1_ctx_t init_ctx; + uint8_t opad[64]; + sha1_ctx_t ctx; + sha1_ctx_t init_ctx; } hmac_ctx_t; err_status_t @@ -72,7 +72,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets); err_status_t hmac_compute(hmac_ctx_t *state, const void *message, - int msg_octets, int tag_len, uint8_t *result); + int msg_octets, int tag_len, uint8_t *result); #endif /* HMAC_H */ diff --git a/thirdparties/iphone/include/srtp/integers.h b/thirdparties/iphone/include/srtp/integers.h index 7010efd..91935eb 100755 --- a/thirdparties/iphone/include/srtp/integers.h +++ b/thirdparties/iphone/include/srtp/integers.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -125,7 +125,7 @@ extern uint32_t low32(uint64_t value); #define GET_32(addr) ((((unsigned char *) (addr))[0] << 24) | \ (((unsigned char *) (addr))[1] << 16) | \ (((unsigned char *) (addr))[2] << 8) | \ - (((unsigned char *) (addr))[3])) + (((unsigned char *) (addr))[3])) #else #define PUT_32(addr,value) \ { \ @@ -137,7 +137,7 @@ extern uint32_t low32(uint64_t value); #define GET_32(addr) ((((unsigned char *) (addr))[3] << 24) | \ (((unsigned char *) (addr))[2] << 16) | \ (((unsigned char *) (addr))[1] << 8) | \ - (((unsigned char *) (addr))[0])) + (((unsigned char *) (addr))[0])) #endif // WORDS_BIGENDIAN #else #define PUT_32(addr,value) *(((uint32_t *) (addr)) = (value) diff --git a/thirdparties/iphone/include/srtp/kernel_compat.h b/thirdparties/iphone/include/srtp/kernel_compat.h index 59d1898..36559f7 100755 --- a/thirdparties/iphone/include/srtp/kernel_compat.h +++ b/thirdparties/iphone/include/srtp/kernel_compat.h @@ -1,6 +1,6 @@ /* * kernel_compat.h - * + * * Compatibility stuff for building in kernel context where standard * C headers and library are not available. * @@ -8,26 +8,26 @@ * Ingate Systems AB */ /* - * + * * Copyright(c) 2005 Ingate Systems AB * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the author(s) nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -70,9 +70,9 @@ static inline int rand(void) { - uint32_t temp; - get_random_bytes(&temp, sizeof(temp)); - return temp % (RAND_MAX+1); + uint32_t temp; + get_random_bytes(&temp, sizeof(temp)); + return temp % (RAND_MAX+1); } /* stdio/stdlib implementation. */ diff --git a/thirdparties/iphone/include/srtp/key.h b/thirdparties/iphone/include/srtp/key.h index e7e0744..340547f 100755 --- a/thirdparties/iphone/include/srtp/key.h +++ b/thirdparties/iphone/include/srtp/key.h @@ -2,31 +2,31 @@ * key.h * * key usage limits enforcement - * + * * David A. Mcgrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -51,9 +51,9 @@ typedef struct key_limit_ctx_t *key_limit_t; typedef enum { - key_event_normal, - key_event_soft_limit, - key_event_hard_limit + key_event_normal, + key_event_soft_limit, + key_event_hard_limit } key_event_t; err_status_t @@ -68,15 +68,15 @@ key_limit_check(const key_limit_t key); key_event_t key_limit_update(key_limit_t key); -typedef enum { - key_state_normal, - key_state_past_soft_limit, - key_state_expired +typedef enum { + key_state_normal, + key_state_past_soft_limit, + key_state_expired } key_state_t; typedef struct key_limit_ctx_t { - xtd_seq_num_t num_left; - key_state_t state; + xtd_seq_num_t num_left; + key_state_t state; } key_limit_ctx_t; #endif /* KEY_H */ diff --git a/thirdparties/iphone/include/srtp/null_auth.h b/thirdparties/iphone/include/srtp/null_auth.h index 44f9a4a..54c0296 100755 --- a/thirdparties/iphone/include/srtp/null_auth.h +++ b/thirdparties/iphone/include/srtp/null_auth.h @@ -7,26 +7,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -48,7 +48,7 @@ #include "auth.h" typedef struct { - char foo; + char foo; } null_auth_ctx_t; err_status_t @@ -62,7 +62,7 @@ null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len); err_status_t null_auth_compute (null_auth_ctx_t *state, uint8_t *message, - int msg_octets, int tag_len, uint8_t *result); + int msg_octets, int tag_len, uint8_t *result); #endif /* NULL_AUTH_H */ diff --git a/thirdparties/iphone/include/srtp/null_cipher.h b/thirdparties/iphone/include/srtp/null_cipher.h index 39da59a..63d272d 100755 --- a/thirdparties/iphone/include/srtp/null_cipher.h +++ b/thirdparties/iphone/include/srtp/null_cipher.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -52,7 +52,7 @@ #include "cipher.h" typedef struct { - char foo ;/* empty, for now */ + char foo ;/* empty, for now */ } null_cipher_ctx_t; @@ -66,15 +66,15 @@ null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len); err_status_t null_cipher_set_segment(null_cipher_ctx_t *c, - unsigned long segment_index); + unsigned long segment_index); err_status_t null_cipher_encrypt(null_cipher_ctx_t *c, - unsigned char *buf, unsigned int *bytes_to_encr); + unsigned char *buf, unsigned int *bytes_to_encr); err_status_t null_cipher_encrypt_aligned(null_cipher_ctx_t *c, - unsigned char *buf, int bytes_to_encr); + unsigned char *buf, int bytes_to_encr); #endif /* NULL_CIPHER_H */ diff --git a/thirdparties/iphone/include/srtp/prng.h b/thirdparties/iphone/include/srtp/prng.h index fb96b5e..148b07a 100755 --- a/thirdparties/iphone/include/srtp/prng.h +++ b/thirdparties/iphone/include/srtp/prng.h @@ -21,10 +21,10 @@ */ typedef struct { - v128_t state; /* state data */ - aes_expanded_key_t key; /* secret key */ - uint32_t octet_count; /* number of octets output since last init */ - rand_source_func_t rand; /* random source for re-initialization */ + v128_t state; /* state data */ + aes_expanded_key_t key; /* secret key */ + uint32_t octet_count; /* number of octets output since last init */ + rand_source_func_t rand; /* random source for re-initialization */ } x917_prng_t; err_status_t @@ -39,9 +39,9 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len); */ typedef struct { - uint32_t octet_count; /* number of octets output since last init */ - aes_icm_ctx_t state; /* state data */ - rand_source_func_t rand; /* random source for re-initialization */ + uint32_t octet_count; /* number of octets output since last init */ + aes_icm_ctx_t state; /* state data */ + rand_source_func_t rand; /* random source for re-initialization */ } ctr_prng_t; err_status_t diff --git a/thirdparties/iphone/include/srtp/rand_source.h b/thirdparties/iphone/include/srtp/rand_source.h index b4c2110..d2e52ce 100755 --- a/thirdparties/iphone/include/srtp/rand_source.h +++ b/thirdparties/iphone/include/srtp/rand_source.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright(c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -60,7 +60,7 @@ rand_source_init(void); * and returns an error code. This error code should be checked, * and if a failure is reported, the data in the buffer MUST NOT * be used. - * + * * warning: If the return code is not checked, then non-random * data may inadvertently be used. * @@ -77,7 +77,7 @@ rand_source_get_octet_string(void *dest, uint32_t length); err_status_t rand_source_deinit(void); -/* +/* * function prototype for a random source function * * A rand_source_func_t writes num_octets at the location indicated by @@ -86,6 +86,6 @@ rand_source_deinit(void); */ typedef err_status_t (*rand_source_func_t) - (void *dest, uint32_t num_octets); +(void *dest, uint32_t num_octets); #endif /* RAND_SOURCE */ diff --git a/thirdparties/iphone/include/srtp/rdb.h b/thirdparties/iphone/include/srtp/rdb.h index 2ccb144..2432fae 100755 --- a/thirdparties/iphone/include/srtp/rdb.h +++ b/thirdparties/iphone/include/srtp/rdb.h @@ -21,11 +21,11 @@ */ typedef struct { - uint32_t window_start; /* packet index of the first bit in bitmask */ - v128_t bitmask; + uint32_t window_start; /* packet index of the first bit in bitmask */ + v128_t bitmask; } rdb_t; -#define rdb_bits_in_bitmask (8*sizeof(v128_t)) +#define rdb_bits_in_bitmask (8*sizeof(v128_t)) /* * rdb init @@ -49,7 +49,7 @@ rdb_init(rdb_t *rdb); */ err_status_t -rdb_check(const rdb_t *rdb, uint32_t rdb_index); +rdb_check(const rdb_t *rdb, uint32_t rdb_index); /* * rdb_add_index @@ -64,18 +64,18 @@ err_status_t rdb_add_index(rdb_t *rdb, uint32_t rdb_index); /* - * the functions rdb_increment() and rdb_get_value() are for use by + * the functions rdb_increment() and rdb_get_value() are for use by * senders, not receivers - DO NOT use these functions on the same * rdb_t upon which rdb_add_index is used! */ /* - * rdb_increment(db) increments the sequence number in db, if it is + * rdb_increment(db) increments the sequence number in db, if it is * not too high * * return values: - * + * * err_status_ok no problem * err_status_key_expired sequence number too high * @@ -91,4 +91,4 @@ uint32_t rdb_get_value(const rdb_t *rdb); -#endif /* REPLAY_DB_H */ +#endif /* REPLAY_DB_H */ diff --git a/thirdparties/iphone/include/srtp/rdbx.h b/thirdparties/iphone/include/srtp/rdbx.h index 146fb42..88055c2 100755 --- a/thirdparties/iphone/include/srtp/rdbx.h +++ b/thirdparties/iphone/include/srtp/rdbx.h @@ -14,7 +14,7 @@ #include "datatypes.h" #include "err.h" -/* #define ROC_TEST */ +/* #define ROC_TEST */ #ifndef ROC_TEST @@ -33,7 +33,7 @@ typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */ /* * An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended' - * sequence number. + * sequence number. */ typedef uint64_t xtd_seq_num_t; @@ -45,8 +45,8 @@ typedef uint64_t xtd_seq_num_t; */ typedef struct { - xtd_seq_num_t index; - bitvector_t bitmask; + xtd_seq_num_t index; + bitvector_t bitmask; } rdbx_t; @@ -73,7 +73,7 @@ rdbx_dealloc(rdbx_t *rdbx); /* * rdbx_estimate_index(rdbx, guess, s) - * + * * given an rdbx and a sequence number s (from a newly arrived packet), * sets the contents of *guess to contain the best guess of the packet * index to which s corresponds, and returns the difference between @@ -82,8 +82,8 @@ rdbx_dealloc(rdbx_t *rdbx); int rdbx_estimate_index(const rdbx_t *rdbx, - xtd_seq_num_t *guess, - sequence_number_t s); + xtd_seq_num_t *guess, + sequence_number_t s); /* * rdbx_check(rdbx, delta); @@ -98,7 +98,7 @@ rdbx_check(const rdbx_t *rdbx, int difference); /* * replay_add_index(rdbx, delta) - * + * * adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db * (and does *not* check if that xtd_seq_num_t appears in db) * @@ -116,7 +116,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta); * to have the rollover counter value roc. If that value is less than * the current rollover counter value, then the function returns * err_status_replay_old; otherwise, err_status_ok is returned. - * + * */ err_status_t @@ -125,7 +125,7 @@ rdbx_set_roc(rdbx_t *rdbx, uint32_t roc); /* * rdbx_get_roc(rdbx) returns the value of the rollover counter for * the rdbx_t pointed to by rdbx - * + * */ xtd_seq_num_t @@ -160,7 +160,7 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s); /* * index_guess(local, guess, s) - * + * * given a xtd_seq_num_t local (which represents the highest * known-to-be-good index) and a sequence number s (from a newly * arrived packet), sets the contents of *guess to contain the best @@ -170,8 +170,8 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s); int index_guess(const xtd_seq_num_t *local, - xtd_seq_num_t *guess, - sequence_number_t s); + xtd_seq_num_t *guess, + sequence_number_t s); #endif /* RDBX_H */ diff --git a/thirdparties/iphone/include/srtp/rtp.h b/thirdparties/iphone/include/srtp/rtp.h index 0e0119c..9b97ab6 100755 --- a/thirdparties/iphone/include/srtp/rtp.h +++ b/thirdparties/iphone/include/srtp/rtp.h @@ -1,6 +1,6 @@ /* * rtp.h - * + * * rtp interface for srtp reference implementation * * David A. McGrew @@ -15,26 +15,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -73,12 +73,12 @@ int rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len); int -rtp_receiver_init(rtp_receiver_t rcvr, int sock, - struct sockaddr_in addr, unsigned int ssrc); +rtp_receiver_init(rtp_receiver_t rcvr, int sock, + struct sockaddr_in addr, unsigned int ssrc); int -rtp_sender_init(rtp_sender_t sender, int sock, - struct sockaddr_in addr, unsigned int ssrc); +rtp_sender_init(rtp_sender_t sender, int sock, + struct sockaddr_in addr, unsigned int ssrc); /* * srtp_sender_init(...) initializes an rtp_sender_t @@ -86,17 +86,17 @@ rtp_sender_init(rtp_sender_t sender, int sock, int srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */ - struct sockaddr_in name, /* socket name */ - sec_serv_t security_services, /* sec. servs. to be used */ - unsigned char *input_key /* master key/salt in hex */ - ); + struct sockaddr_in name, /* socket name */ + sec_serv_t security_services, /* sec. servs. to be used */ + unsigned char *input_key /* master key/salt in hex */ + ); int srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */ - struct sockaddr_in name, /* socket name */ - sec_serv_t security_services, /* sec. servs. to be used */ - unsigned char *input_key /* master key/salt in hex */ - ); + struct sockaddr_in name, /* socket name */ + sec_serv_t security_services, /* sec. servs. to be used */ + unsigned char *input_key /* master key/salt in hex */ + ); int @@ -112,13 +112,13 @@ int rtp_receiver_deinit_srtp(rtp_receiver_t sender); -rtp_sender_t +rtp_sender_t rtp_sender_alloc(void); void rtp_sender_dealloc(rtp_sender_t rtp_ctx); -rtp_receiver_t +rtp_receiver_t rtp_receiver_alloc(void); void @@ -130,7 +130,7 @@ rtp_receiver_dealloc(rtp_receiver_t rtp_ctx); */ #define RTP_HEADER_LEN 12 -/* +/* * RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation */ #define RTP_MAX_BUF_LEN 16384 diff --git a/thirdparties/iphone/include/srtp/rtp_priv.h b/thirdparties/iphone/include/srtp/rtp_priv.h index 1421386..088cdbe 100755 --- a/thirdparties/iphone/include/srtp/rtp_priv.h +++ b/thirdparties/iphone/include/srtp/rtp_priv.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -52,22 +52,22 @@ typedef srtp_hdr_t rtp_hdr_t; typedef struct { - srtp_hdr_t header; - char body[RTP_MAX_BUF_LEN]; + srtp_hdr_t header; + char body[RTP_MAX_BUF_LEN]; } rtp_msg_t; typedef struct rtp_sender_ctx_t { - rtp_msg_t message; - int socket; - srtp_ctx_t *srtp_ctx; - struct sockaddr_in addr; /* reciever's address */ + rtp_msg_t message; + int socket; + srtp_ctx_t *srtp_ctx; + struct sockaddr_in addr; /* reciever's address */ } rtp_sender_ctx_t; typedef struct rtp_receiver_ctx_t { - rtp_msg_t message; - int socket; - srtp_ctx_t *srtp_ctx; - struct sockaddr_in addr; /* receiver's address */ + rtp_msg_t message; + int socket; + srtp_ctx_t *srtp_ctx; + struct sockaddr_in addr; /* receiver's address */ } rtp_receiver_ctx_t; diff --git a/thirdparties/iphone/include/srtp/sha1.h b/thirdparties/iphone/include/srtp/sha1.h index e3af4d4..65ecee4 100755 --- a/thirdparties/iphone/include/srtp/sha1.h +++ b/thirdparties/iphone/include/srtp/sha1.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -51,17 +51,17 @@ #include "datatypes.h" typedef struct { - uint32_t H[5]; /* state vector */ - uint32_t M[16]; /* message buffer */ - int octets_in_buffer; /* octets of message in buffer */ - uint32_t num_bits_in_msg; /* total number of bits in message */ + uint32_t H[5]; /* state vector */ + uint32_t M[16]; /* message buffer */ + int octets_in_buffer; /* octets of message in buffer */ + uint32_t num_bits_in_msg; /* total number of bits in message */ } sha1_ctx_t; /* * sha1(&ctx, msg, len, output) hashes the len octets starting at msg * into the SHA1 context, then writes the result to the 20 octets at * output - * + * */ void @@ -69,10 +69,10 @@ sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]); /* * sha1_init(&ctx) initializes the SHA1 context ctx - * + * * sha1_update(&ctx, msg, len) hashes the len octets starting at msg * into the SHA1 context - * + * * sha1_final(&ctx, output) performs the final processing of the SHA1 * context and writes the result to the 20 octets at output * @@ -90,7 +90,7 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]); /* * The sha1_core function is INTERNAL to SHA-1, but it is declared * here because it is also used by the cipher SEAL 3.0 in its key - * setup algorithm. + * setup algorithm. */ /* @@ -104,5 +104,5 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]); void sha1_core(const uint32_t M[16], uint32_t hash_value[5]); - + #endif /* SHA1_H */ diff --git a/thirdparties/iphone/include/srtp/srtp.h b/thirdparties/iphone/include/srtp/srtp.h index eb95e7d..6f6fc9c 100755 --- a/thirdparties/iphone/include/srtp/srtp.h +++ b/thirdparties/iphone/include/srtp/srtp.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -50,7 +50,7 @@ extern "C" { #endif -#include "crypto_kernel.h" +#include "crypto_kernel.h" /** * @defgroup SRTP Secure RTP @@ -76,7 +76,7 @@ extern "C" { * SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP */ -#define SRTP_MAX_TAG_LEN 12 +#define SRTP_MAX_TAG_LEN 12 /** * SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer @@ -86,85 +86,86 @@ extern "C" { * * @brief the maximum number of octets added by srtp_protect(). */ -#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN +#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN -/* +/* * nota bene: since libSRTP doesn't support the use of the MKI, the * SRTP_MAX_TRAILER_LEN value is just the maximum tag length */ /** - * @brief sec_serv_t describes a set of security services. + * @brief sec_serv_t describes a set of security services. * * A sec_serv_t enumeration is used to describe the particular * security services that will be applied by a particular crypto - * policy (or other mechanism). + * policy (or other mechanism). */ typedef enum { - sec_serv_none = 0, /**< no services */ - sec_serv_conf = 1, /**< confidentiality */ - sec_serv_auth = 2, /**< authentication */ - sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */ -} sec_serv_t; + sec_serv_none = 0, /**< no services */ + sec_serv_conf = 1, /**< confidentiality */ + sec_serv_auth = 2, /**< authentication */ + sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */ +} +sec_serv_t; -/** +/** * @brief crypto_policy_t describes a particular crypto policy that * can be applied to an SRTP stream. * * A crypto_policy_t describes a particular cryptographic policy that * can be applied to an SRTP or SRTCP stream. An SRTP session policy - * consists of a list of these policies, one for each SRTP stream + * consists of a list of these policies, one for each SRTP stream * in the session. */ typedef struct crypto_policy_t { - cipher_type_id_t cipher_type; /**< An integer representing + cipher_type_id_t cipher_type; /**< An integer representing * the type of cipher. */ - int cipher_key_len; /**< The length of the cipher key + int cipher_key_len; /**< The length of the cipher key * in octets. */ - auth_type_id_t auth_type; /**< An integer representing the + auth_type_id_t auth_type; /**< An integer representing the * authentication function. */ - int auth_key_len; /**< The length of the authentication + int auth_key_len; /**< The length of the authentication * function key in octets. */ - int auth_tag_len; /**< The length of the authentication + int auth_tag_len; /**< The length of the authentication * tag in octets. */ - sec_serv_t sec_serv; /**< The flag indicating the security + sec_serv_t sec_serv; /**< The flag indicating the security * services to be applied. */ } crypto_policy_t; -/** +/** * @brief ssrc_type_t describes the type of an SSRC. - * + * * An ssrc_type_t enumeration is used to indicate a type of SSRC. See * @ref srtp_policy_t for more informataion. */ -typedef enum { - ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */ - ssrc_specific = 1, /**< Indicates a specific SSRC value */ - ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value +typedef enum { + ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */ + ssrc_specific = 1, /**< Indicates a specific SSRC value */ + ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value (i.e. a value that is used in the function srtp_unprotect()) */ - ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value - (i.e. a value that is used in the + ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value + (i.e. a value that is used in the function srtp_protect()) */ } ssrc_type_t; /** * @brief An ssrc_t represents a particular SSRC value, or a `wildcard' SSRC. - * + * * An ssrc_t represents a particular SSRC value (if its type is * ssrc_specific), or a wildcard SSRC value that will match all * outbound SSRCs (if its type is ssrc_any_outbound) or all inbound - * SSRCs (if its type is ssrc_any_inbound). + * SSRCs (if its type is ssrc_any_inbound). * */ -typedef struct { - ssrc_type_t type; /**< The type of this particular SSRC */ - unsigned int value; /**< The value of this SSRC, if it is not a wildcard */ +typedef struct { + ssrc_type_t type; /**< The type of this particular SSRC */ + unsigned int value; /**< The value of this SSRC, if it is not a wildcard */ } ssrc_t; @@ -180,8 +181,8 @@ typedef struct ekt_policy_ctx_t *ekt_policy_t; typedef struct ekt_stream_ctx_t *ekt_stream_t; -/** - * @brief represents the policy for an SRTP session. +/** + * @brief represents the policy for an SRTP session. * * A single srtp_policy_t struct represents the policy for a single * SRTP stream, and a linked list of these elements represents the @@ -190,7 +191,7 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t; * master key for that stream, the SSRC describing that stream, or a * flag indicating a `wildcard' SSRC value, and a `next' field that * holds a pointer to the next element in the list of policy elements, - * or NULL if it is the last element. + * or NULL if it is the last element. * * The wildcard value SSRC_ANY_INBOUND matches any SSRC from an * inbound stream that for which there is no explicit SSRC entry in @@ -201,33 +202,33 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t; * is intentional, and it allows libSRTP to ensure that no security * lapses result from accidental re-use of SSRC values during key * sharing. - * - * + * + * * @warning The final element of the list @b must have its `next' pointer * set to NULL. */ typedef struct srtp_policy_t { - ssrc_t ssrc; /**< The SSRC value of stream, or the - * flags SSRC_ANY_INBOUND or + ssrc_t ssrc; /**< The SSRC value of stream, or the + * flags SSRC_ANY_INBOUND or * SSRC_ANY_OUTBOUND if key sharing * is used for this policy element. */ - crypto_policy_t rtp; /**< SRTP crypto policy. */ - crypto_policy_t rtcp; /**< SRTCP crypto policy. */ - unsigned char *key; /**< Pointer to the SRTP master key for + crypto_policy_t rtp; /**< SRTP crypto policy. */ + crypto_policy_t rtcp; /**< SRTCP crypto policy. */ + unsigned char *key; /**< Pointer to the SRTP master key for * this stream. */ - ekt_policy_t ekt; /**< Pointer to the EKT policy structure - * for this stream (if any) */ - unsigned long window_size; /**< The window size to use for replay + ekt_policy_t ekt; /**< Pointer to the EKT policy structure + * for this stream (if any) */ + unsigned long window_size; /**< The window size to use for replay * protection. */ - int allow_repeat_tx; /**< Whether retransmissions of + int allow_repeat_tx; /**< Whether retransmissions of * packets with the same sequence number * are allowed. (Note that such repeated * transmissions must have the same RTP * payload, or a severe security weakness * is introduced!) */ - struct srtp_policy_t *next; /**< Pointer to next stream policy. */ + struct srtp_policy_t *next; /**< Pointer to next stream policy. */ } srtp_policy_t; @@ -237,7 +238,7 @@ typedef struct srtp_policy_t { * @brief An srtp_t points to an SRTP session structure. * * The typedef srtp_t is a pointer to a structure that represents - * an SRTP session. This datatype is intentially opaque in + * an SRTP session. This datatype is intentially opaque in * order to separate the interface from the implementation. * * An SRTP session consists of all of the traffic sent to the RTP and @@ -254,11 +255,11 @@ typedef struct srtp_ctx_t *srtp_t; * * The typedef srtp_stream_t is a pointer to a structure that * represents an SRTP stream. This datatype is intentionally - * opaque in order to separate the interface from the implementation. - * + * opaque in order to separate the interface from the implementation. + * * An SRTP stream consists of all of the traffic sent to an SRTP * session by a single participant. A session can be viewed as - * a set of streams. + * a set of streams. * */ typedef struct srtp_stream_ctx_t *srtp_stream_t; @@ -266,7 +267,7 @@ typedef struct srtp_stream_ctx_t *srtp_stream_t; /** - * @brief srtp_init() initializes the srtp library. + * @brief srtp_init() initializes the srtp library. * * @warning This function @b must be called before any other srtp * functions. @@ -287,14 +288,14 @@ srtp_shutdown(void); /** * @brief srtp_protect() is the Secure RTP sender-side packet processing * function. - * + * * The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP * protection to the RTP packet rtp_hdr (which has length *len_ptr) using * the SRTP context ctx. If err_status_ok is returned, then rtp_hdr * points to the resulting SRTP packet and *len_ptr is the number of * octets in that packet; otherwise, no assumptions should be made * about the value of either data elements. - * + * * The sequence numbers of the RTP packets presented to this function * need not be consecutive, but they @b must be out of order by less * than 2^15 = 32,768 packets. @@ -314,7 +315,7 @@ srtp_shutdown(void); * complete SRTP packet after the call, if err_status_ok was returned. * Otherwise, the value of the data to which it points is undefined. * - * @return + * @return * - err_status_ok no problems * - err_status_replay_fail rtp sequence number was non-increasing * - @e other failure in cryptographic mechanisms @@ -322,7 +323,7 @@ srtp_shutdown(void); err_status_t srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr); - + /** * @brief srtp_unprotect() is the Secure RTP receiver-side packet * processing function. @@ -333,12 +334,12 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr); * err_status_ok is returned, then srtp_hdr points to the resulting * RTP packet and *len_ptr is the number of octets in that packet; * otherwise, no assumptions should be made about the value of either - * data elements. - * + * data elements. + * * The sequence numbers of the RTP packets presented to this function * need not be consecutive, but they @b must be out of order by less * than 2^15 = 32,768 packets. - * + * * @warning This function assumes that the SRTP packet is aligned on a * 32-bit boundary. * @@ -355,9 +356,9 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr); * complete rtp packet after the call, if err_status_ok was returned. * Otherwise, the value of the data to which it points is undefined. * - * @return + * @return * - err_status_ok if the RTP packet is valid. - * - err_status_auth_fail if the SRTP packet failed the message + * - err_status_auth_fail if the SRTP packet failed the message * authentication check. * - err_status_replay_fail if the SRTP packet is a replay (e.g. packet has * already been processed and accepted). @@ -377,14 +378,14 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr); * key. * * @param session is the SRTP session to which the policy is to be added. - * + * * @param policy is the srtp_policy_t struct that describes the policy * for the session. The struct may be a single element, or it may be * the head of a list, in which case each element of the list is * processed. It may also be NULL, in which case streams should be added * later using srtp_add_stream(). The final element of the list @b must * have its `next' field set to NULL. - * + * * @return * - err_status_ok if creation succeded. * - err_status_alloc_fail if allocation failed. @@ -398,7 +399,7 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy); /** * @brief srtp_add_stream() allocates and initializes an SRTP stream * within a given SRTP session. - * + * * The function call srtp_add_stream(session, policy) allocates and * initializes a new SRTP stream within a given, previously created * session, applying the policy given as the other argument to that @@ -411,13 +412,13 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy); */ err_status_t -srtp_add_stream(srtp_t session, - const srtp_policy_t *policy); +srtp_add_stream(srtp_t session, + const srtp_policy_t *policy); /** * @brief srtp_remove_stream() deallocates an SRTP stream. - * + * * The function call srtp_remove_stream(session, ssrc) removes * the SRTP stream with the SSRC value ssrc from the SRTP session * context given by the argument session. @@ -429,7 +430,7 @@ srtp_add_stream(srtp_t session, * * @warning Wildcard SSRC values cannot be removed from a * session. - * + * * @return * - err_status_ok if the stream deallocation succeded. * - [other] otherwise. @@ -443,8 +444,8 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc); * @brief crypto_policy_set_rtp_default() sets a crypto policy * structure to the SRTP default policy for RTP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtp_default(&p) sets the * crypto_policy_t at location p to the SRTP default policy for RTP * protection, as defined in the specification. This function is a @@ -453,9 +454,9 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc); * with this function call. Doing so may allow your code to be * forward compatible with later versions of libSRTP that include more * elements in the crypto_policy_t datatype. - * + * * @return void. - * + * */ void @@ -465,8 +466,8 @@ crypto_policy_set_rtp_default(crypto_policy_t *p); * @brief crypto_policy_set_rtcp_default() sets a crypto policy * structure to the SRTP default policy for RTCP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtcp_default(&p) sets the * crypto_policy_t at location p to the SRTP default policy for RTCP * protection, as defined in the specification. This function is a @@ -475,9 +476,9 @@ crypto_policy_set_rtp_default(crypto_policy_t *p); * with this function call. Doing so may allow your code to be * forward compatible with later versions of libSRTP that include more * elements in the crypto_policy_t datatype. - * + * * @return void. - * + * */ void @@ -487,15 +488,15 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * @brief crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto * policy structure to the SRTP default policy for RTP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function crypto_policy_set_aes_cm_128_hmac_sha1_80() is a * synonym for crypto_policy_set_rtp_default(). It conforms to the * naming convention used in RFC 4568 (SDP Security Descriptions for * Media Streams). - * + * * @return void. - * + * */ #define crypto_policy_set_aes_cm_128_hmac_sha1_80(p) crypto_policy_set_rtp_default(p) @@ -505,8 +506,8 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * @brief crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto * policy structure to a short-authentication tag policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_128_hmac_sha1_32(&p) * sets the crypto_policy_t at location p to use policy * AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568. @@ -516,7 +517,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * considered adequate only for protecting audio and video media that * use a stateless playback function. See Section 7.5 of RFC 3711 * (http://www.ietf.org/rfc/rfc3711.txt). - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -529,7 +530,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * (http://www.ietf.org/rfc/rfc3711.txt). * * @return void. - * + * */ void @@ -541,14 +542,14 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p); * @brief crypto_policy_set_aes_cm_128_null_auth() sets a crypto * policy structure to an encryption-only policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_128_null_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher * (AES-128 Counter Mode), but to use no authentication method. This * policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5 * of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt). - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -560,7 +561,7 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p); * Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt). * * @return void. - * + * */ void @@ -571,14 +572,14 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p); * @brief crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto * policy structure to an authentication-only policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_null_cipher_hmac_sha1_80(&p) * sets the crypto_policy_t at location p to use HMAC-SHA1 with an 80 * bit authentication tag to provide message authentication, but to * use no encryption. This policy is NOT RECOMMENDED for SRTP unless - * there is a requirement to forego encryption. - * + * there is a requirement to forego encryption. + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -586,10 +587,10 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @warning This policy is NOT RECOMMENDED for SRTP unless there is a - * requirement to forego encryption. + * requirement to forego encryption. * * @return void. - * + * */ void @@ -598,18 +599,18 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p); /** * @brief crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto - * policy structure to a encryption and authentication policy using AES-256 + * policy structure to a encryption and authentication policy using AES-256 * for RTP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_256_hmac_sha1_80(&p) * sets the crypto_policy_t at location p to use policy * AES_CM_256_HMAC_SHA1_80 as defined in * draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256 * Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit * authentication tag. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -617,7 +618,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); @@ -628,8 +629,8 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); * policy structure to a short-authentication tag policy using AES-256 * encryption. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_256_hmac_sha1_32(&p) * sets the crypto_policy_t at location p to use policy * AES_CM_256_HMAC_SHA1_32 as defined in @@ -639,7 +640,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); * considered adequate only for protecting audio and video media that * use a stateless playback function. See Section 7.5 of RFC 3711 * (http://www.ietf.org/rfc/rfc3711.txt). - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -652,7 +653,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); * (http://www.ietf.org/rfc/rfc3711.txt). * * @return void. - * + * */ void @@ -662,7 +663,7 @@ crypto_policy_set_aes_cm_256_hmac_sha1_32(crypto_policy_t *p); /** * @brief srtp_dealloc() deallocates storage for an SRTP session * context. - * + * * The function call srtp_dealloc(s) deallocates storage for the * SRTP session context s. This function should be called no more * than one time for each of the contexts allocated by the function @@ -680,7 +681,7 @@ srtp_dealloc(srtp_t s); /* - * @brief identifies a particular SRTP profile + * @brief identifies a particular SRTP profile * * An srtp_profile_t enumeration is used to identify a particular SRTP * profile (that is, a set of algorithms and parameters). These @@ -688,13 +689,13 @@ srtp_dealloc(srtp_t s); */ typedef enum { - srtp_profile_reserved = 0, - srtp_profile_aes128_cm_sha1_80 = 1, - srtp_profile_aes128_cm_sha1_32 = 2, - srtp_profile_aes256_cm_sha1_80 = 3, - srtp_profile_aes256_cm_sha1_32 = 4, - srtp_profile_null_sha1_80 = 5, - srtp_profile_null_sha1_32 = 6, + srtp_profile_reserved = 0, + srtp_profile_aes128_cm_sha1_80 = 1, + srtp_profile_aes128_cm_sha1_32 = 2, + srtp_profile_aes256_cm_sha1_80 = 3, + srtp_profile_aes256_cm_sha1_32 = 4, + srtp_profile_null_sha1_80 = 5, + srtp_profile_null_sha1_32 = 6, } srtp_profile_t; @@ -702,26 +703,26 @@ typedef enum { * @brief crypto_policy_set_from_profile_for_rtp() sets a crypto policy * structure to the appropriate value for RTP based on an srtp_profile_t * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtp_default(&policy, profile) * sets the crypto_policy_t at location policy to the policy for RTP * protection, as defined by the srtp_profile_t profile. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your * code to be forward compatible with later versions of libSRTP that * include more elements in the crypto_policy_t datatype. - * + * * @return values * - err_status_ok no problems were encountered - * - err_status_bad_param the profile is not supported - * + * - err_status_bad_param the profile is not supported + * */ err_status_t -crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy, - srtp_profile_t profile); +crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy, + srtp_profile_t profile); @@ -730,26 +731,26 @@ crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy, * @brief crypto_policy_set_from_profile_for_rtcp() sets a crypto policy * structure to the appropriate value for RTCP based on an srtp_profile_t * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtcp_default(&policy, profile) * sets the crypto_policy_t at location policy to the policy for RTCP * protection, as defined by the srtp_profile_t profile. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your * code to be forward compatible with later versions of libSRTP that * include more elements in the crypto_policy_t datatype. - * + * * @return values * - err_status_ok no problems were encountered - * - err_status_bad_param the profile is not supported - * + * - err_status_bad_param the profile is not supported + * */ err_status_t -crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy, - srtp_profile_t profile); +crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy, + srtp_profile_t profile); /** * @brief returns the master key length for a given SRTP profile @@ -767,18 +768,18 @@ srtp_profile_get_master_salt_length(srtp_profile_t profile); /** * @brief appends the salt to the key * - * The function call append_salt_to_key(k, klen, s, slen) + * The function call append_salt_to_key(k, klen, s, slen) * copies the string s to the location at klen bytes following - * the location k. + * the location k. * * @warning There must be at least bytes_in_salt + bytes_in_key bytes * available at the location pointed to by key. - * + * */ void append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, - unsigned char *salt, unsigned int bytes_in_salt); + unsigned char *salt, unsigned int bytes_in_salt); @@ -790,7 +791,7 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, /** * @defgroup SRTCP Secure RTCP - * @ingroup SRTP + * @ingroup SRTP * * @brief Secure RTCP functions are used to protect RTCP traffic. * @@ -798,26 +799,26 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, * traffic in much the same way as it does RTP traffic. The function * srtp_protect_rtcp() applies cryptographic protections to outbound * RTCP packets, and srtp_unprotect_rtcp() verifies the protections on - * inbound RTCP packets. + * inbound RTCP packets. * * A note on the naming convention: srtp_protect_rtcp() has an srtp_t * as its first argument, and thus has `srtp_' as its prefix. The - * trailing `_rtcp' indicates the protocol on which it acts. - * + * trailing `_rtcp' indicates the protocol on which it acts. + * * @{ */ /** * @brief srtp_protect_rtcp() is the Secure RTCP sender-side packet * processing function. - * + * * The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies * SRTCP protection to the RTCP packet rtcp_hdr (which has length * *len_ptr) using the SRTP session context ctx. If err_status_ok is * returned, then rtp_hdr points to the resulting SRTCP packet and * *len_ptr is the number of octets in that packet; otherwise, no * assumptions should be made about the value of either data elements. - * + * * @warning This function assumes that it can write the authentication * tag into the location in memory immediately following the RTCP * packet, and assumes that the RTCP packet is aligned on a 32-bit @@ -834,14 +835,14 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, * was returned. Otherwise, the value of the data to which it points * is undefined. * - * @return + * @return * - err_status_ok if there were no problems. - * - [other] if there was a failure in + * - [other] if there was a failure in * the cryptographic mechanisms. */ - -err_status_t + +err_status_t srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); /** @@ -855,7 +856,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); * to the resulting RTCP packet and *len_ptr is the number of octets * in that packet; otherwise, no assumptions should be made about the * value of either data elements. - * + * * @warning This function assumes that the SRTCP packet is aligned on a * 32-bit boundary. * @@ -873,9 +874,9 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); * returned. Otherwise, the value of the data to which it points is * undefined. * - * @return + * @return * - err_status_ok if the RTCP packet is valid. - * - err_status_auth_fail if the SRTCP packet failed the message + * - err_status_auth_fail if the SRTCP packet failed the message * authentication check. * - err_status_replay_fail if the SRTCP packet is a replay (e.g. has * already been processed and accepted). @@ -883,7 +884,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); * */ -err_status_t +err_status_t srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len); /** @@ -894,10 +895,10 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len); * @defgroup SRTPevents SRTP events and callbacks * @ingroup SRTP * - * @brief libSRTP can use a user-provided callback function to + * @brief libSRTP can use a user-provided callback function to * handle events. * - * + * * libSRTP allows a user to provide a callback function to handle * events that need to be dealt with outside of the data plane (see * the enum srtp_event_t for a description of these events). Dealing @@ -918,8 +919,8 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len); * @brief srtp_event_t defines events that need to be handled * * The enum srtp_event_t defines events that need to be handled - * outside the `data plane', such as SSRC collisions and - * key expirations. + * outside the `data plane', such as SSRC collisions and + * key expirations. * * When a key expires or the maximum number of packets has been * reached, an SRTP stream will enter an `expired' state in which no @@ -932,33 +933,33 @@ srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len); * latter case, all of the streams in the session will expire. */ -typedef enum { - event_ssrc_collision, /**< - * An SSRC collision occured. +typedef enum { + event_ssrc_collision, /**< + * An SSRC collision occured. */ - event_key_soft_limit, /**< An SRTP stream reached the soft key - * usage limit and will expire soon. + event_key_soft_limit, /**< An SRTP stream reached the soft key + * usage limit and will expire soon. */ - event_key_hard_limit, /**< An SRTP stream reached the hard + event_key_hard_limit, /**< An SRTP stream reached the hard * key usage limit and has expired. */ - event_packet_index_limit /**< An SRTP stream reached the hard - * packet limit (2^48 packets). + event_packet_index_limit /**< An SRTP stream reached the hard + * packet limit (2^48 packets). */ } srtp_event_t; /** - * @brief srtp_event_data_t is the structure passed as a callback to + * @brief srtp_event_data_t is the structure passed as a callback to * the event handler function * * The struct srtp_event_data_t holds the data passed to the event - * handler function. + * handler function. */ typedef struct srtp_event_data_t { - srtp_t session; /**< The session in which the event happend. */ - srtp_stream_t stream; /**< The stream in which the event happend. */ - srtp_event_t event; /**< An enum indicating the type of event. */ + srtp_t session; /**< The session in which the event happend. */ + srtp_stream_t stream; /**< The stream in which the event happend. */ + srtp_event_t event; /**< An enum indicating the type of event. */ } srtp_event_data_t; /** @@ -976,7 +977,7 @@ typedef void (srtp_event_handler_func_t)(srtp_event_data_t *data); /** * @brief sets the event handler to the function supplied by the caller. - * + * * The function call srtp_install_event_handler(func) sets the event * handler function to the value func. The value NULL is acceptable * as an argument; in this case, events will be ignored rather than diff --git a/thirdparties/iphone/include/srtp/srtp_priv.h b/thirdparties/iphone/include/srtp/srtp_priv.h index cf2274e..997a115 100755 --- a/thirdparties/iphone/include/srtp/srtp_priv.h +++ b/thirdparties/iphone/include/srtp/srtp_priv.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -54,56 +54,56 @@ * an srtp_hdr_t represents the srtp header * * in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned - * + * * (note that this definition follows that of RFC 1889 Appendix A, but * is not identical) */ - + #ifndef WORDS_BIGENDIAN /* * srtp_hdr_t represents an RTP or SRTP header. The bit-fields in - * this structure should be declared "unsigned int" instead of + * this structure should be declared "unsigned int" instead of * "unsigned char", but doing so causes the MS compiler to not * fully pack the bit fields. */ typedef struct { - unsigned char cc:4; /* CSRC count */ - unsigned char x:1; /* header extension flag */ - unsigned char p:1; /* padding flag */ - unsigned char version:2; /* protocol version */ - unsigned char pt:7; /* payload type */ - unsigned char m:1; /* marker bit */ - uint16_t seq; /* sequence number */ - uint32_t ts; /* timestamp */ - uint32_t ssrc; /* synchronization source */ + unsigned char cc:4; /* CSRC count */ + unsigned char x:1; /* header extension flag */ + unsigned char p:1; /* padding flag */ + unsigned char version:2; /* protocol version */ + unsigned char pt:7; /* payload type */ + unsigned char m:1; /* marker bit */ + uint16_t seq; /* sequence number */ + uint32_t ts; /* timestamp */ + uint32_t ssrc; /* synchronization source */ } srtp_hdr_t; #else /* BIG_ENDIAN */ typedef struct { - unsigned char version:2; /* protocol version */ - unsigned char p:1; /* padding flag */ - unsigned char x:1; /* header extension flag */ - unsigned char cc:4; /* CSRC count */ - unsigned char m:1; /* marker bit */ - unsigned pt:7; /* payload type */ - uint16_t seq; /* sequence number */ - uint32_t ts; /* timestamp */ - uint32_t ssrc; /* synchronization source */ + unsigned char version:2; /* protocol version */ + unsigned char p:1; /* padding flag */ + unsigned char x:1; /* header extension flag */ + unsigned char cc:4; /* CSRC count */ + unsigned char m:1; /* marker bit */ + unsigned pt:7; /* payload type */ + uint16_t seq; /* sequence number */ + uint32_t ts; /* timestamp */ + uint32_t ssrc; /* synchronization source */ } srtp_hdr_t; #endif typedef struct { - uint16_t profile_specific; /* profile-specific info */ - uint16_t length; /* number of 32-bit words in extension */ + uint16_t profile_specific; /* profile-specific info */ + uint16_t length; /* number of 32-bit words in extension */ } srtp_hdr_xtnd_t; /* - * srtcp_hdr_t represents a secure rtcp header + * srtcp_hdr_t represents a secure rtcp header * * in this implementation, an srtcp header is assumed to be 32-bit * alinged @@ -112,53 +112,53 @@ typedef struct { #ifndef WORDS_BIGENDIAN typedef struct { - unsigned char rc:5; /* reception report count */ - unsigned char p:1; /* padding flag */ - unsigned char version:2; /* protocol version */ - unsigned char pt:8; /* payload type */ - uint16_t len; /* length */ - uint32_t ssrc; /* synchronization source */ + unsigned char rc:5; /* reception report count */ + unsigned char p:1; /* padding flag */ + unsigned char version:2; /* protocol version */ + unsigned char pt:8; /* payload type */ + uint16_t len; /* length */ + uint32_t ssrc; /* synchronization source */ } srtcp_hdr_t; typedef struct { - unsigned int index:31; /* srtcp packet index in network order! */ - unsigned int e:1; /* encrypted? 1=yes */ - /* optional mikey/etc go here */ - /* and then the variable-length auth tag */ + unsigned int index:31; /* srtcp packet index in network order! */ + unsigned int e:1; /* encrypted? 1=yes */ + /* optional mikey/etc go here */ + /* and then the variable-length auth tag */ } srtcp_trailer_t; #else /* BIG_ENDIAN */ typedef struct { - unsigned char version:2; /* protocol version */ - unsigned char p:1; /* padding flag */ - unsigned char rc:5; /* reception report count */ - unsigned char pt:8; /* payload type */ - uint16_t len; /* length */ - uint32_t ssrc; /* synchronization source */ + unsigned char version:2; /* protocol version */ + unsigned char p:1; /* padding flag */ + unsigned char rc:5; /* reception report count */ + unsigned char pt:8; /* payload type */ + uint16_t len; /* length */ + uint32_t ssrc; /* synchronization source */ } srtcp_hdr_t; typedef struct { - unsigned int version:2; /* protocol version */ - unsigned int p:1; /* padding flag */ - unsigned int count:5; /* varies by packet type */ - unsigned int pt:8; /* payload type */ - uint16_t length; /* len of uint32s of packet less header */ + unsigned int version:2; /* protocol version */ + unsigned int p:1; /* padding flag */ + unsigned int count:5; /* varies by packet type */ + unsigned int pt:8; /* payload type */ + uint16_t length; /* len of uint32s of packet less header */ } rtcp_common_t; typedef struct { - unsigned int e:1; /* encrypted? 1=yes */ - unsigned int index:31; /* srtcp packet index */ - /* optional mikey/etc go here */ - /* and then the variable-length auth tag */ + unsigned int e:1; /* encrypted? 1=yes */ + unsigned int index:31; /* srtcp packet index */ + /* optional mikey/etc go here */ + /* and then the variable-length auth tag */ } srtcp_trailer_t; #endif /* - * the following declarations are libSRTP internal functions + * the following declarations are libSRTP internal functions */ /* @@ -166,7 +166,7 @@ typedef struct { * to ssrc, or NULL if no stream exists for that ssrc */ -srtp_stream_t +srtp_stream_t srtp_get_stream(srtp_t srtp, uint32_t ssrc); @@ -180,47 +180,47 @@ err_status_t srtp_stream_init_keys(srtp_stream_t srtp, const void *key); /* - * srtp_stream_init(s, p) initializes the srtp_stream_t s to + * srtp_stream_init(s, p) initializes the srtp_stream_t s to * use the policy at the location p */ err_status_t -srtp_stream_init(srtp_stream_t srtp, - const srtp_policy_t *p); +srtp_stream_init(srtp_stream_t srtp, + const srtp_policy_t *p); /* - * libsrtp internal datatypes + * libsrtp internal datatypes */ -typedef enum direction_t { - dir_unknown = 0, - dir_srtp_sender = 1, - dir_srtp_receiver = 2 +typedef enum direction_t { + dir_unknown = 0, + dir_srtp_sender = 1, + dir_srtp_receiver = 2 } direction_t; -/* +/* * an srtp_stream_t has its own SSRC, encryption key, authentication * key, sequence number, and replay database - * + * * note that the keys might not actually be unique, in which case the * cipher_t and auth_t pointers will point to the same structures */ typedef struct srtp_stream_ctx_t { - uint32_t ssrc; - cipher_t *rtp_cipher; - auth_t *rtp_auth; - rdbx_t rtp_rdbx; - sec_serv_t rtp_services; - cipher_t *rtcp_cipher; - auth_t *rtcp_auth; - rdb_t rtcp_rdb; - sec_serv_t rtcp_services; - key_limit_ctx_t *limit; - direction_t direction; - int allow_repeat_tx; - ekt_stream_t ekt; - struct srtp_stream_ctx_t *next; /* linked list of streams */ + uint32_t ssrc; + cipher_t *rtp_cipher; + auth_t *rtp_auth; + rdbx_t rtp_rdbx; + sec_serv_t rtp_services; + cipher_t *rtcp_cipher; + auth_t *rtcp_auth; + rdb_t rtcp_rdb; + sec_serv_t rtcp_services; + key_limit_ctx_t *limit; + direction_t direction; + int allow_repeat_tx; + ekt_stream_t ekt; + struct srtp_stream_ctx_t *next; /* linked list of streams */ } srtp_stream_ctx_t; @@ -229,8 +229,8 @@ typedef struct srtp_stream_ctx_t { */ typedef struct srtp_ctx_t { - srtp_stream_ctx_t *stream_list; /* linked list of streams */ - srtp_stream_ctx_t *stream_template; /* act as template for other streams */ + srtp_stream_ctx_t *stream_list; /* linked list of streams */ + srtp_stream_ctx_t *stream_template; /* act as template for other streams */ } srtp_ctx_t; @@ -239,7 +239,7 @@ typedef struct srtp_ctx_t { * srtp_handle_event(srtp, srtm, evnt) calls the event handling * function, if there is one. * - * This macro is not included in the documentation as it is + * This macro is not included in the documentation as it is * an internal-only function. */ @@ -250,7 +250,7 @@ typedef struct srtp_ctx_t { data.stream = strm; \ data.event = evnt; \ srtp_event_handler(&data); \ -} +} #endif /* SRTP_PRIV_H */ diff --git a/thirdparties/iphone/include/srtp/stat.h b/thirdparties/iphone/include/srtp/stat.h index e28b131..a67a380 100755 --- a/thirdparties/iphone/include/srtp/stat.h +++ b/thirdparties/iphone/include/srtp/stat.h @@ -1,6 +1,6 @@ /* * stats.h - * + * * interface to statistical test functions * * David A. McGrew @@ -8,26 +8,26 @@ */ /* - * + * * Copyright(c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/thirdparties/iphone/include/srtp/ut_sim.h b/thirdparties/iphone/include/srtp/ut_sim.h index c25feeb..bd7d015 100755 --- a/thirdparties/iphone/include/srtp/ut_sim.h +++ b/thirdparties/iphone/include/srtp/ut_sim.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -54,12 +54,12 @@ #define UT_BUF 160 /* maximum amount of packet reorder */ typedef struct { - uint32_t index; - uint32_t buffer[UT_BUF]; + uint32_t index; + uint32_t buffer[UT_BUF]; } ut_connection; /* - * ut_init(&u) initializes the ut_connection + * ut_init(&u) initializes the ut_connection * * this function should always be the first one called on a new * ut_connection diff --git a/thirdparties/iphone/include/srtp/xfm.h b/thirdparties/iphone/include/srtp/xfm.h index 5837149..a5e393f 100755 --- a/thirdparties/iphone/include/srtp/xfm.h +++ b/thirdparties/iphone/include/srtp/xfm.h @@ -2,7 +2,7 @@ * xfm.h * * interface for abstract crypto transform - * + * * David A. McGrew * Cisco Systems, Inc. */ @@ -28,12 +28,12 @@ * The function pointer xfm_func_t points to a function that * implements a crypto transform, and provides a uniform API for * accessing crypto mechanisms. - * - * @param key location of secret key * - * @param clear data to be authenticated only + * @param key location of secret key + * + * @param clear data to be authenticated only * - * @param clear_len length of data to be authenticated only + * @param clear_len length of data to be authenticated only * * @param iv location to write the Initialization Vector (IV) * @@ -45,38 +45,38 @@ * encrypted and authenticated (before the function call), and the * length of the ciphertext (after the call) * - * @param auth_tag location to write auth tag + * @param auth_tag location to write auth tag */ -typedef err_status_t (*xfm_func_t) - (void *key, - void *clear, - unsigned clear_len, - void *iv, - void *protect, - unsigned *protected_len, - void *auth_tag - ); - -typedef +typedef err_status_t (*xfm_func_t) +(void *key, + void *clear, + unsigned clear_len, + void *iv, + void *protect, + unsigned *protected_len, + void *auth_tag +); + +typedef err_status_t (*xfm_inv_t) - (void *key, /* location of secret key */ - void *clear, /* data to be authenticated only */ - unsigned clear_len, /* length of data to be authenticated only */ - void *iv, /* location of iv */ - void *opaque, /* data to be decrypted and authenticated */ - unsigned *opaque_len, /* location of the length of data to be - * decrypted and authd (before and after) +(void *key, /* location of secret key */ + void *clear, /* data to be authenticated only */ + unsigned clear_len, /* length of data to be authenticated only */ + void *iv, /* location of iv */ + void *opaque, /* data to be decrypted and authenticated */ + unsigned *opaque_len, /* location of the length of data to be + * decrypted and authd (before and after) */ - void *auth_tag /* location of auth tag */ - ); + void *auth_tag /* location of auth tag */ +); typedef struct xfm_ctx_t { - xfm_func_t func; - xfm_inv_t inv; - unsigned key_len; - unsigned iv_len; - unsigned auth_tag_len; + xfm_func_t func; + xfm_inv_t inv; + unsigned key_len; + unsigned iv_len; + unsigned auth_tag_len; } xfm_ctx_t; typedef xfm_ctx_t *xfm_t; @@ -89,35 +89,35 @@ typedef xfm_ctx_t *xfm_t; /* cryptoalgo - 5/28 */ - -typedef err_status_t (*cryptoalg_func_t) - (void *key, - void *clear, - unsigned clear_len, - void *iv, - void *opaque, - unsigned *opaque_len - ); - -typedef + +typedef err_status_t (*cryptoalg_func_t) +(void *key, + void *clear, + unsigned clear_len, + void *iv, + void *opaque, + unsigned *opaque_len +); + +typedef err_status_t (*cryptoalg_inv_t) - (void *key, /* location of secret key */ - void *clear, /* data to be authenticated only */ - unsigned clear_len, /* length of data to be authenticated only */ - void *iv, /* location of iv */ - void *opaque, /* data to be decrypted and authenticated */ - unsigned *opaque_len /* location of the length of data to be - * decrypted and authd (before and after) +(void *key, /* location of secret key */ + void *clear, /* data to be authenticated only */ + unsigned clear_len, /* length of data to be authenticated only */ + void *iv, /* location of iv */ + void *opaque, /* data to be decrypted and authenticated */ + unsigned *opaque_len /* location of the length of data to be + * decrypted and authd (before and after) */ - ); +); typedef struct cryptoalg_ctx_t { - cryptoalg_func_t enc; - cryptoalg_inv_t dec; - unsigned key_len; - unsigned iv_len; - unsigned auth_tag_len; - unsigned max_expansion; + cryptoalg_func_t enc; + cryptoalg_inv_t dec; + unsigned key_len; + unsigned iv_len; + unsigned auth_tag_len; + unsigned max_expansion; } cryptoalg_ctx_t; typedef cryptoalg_ctx_t *cryptoalg_t; |