Compare Revisions

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

Ignore whitespace Rev 3329 → Rev 3330

/branches/STF525/ccsrc/Protocols/Security/certificates_loader.cc
234,13 → 234,14
}
}
std::vector<unsigned char> hashed_id(0x00, 8);
std::vector<unsigned char> hashed_id;
std::vector<unsigned char> issuer;
if (decoded_certificate.issuer().ischosen(IEEE1609dot2::IssuerIdentifier::ALT_sha256AndDigest)) {
std::vector<unsigned char> hash;
sha256 sha;
sha.generate(certificate, hash);
std::copy(hash.cend() - 8, hash.cend(), hashed_id.begin());
loggers::get_instance().log_to_hexa("certificates_loader::build_certificates_cache: Whole-certificate SHA-256 hash: ", hash.data(), hash.size());
hashed_id.insert(hashed_id.begin(), hash.cend() - 8, hash.cend());
issuer.assign(
static_cast<const unsigned char*>(decoded_certificate.issuer().sha256AndDigest()),
decoded_certificate.issuer().sha256AndDigest().lengthof() + static_cast<const unsigned char*>(decoded_certificate.issuer().sha256AndDigest())
249,7 → 250,8
std::vector<unsigned char> hash;
sha384 sha;
sha.generate(certificate, hash);
std::copy(hash.cend() - 8, hash.cend(), hashed_id.begin());
loggers::get_instance().log_to_hexa("certificates_loader::build_certificates_cache: Whole-certificate SHA-384 hash: ", hash.data(), hash.size());
hashed_id.insert(hashed_id.begin(), hash.cend() - 8, hash.cend());
issuer.assign(
static_cast<const unsigned char*>(decoded_certificate.issuer().sha384AndDigest()),
decoded_certificate.issuer().sha384AndDigest().lengthof() + static_cast<const unsigned char*>(decoded_certificate.issuer().sha384AndDigest())
554,6 → 556,8
} // End of method save_certificate
 
void certificates_loader::fill_public_key_vectors(const IEEE1609dot2BaseTypes::EccP256CurvePoint& p_ecc_point, std::vector<unsigned char>& p_public_comp_key, std::vector<unsigned char>& p_public_key_x, std::vector<unsigned char>& p_public_key_y) {
loggers::get_instance().log_msg(">>> certificates_loader::fill_public_key_vectors: ", p_ecc_point);
if (p_ecc_point.ischosen(IEEE1609dot2BaseTypes::EccP256CurvePoint::ALT_compressed__y__0)) {
p_public_comp_key.resize(33);
p_public_comp_key[0] = 0x02;
577,6 → 581,8
}
}
void certificates_loader::fill_public_key_vectors(const IEEE1609dot2BaseTypes::EccP384CurvePoint& p_ecc_point, std::vector<unsigned char>& p_public_comp_key, std::vector<unsigned char>& p_public_key_x, std::vector<unsigned char>& p_public_key_y) {
loggers::get_instance().log_msg(">>> certificates_loader::fill_public_key_vectors: ", p_ecc_point);
 
if (p_ecc_point.ischosen(IEEE1609dot2BaseTypes::EccP384CurvePoint::ALT_compressed__y__0)) {
p_public_comp_key.resize(49);
p_public_comp_key[0] = 0x02;