Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 3343 → Rev 3344

/branches/STF525/ccsrc/Protocols/Security/security_ecc.cc
394,7 → 394,7
// Derive the shared secret key
const int k_enc = nonce_length + sym_key_length + tag_length;
const int k_mac = k_length + k_length;
OCTETSTRING digest(k_enc + k_mac, 0x00);
OCTETSTRING digest = int2oct(0, k_enc + k_mac);
loggers::get_instance().log("security_ecc::generate_and_derive_ephemeral_key (1): k_enc size:%d - k_mac size: %d - digest size:%d: ", k_enc, k_mac, digest.lengthof());
if (PKCS5_PBKDF2_HMAC((const char*)static_cast<const unsigned char*>(_secret_key), _secret_key.lengthof(), nullptr, 0, 2000, EVP_sha256(), digest.lengthof(), (unsigned char*)static_cast<const unsigned char*>(digest)) != 1) {
loggers::get_instance().warning("security_ecc::generate_and_derive_ephemeral_key: Failed to derive shared secret key");
484,7 → 484,7
// Derive the shared secret key
const int k_enc = nonce_length + sym_key_length + tag_length;
const int k_mac = k_length + k_length;
OCTETSTRING digest(k_enc + k_mac, 0x00);
OCTETSTRING digest = int2oct(0, k_enc + k_mac);
loggers::get_instance().log("security_ecc::generate_and_derive_ephemeral_key (2): k_enc size:%d - k_mac size: %d - digest size:%d: ", k_enc, k_mac, digest.lengthof());
if (PKCS5_PBKDF2_HMAC((const char*)static_cast<const unsigned char*>(_secret_key), _secret_key.lengthof(), nullptr, 0, 2000, EVP_sha256(), digest.lengthof(), (unsigned char*)static_cast<const unsigned char*>(digest)) != 1) {
loggers::get_instance().warning("security_ecc::generate_and_derive_ephemeral_key: Failed to derive shared secret key");