1diff --git a/google3/third_party/libsrtp/crypto/cipher/aes_icm.c b/google3/third_party/libsrtp/crypto/cipher/aes_icm.c 2index d333899..45714c0 100644 3--- a/google3/third_party/libsrtp/crypto/cipher/aes_icm.c 4+++ b/google3/third_party/libsrtp/crypto/cipher/aes_icm.c 5@@ -164,18 +164,20 @@ aes_icm_dealloc(cipher_t *c) { 6 err_status_t 7 aes_icm_context_init(aes_icm_ctx_t *c, const uint8_t *key) { 8 v128_t tmp_key; 9+ int i; 10 11 /* set counter and initial values to 'offset' value */ 12 /* FIX!!! this assumes the salt is at key + 16, and thus that the */ 13- /* FIX!!! cipher key length is 16! Also note this copies past the 14- end of the 'key' array by 2 bytes! */ 15- v128_copy_octet_string(&c->counter, key + 16); 16- v128_copy_octet_string(&c->offset, key + 16); 17+ /* FIX!!! cipher key length is 16! */ 18+ for (i = 0; i < 14; i++) { 19+ c->counter.v8[i] = key[16 + i]; 20+ c->offset.v8[i] = key[16 + i]; 21+ } 22 23 /* force last two octets of the offset to zero (for srtp compatibility) */ 24 c->offset.v8[14] = c->offset.v8[15] = 0; 25 c->counter.v8[14] = c->counter.v8[15] = 0; 26- 27+ 28 /* set tmp_key (for alignment) */ 29 v128_copy_octet_string(&tmp_key, key); 30 31@@ -508,4 +510,3 @@ cipher_type_t aes_icm = { 32 (cipher_test_case_t *) &aes_icm_test_case_0, 33 (debug_module_t *) &mod_aes_icm 34 }; 35- 36