diff options
author | Christian Pointner <equinox@anytun.org> | 2009-01-15 13:14:35 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-01-15 13:14:35 +0000 |
commit | 1c516cc0a342ae9393dae7f94393f5f7107cf1e2 (patch) | |
tree | 8228061f9affefd1d87a3501319caf338e83fc4c /src | |
parent | added key store capability (diff) |
removed useless buf variable @ some log messages
Diffstat (limited to 'src')
-rw-r--r-- | src/cipher.cpp | 6 | ||||
-rw-r--r-- | src/keyDerivation.cpp | 12 |
2 files changed, 0 insertions, 18 deletions
diff --git a/src/cipher.cpp b/src/cipher.cpp index eb958ad..c18dcdb 100644 --- a/src/cipher.cpp +++ b/src/cipher.cpp @@ -93,8 +93,6 @@ void AesIcmCipher::init(u_int16_t key_length) case 192: algo = GCRY_CIPHER_AES192; break; case 256: algo = GCRY_CIPHER_AES256; break; default: { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_CRIT) << "AesIcmCipher::AesIcmCipher: cipher key length of " << key_length << " Bits is not supported"; return; } @@ -159,8 +157,6 @@ void AesIcmCipher::calc(KeyDerivation& kd, kd_dir_t dir, u_int8_t* in, u_int32_t #ifdef USE_SSL_CRYPTO int ret = AES_set_encrypt_key(key_.getBuf(), key_.getLength()*8, &aes_key_); if(ret) { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to set cipher ssl key (code: " << ret << ")"; return; } @@ -194,8 +190,6 @@ void AesIcmCipher::calc(KeyDerivation& kd, kd_dir_t dir, u_int8_t* in, u_int32_t } #else if(CTR_LENGTH != AES_BLOCK_SIZE) { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to set cipher CTR: size don't fits"; return; } diff --git a/src/keyDerivation.cpp b/src/keyDerivation.cpp index b2c35e4..689f97a 100644 --- a/src/keyDerivation.cpp +++ b/src/keyDerivation.cpp @@ -99,15 +99,11 @@ void AesIcmKeyDerivation::init(Buffer key, Buffer salt) void AesIcmKeyDerivation::updateMasterKey() { if(master_key_.getLength()*8 != key_length_) { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_CRIT) << "KeyDerivation::updateMasterKey: key lengths don't match"; return; } if(master_salt_.getLength() != SALT_LENGTH) { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_CRIT) << "KeyDerivation::updateMasterKey: salt lengths don't match"; return; } @@ -119,8 +115,6 @@ void AesIcmKeyDerivation::updateMasterKey() case 192: algo = GCRY_CIPHER_AES192; break; case 256: algo = GCRY_CIPHER_AES256; break; default: { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_CRIT) << "KeyDerivation::updateMasterKey: cipher key length of " << key_length_ << " Bits is not supported"; return; } @@ -150,8 +144,6 @@ void AesIcmKeyDerivation::updateMasterKey() for(int i=0; i<2; i++) { int ret = AES_set_encrypt_key(master_key_.getBuf(), master_key_.getLength()*8, &aes_key_[i]); if(ret) { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_ERR) << "KeyDerivation::updateMasterKey: Failed to set ssl key (code: " << ret << ")"; return; } @@ -180,8 +172,6 @@ bool AesIcmKeyDerivation::calcCtr(kd_dir_t dir, seq_nr_t* r, satp_prf_label_t la } if(master_salt_.getLength() != SALT_LENGTH) { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_CRIT) << "KeyDerivation::calcCtr: salt lengths don't match"; return false; } @@ -242,8 +232,6 @@ bool AesIcmKeyDerivation::generate(kd_dir_t dir, satp_prf_label_t label, seq_nr_ return true; #else if(CTR_LENGTH != AES_BLOCK_SIZE) { - char buf[STERROR_TEXT_MAX]; - buf[0] = 0; cLog.msg(Log::PRIO_ERR) << "AesIcmCipher: Failed to set cipher CTR: size don't fits"; return false; } |