summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-01-02 20:01:35 +0000
committerChristian Pointner <equinox@anytun.org>2009-01-02 20:01:35 +0000
commit2e07c29960c20d74814a94b567fda782b3f7c5d5 (patch)
tree87658650e335519fa7fc47a0ab16a4735d742cae
parentsome improvements in key derivation (diff)
changed to anytun compatible version
-rw-r--r--src/cipher.c8
-rw-r--r--src/key_derivation.c11
2 files changed, 10 insertions, 9 deletions
diff --git a/src/cipher.c b/src/cipher.c
index 22fba9a..d400ca8 100644
--- a/src/cipher.c
+++ b/src/cipher.c
@@ -239,10 +239,10 @@ buffer_t cipher_aesctr_calc_ctr(cipher_t* c, key_derivation_t* kd, seq_nr_t seq_
mpz_mul_2exp(ctr, ctr, 16);
result.buf_ = mpz_export(NULL, (size_t*)&result.length_, 1, 1, 0, 0, ctr);
- if(faked_msb) {
- c->salt_.buf_[0] = 0;
- result.buf_[0] = 0;
- }
+/* if(faked_msb) { */
+/* c->salt_.buf_[0] = 0; */
+/* result.buf_[0] = 0; */
+/* } */
mpz_clear(ctr);
mpz_clear(sid_mux);
diff --git a/src/key_derivation.c b/src/key_derivation.c
index 3977993..e53d7f6 100644
--- a/src/key_derivation.c
+++ b/src/key_derivation.c
@@ -229,7 +229,8 @@ int key_derivation_aesctr_calc_ctr(key_derivation_t* kd, key_store_t* result, sa
mpz_import(ctr, kd->master_salt_.length_, 1, 1, 0, 0, kd->master_salt_.buf_);
mpz_set_ui(key_id, label);
- mpz_mul_2exp(key_id, key_id, (sizeof(r) * 8));
+/* mpz_mul_2exp(key_id, key_id, (sizeof(r) * 8)); */
+ mpz_mul_2exp(key_id, key_id, 48);
mpz_add_ui(key_id, key_id, r);
mpz_xor(ctr, ctr, key_id);
@@ -239,10 +240,10 @@ int key_derivation_aesctr_calc_ctr(key_derivation_t* kd, key_store_t* result, sa
free(result->key_.buf_);
result->key_.buf_ = mpz_export(NULL, (size_t*)&(result->key_.length_), 1, 1, 0, 0, ctr);
- if(faked_msb) {
- kd->master_salt_.buf_[0] = 0;
- result->key_.buf_[0] = 0;
- }
+/* if(faked_msb) { */
+/* kd->master_salt_.buf_[0] = 0; */
+/* result->key_.buf_[0] = 0; */
+/* } */
mpz_clear(ctr);
mpz_clear(key_id);