summaryrefslogtreecommitdiff
path: root/src/cipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cipher.c')
-rw-r--r--src/cipher.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/cipher.c b/src/cipher.c
index 95450ae..4bd9eec 100644
--- a/src/cipher.c
+++ b/src/cipher.c
@@ -261,11 +261,10 @@ int cipher_aesctr_calc_ctr(cipher_t* c, key_derivation_t* kd, seq_nr_t seq_nr, s
if(ret < 0)
return ret;
- int faked_msb = 0;
- if(!c->salt_.buf_[0]) {
+#ifdef ANYTUN_02_COMPAT
+ if(!c->salt_.buf_[0])
c->salt_.buf_[0] = 1;
- faked_msb = 1;
- }
+#endif
memcpy(params->ctr_.salt_.buf_, c->salt_.buf_, C_AESCTR_SALT_LENGTH);
params->ctr_.salt_.zero_ = 0;
@@ -273,13 +272,6 @@ int cipher_aesctr_calc_ctr(cipher_t* c, key_derivation_t* kd, seq_nr_t seq_nr, s
params->ctr_.params_.sender_id_ ^= SENDER_ID_T_HTON(sender_id);
params->ctr_.params_.seq_nr_ ^= SEQ_NR_T_HTON(seq_nr);
-#ifndef ANYTUN_02_COMPAT
- if(faked_msb) {
- c->salt_.buf_[0] = 0;
- params->ctr_.buf_[0] = 0;
- }
-#endif
-
return 0;
}