Compare Revisions

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

Ignore whitespace Rev 3103 → Rev 3104

/branches/STF525/ccsrc/Protocols/Security/security_services.hh
38,7 → 38,8
*/
static security_services* instance;
bool _setup_done;
std::unique_ptr<ec_keys> _ec_keys;
std::unique_ptr<ec_keys> _ec_keys_enc;
std::unique_ptr<ec_keys> _ec_keys_dec;
std::unique_ptr<security_cache> _security_cache;
std::unique_ptr<security_db> _security_db;
unsigned long long _last_generation_time;
55,7 → 56,7
* \brief Default private dtor
*/
~security_services() {
_ec_keys.reset(nullptr);
_ec_keys_enc.reset(nullptr);
_security_db.reset(nullptr);
_security_cache.reset(nullptr);
if (instance != NULL) {
74,14 → 75,25
};
 
/*!
* \brief Decrypt (if required), verify and extract the unsecured payload from the provided secured payload
* \fn int verify_and_extract_gn_payload(const OCTETSTRING& p_secured_gn_payload, const bool p_verify, OCTETSTRING& p_unsecured_gn_payload, Params& p_params);
* \brief Verify and extract the unsecured payload from the provided secured payload.
* The secured payload could signed only, encryted only or signed and encrypted
* \param[in] p_secured_gn_payload The secured payload to be processed
* \param[in] p_verify Set to true if security checks shall be applied
* \param[in] p_unsecured_gn_payload The extracted payload
* \param[in] p_params The Test System parameters
* \return 0 on success, negative value otherwise
*/
int verify_and_extract_gn_payload(const OCTETSTRING& p_secured_gn_payload, const bool p_verify, OCTETSTRING& p_unsecured_gn_payload, Params& p_params);
/*!
* \fn int secure_gn_payload(const OCTETSTRING& p_unsecured_gn_payload, OCTETSTRING& p_secured_gn_payload, Params& p_params);
* \brief Apply security to the provided unsecured payload
* \param[in] p_unsecured_gn_payload The unsecured payload to be processed
* \param[in] p_secured_gn_payload The secured payload
* \param[in] p_params The Test System parameters
* \return 0 on success, negative value otherwise
*/
int secure_gn_payload(const OCTETSTRING& p_unsecured_gn_payload, OCTETSTRING& p_secured_gn_payload, Params& p_params);
int setup(Params &p_params);
97,7 → 109,26
private:
/*!
* \brief Decrypt (if required), verify and extract the unsecured payload from the IEEE1609dot2::Ieee1609Dot2Content data structure
* \fn int sign_gn_payload(const OCTETSTRING& p_unsecured_gn_payload, OCTETSTRING& p_signed_gn_payload, Params& p_params);
* \brief Sign the payload according provided parameters
* \param[in] p_unsecured_gn_payload The payload to be signed
* \param[in] p_signed_gn_payload The signed payload
* \param[in] p_params The Test System parameters
* \return 0 on success, negative value otherwise
*/
int sign_gn_payload(const OCTETSTRING& p_unsecured_gn_payload, OCTETSTRING& p_signed_gn_payload, Params& p_params);
/*!
* \fn int encrypt_gn_payload(const OCTETSTRING& p_unsecured_gn_payload, OCTETSTRING& p_signed_gn_payload, Params& p_params);
* \brief Encrypt the payload according provided parameters
* \param[in] p_unsecured_gn_payload The payload to be encrypted
* \param[in] p_enc_gn_payload The encrypted payload
* \param[in] p_params The Test System parameters
* \return 0 on success, negative value otherwise
*/
int encrypt_gn_payload(const OCTETSTRING& p_unsecured_gn_payload, OCTETSTRING& p_enc_gn_payload, Params& p_params);
/*!
* \fn int process_ieee_1609_dot2_content(const IEEE1609dot2::Ieee1609Dot2Content& p_ieee_1609_dot2_content, const bool p_verify, OCTETSTRING& p_unsecured_payload, Params& p_params);
* \brief Verify and extract the unsecured payload from the IEEE1609dot2::Ieee1609Dot2Content data structure
* \param[in] p_content The secured content to be processed
* \param[in] p_verify Set to true if security checks shall be applied
* \param[in] p_unsecured_payload The extracted payload