Skip to content

Commit

Permalink
security: Added and enhanced enums of DecapReport and VerificationReport
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonhard Bosch committed Jun 9, 2024
1 parent 342e002 commit 14a0510
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
3 changes: 2 additions & 1 deletion vanetza/geonet/router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,14 @@ void Router::indicate_secured(IndicationContextBasic& ctx, const BasicHeader& ba
case DecapReport::False_Signature:
case DecapReport::Invalid_Certificate:
case DecapReport::Revoked_Certificate:
case DecapReport::Inconsistant_Chain:
case DecapReport::Inconsistent_Chain:
case DecapReport::Invalid_Timestamp:
case DecapReport::Invalid_Mobility_Data:
case DecapReport::Unsigned_Message:
case DecapReport::Signer_Certificate_Not_Found:
case DecapReport::Unsupported_Signer_Identifier_Type:
case DecapReport::Unencrypted_Message:
case DecapReport::None:
// ok, continue
boost::apply_visitor(visitor, decap_confirm.plaintext_payload);
break;
Expand Down
31 changes: 16 additions & 15 deletions vanetza/security/decap_confirm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,25 @@ namespace security

/**
* SN-DECAP.confirm report codes
* \see TS 102 723-8 v1.1.1 table 27
* \see TS 102 723-8 v1.1.1 table 27 or AUTOSAR SWS_V2xM_91000
*/
enum class DecapReport
{
Success,
False_Signature,
Invalid_Certificate,
Revoked_Certificate,
Inconsistant_Chain,
Invalid_Timestamp,
Duplicate_Message,
Invalid_Mobility_Data,
Unsigned_Message,
Signer_Certificate_Not_Found,
Unsupported_Signer_Identifier_Type,
Incompatible_Protocol,
Unencrypted_Message,
Decryption_Error,
Success = 0x00,
False_Signature = 0x01,
Invalid_Certificate = 0x02,
Revoked_Certificate = 0x03,
Inconsistent_Chain = 0x04,
Invalid_Timestamp = 0x05,
Duplicate_Message = 0x06,
Invalid_Mobility_Data = 0x07,
Unsigned_Message = 0x08,
Signer_Certificate_Not_Found = 0x09,
Unsupported_Signer_Identifier_Type = 0x0a,
Incompatible_Protocol = 0x0b,
Unencrypted_Message = 0x0c,
Decryption_Error = 0x0d,
None = 0xff,
};

/** \brief contains output of the verify process
Expand Down
2 changes: 1 addition & 1 deletion vanetza/security/straight_verify_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ VerifyConfirm StraightVerifyService::verify(const v3::SecuredMessage& msg)
try {
encoded_signing_payload = msg.signing_payload();
} catch (...) {
confirm.report = VerificationReport::False_Signature;
confirm.report = VerificationReport::Decryption_Error;
return confirm;
}

Expand Down
29 changes: 16 additions & 13 deletions vanetza/security/verify_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ namespace security

enum class VerificationReport
{
Success,
False_Signature,
Invalid_Certificate,
Revoked_Certificate,
Inconsistent_Chain,
Invalid_Timestamp,
Duplicate_Message,
Invalid_Mobility_Data,
Unsigned_Message,
Signer_Certificate_Not_Found,
Unsupported_Signer_Identifier_Type,
Incompatible_Protocol,
Configuration_Problem,
Success = 0x00,
False_Signature = 0x01,
Invalid_Certificate = 0x02,
Revoked_Certificate = 0x03,
Inconsistent_Chain = 0x04,
Invalid_Timestamp = 0x05,
Duplicate_Message = 0x06,
Invalid_Mobility_Data = 0x07,
Unsigned_Message = 0x08,
Signer_Certificate_Not_Found = 0x09,
Unsupported_Signer_Identifier_Type = 0x0a,
Incompatible_Protocol = 0x0b,
Unencrypted_Message = 0x0c,
Decryption_Error = 0x0d,
Configuration_Problem = 0x0e,
None = 0xff,
};

// mandatory parameters of SN-VERIFY.request (TS 102 723-8 V1.1.1)
Expand Down

0 comments on commit 14a0510

Please sign in to comment.