summaryrefslogtreecommitdiff
path: root/keyDerivation.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-04 20:34:37 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-04 20:34:37 +0000
commitc01ff56f61b28d0a909f46b95182b5a26aaa6cd3 (patch)
tree0192e862cc9e71d260d64daf1f6fd2e4a379e80f /keyDerivation.h
parentsorry for not working checkin ;) (diff)
fixed bug @ sync
key gets updatet @ sync
Diffstat (limited to 'keyDerivation.h')
-rw-r--r--keyDerivation.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/keyDerivation.h b/keyDerivation.h
index 214a1a4..e313795 100644
--- a/keyDerivation.h
+++ b/keyDerivation.h
@@ -52,15 +52,15 @@ class KeyDerivation
{
public:
KeyDerivation() : ld_kdr_(-1), salt_(0), cipher_(NULL) {};
- virtual ~KeyDerivation() {};
+ virtual ~KeyDerivation();
void init(Buffer key, Buffer salt);
void setLogKDRate(const u_int8_t ld_rate);
void generate(satp_prf_label label, seq_nr_t seq_nr, Buffer& key, u_int32_t length);
- void clear();
- u_int32_t bufferGetLength() const;
private:
+ void updateKey();
+
KeyDerivation(const KeyDerivation & src);
friend class boost::serialization::access;
template<class Archive>
@@ -69,13 +69,14 @@ private:
Lock lock(mutex_);
ar & ld_kdr_;
ar & salt_;
+ ar & key_;
+ updateKey();
}
protected:
int8_t ld_kdr_; // ld(key_derivation_rate)
SyncBuffer salt_;
- static const char* MIN_GCRYPT_VERSION;
- static const u_int32_t GCRYPT_SEC_MEM = 32768; // 32k secure memory
+ SyncBuffer key_;
gcry_cipher_hd_t cipher_;
Mutex mutex_;