diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 4 | ||||
-rw-r--r-- | src/cipher.c | 14 | ||||
-rw-r--r-- | src/key_derivation.c | 14 |
3 files changed, 8 insertions, 24 deletions
diff --git a/src/Makefile b/src/Makefile index aa2b594..bdee4fe 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,9 +34,9 @@ TARGET=$(shell uname -s) CC = gcc -CCFLAGS = -g -O2 -DANYTUN_02_COMPAT -DUSE_SSL_CRYPTO #-DNO_CRYPT +CCFLAGS = -g -O2 -DANYTUN_02_COMPAT #-DUSE_SSL_CRYPTO #-DNO_CRYPT LD = gcc -LDFLAGS = -g -Wall -O2 -lgcrypt -lgpg-error -lcrypto +LDFLAGS = -g -Wall -O2 -lgcrypt -lgpg-error #-lcrypto ifeq ($(TARGET),Linux) LDFLAGS += -ldl 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; } diff --git a/src/key_derivation.c b/src/key_derivation.c index 84abdae..af3228d 100644 --- a/src/key_derivation.c +++ b/src/key_derivation.c @@ -239,11 +239,10 @@ int key_derivation_aesctr_calc_ctr(key_derivation_t* kd, seq_nr_t* r, satp_prf_l return 0; } - int faked_msb = 0; - if(!kd->master_salt_.buf_[0]) { +#ifdef ANYTUN_02_COMPAT + if(!kd->master_salt_.buf_[0]) kd->master_salt_.buf_[0] = 1; - faked_msb = 1; - } +#endif if(kd->master_salt_.length_ != KD_AESCTR_SALT_LENGTH) { log_printf(ERR, "master salt has the wrong length"); @@ -254,13 +253,6 @@ int key_derivation_aesctr_calc_ctr(key_derivation_t* kd, seq_nr_t* r, satp_prf_l params->ctr_.params_.label_ ^= label; params->ctr_.params_.r_ ^= SEQ_NR_T_HTON(*r); -#ifndef ANYTUN_02_COMPAT - if(faked_msb) { - kd->master_salt_.buf_[0] = 0; - params->ctr_.buf_[0] = 0; - } -#endif - return 1; } |