summaryrefslogtreecommitdiff
path: root/cesar/cp/secu/src
diff options
context:
space:
mode:
authordufour2009-02-18 14:43:39 +0000
committerdufour2009-02-18 14:43:39 +0000
commitfbc67bee6f05dcba8fcca2ade64a853fe4128e4a (patch)
tree7bd3649c9295397d7e4a0cd000f09c81de81b469 /cesar/cp/secu/src
parent1ddd9bc2aa36d4e3a5eb4b58be021a5829f7c0ff (diff)
* cp/sec (see #177):
- cp_secu_tek_gen need two hash keys of fixed length (no need to give it as arguments). git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4034 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp/secu/src')
-rw-r--r--cesar/cp/secu/src/secu.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cesar/cp/secu/src/secu.c b/cesar/cp/secu/src/secu.c
index 65ccd61e25..39bfd895c3 100644
--- a/cesar/cp/secu/src/secu.c
+++ b/cesar/cp/secu/src/secu.c
@@ -148,25 +148,25 @@ cp_secu_nmk2nid(cp_key_t nmk, u8 security_level)
}
void
-cp_secu_tek_gen (const u32 left[], const uint left_len,
- const u32 right[], const uint right_len,
- cp_key_t *output)
+cp_secu_tek_gen (const u32 left[], const u32 right[], cp_key_t *output)
{
- u8 sha_buff[left_len + right_len];
+ u8 sha_buff[CP_SECU_HASH_KEY_FOR_TEK_SIZE * 2];
u8 output_buffer [CP_SECU_SHA256_SIZE];
dbg_assert (left);
dbg_assert (right);
dbg_assert (output);
/* Insert the left part in the left part of the sha_buf. */
- memcpy (sha_buff + right_len, left, left_len);
- memcpy (sha_buff, right, right_len);
+ memcpy (sha_buff + CP_SECU_HASH_KEY_FOR_TEK_SIZE, left,
+ CP_SECU_HASH_KEY_FOR_TEK_SIZE);
+ memcpy (sha_buff, right, CP_SECU_HASH_KEY_FOR_TEK_SIZE);
/* Salt is NULL, no salt use for the tek
* the first 0 is for the salt length
* the second one is for the iteration number.
* see HPAV section 7.10.7.2. Paragraph 4 .*/
- cp_secu_sha256 (sha_buff, left_len + right_len, output_buffer);
+ cp_secu_sha256 (sha_buff, CP_SECU_HASH_KEY_FOR_TEK_SIZE * 2,
+ output_buffer);
/* Copy the leftmost 16 bytes. */
memcpy (output->key, output_buffer, 16);