summaryrefslogtreecommitdiff
path: root/cesar/cp/secu
diff options
context:
space:
mode:
authordufour2009-10-21 10:10:07 +0000
committerdufour2009-10-21 10:10:07 +0000
commit2d00d3eac8b37ac4fe30544dda5b34bc822edd62 (patch)
tree83a838ccc2a0a8150930a3166481fe5b08824155 /cesar/cp/secu
parent39930c6272366948fbe90dc1be95a192009b0763 (diff)
cesar/cp/secu: decrease iteration of PBKDF1 to generate hash, closes #659
The number of PBKDF1 iteration to generate some hash is now 5 instead of 1000. This is against the norm, but this is enough to generate a valid hash. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6210 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp/secu')
-rw-r--r--cesar/cp/secu/defs.h3
-rw-r--r--cesar/cp/secu/src/secu.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/cesar/cp/secu/defs.h b/cesar/cp/secu/defs.h
index 3c44a82d94..d3adcfef3e 100644
--- a/cesar/cp/secu/defs.h
+++ b/cesar/cp/secu/defs.h
@@ -35,6 +35,9 @@
/** PBKDF1 iteration for NEK . */
#define CP_SECU_PBKDF1_ITERATION_NEK 5
+/** PBKDF1 iteration for HASH. */
+#define CP_SECU_PBKDF1_ITERATION_HASH 5
+
/** AES Size. */
#define CP_SECU_AES_SIZE 16
diff --git a/cesar/cp/secu/src/secu.c b/cesar/cp/secu/src/secu.c
index 589da55de0..7f4b5f8424 100644
--- a/cesar/cp/secu/src/secu.c
+++ b/cesar/cp/secu/src/secu.c
@@ -197,7 +197,7 @@ cp_secu_generate_hash (cp_t *ctx, const u32 seed, u8 *hash,
cp_secu_pbkdf1 (ctx, (u8 *) &seed, sizeof (seed),
&hash[compt * CP_SECU_OUTPUT_KEY_SIZE],
CP_SECU_OUTPUT_KEY_SIZE,
- CP_SECU_SALT_SPIDCOM, CP_SECU_PBKDF1_ITERATION);
+ CP_SECU_SALT_SPIDCOM, CP_SECU_PBKDF1_ITERATION_HASH);
}
/* Check if last part is not enought for CP_SECU_OUTPUT_KEY_SIZE. */
uint modulo = hash_length % CP_SECU_OUTPUT_KEY_SIZE;
@@ -206,7 +206,7 @@ cp_secu_generate_hash (cp_t *ctx, const u32 seed, u8 *hash,
cp_secu_pbkdf1 (ctx, (u8 *) &seed, sizeof (seed),
&hash[iteration * CP_SECU_OUTPUT_KEY_SIZE],
modulo,
- CP_SECU_SALT_SPIDCOM, CP_SECU_PBKDF1_ITERATION);
+ CP_SECU_SALT_SPIDCOM, CP_SECU_PBKDF1_ITERATION_HASH);
}
}