Commit f4efe9cf authored by Yann Garcia's avatar Yann Garcia
Browse files

Add decrypt functions with uncompressed public key

parent 747ad237
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@ namespace LibItsCam__EncdecDeclarations {
  INTEGER fx__dec__CamReq(BITSTRING &b, LibItsCam__TypesAndValues::CamReq &p) {
    loggers::get_instance().log(">>> fx__dec__CamReq");

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    cam_codec                   codec;
    CAM__PDU__Descriptions::CAM cam;
    OCTETSTRING                 is = bit2oct(b);
@@ -49,6 +54,11 @@ namespace LibItsCam__EncdecDeclarations {
  INTEGER fx__dec__CamInd(BITSTRING &b, LibItsCam__TypesAndValues::CamInd &p_camInd) {
    loggers::get_instance().log(">>> fx__dec__CamInd");

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    cam_codec                   codec;
    CAM__PDU__Descriptions::CAM cam;
    OCTETSTRING                 is = bit2oct(b);
+10 −0
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@ namespace LibItsDenm__EncdecDeclarations {
  INTEGER fx__dec__DenmReq(BITSTRING &b, LibItsDenm__TypesAndValues::DenmReq &p) {
    loggers::get_instance().log(">>> fx__dec__DenmReq");

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    denm_codec                    codec;
    DENM__PDU__Descriptions::DENM denm;
    OCTETSTRING                   is = bit2oct(b);
@@ -49,6 +54,11 @@ namespace LibItsDenm__EncdecDeclarations {
  INTEGER fx__dec__DenmInd(BITSTRING &b, LibItsDenm__TypesAndValues::DenmInd &p_denmInd) {
    loggers::get_instance().log(">>> fx__dec__DenmInd");

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    denm_codec                    codec;
    DENM__PDU__Descriptions::DENM denm;
    OCTETSTRING                   is = bit2oct(b);
+11 −0
Original line number Diff line number Diff line
@@ -57,6 +57,12 @@ namespace LibItsGeoNetworking__EncdecDeclarations {

  INTEGER fx__dec__GeoNetworkingReq(BITSTRING &b, LibItsGeoNetworking__TypesAndValues::GeoNetworkingReq &p) {
    loggers::get_instance().log(">>> fx__dec__GeoNetworkingReq");

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    geonetworking_codec                                   codec;
    LibItsGeoNetworking__TypesAndValues::GeoNetworkingPdu pdu;
    OCTETSTRING                                           is = bit2oct(b);
@@ -118,6 +124,11 @@ namespace LibItsGeoNetworking__EncdecDeclarations {
  INTEGER fx__dec__GeoNetworkingInd(BITSTRING &b, LibItsGeoNetworking__TypesAndValues::GeoNetworkingInd &p_geoNetworkingInd) {
    loggers::get_instance().log(">>> fx__dec__GeoNetworkingInd");

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    float       duration;
    std::string tag("fx__dec__GeoNetworkingInd");
    loggers::get_instance().set_start_time(tag);
+5 −0
Original line number Diff line number Diff line
@@ -22,6 +22,11 @@ namespace LibItsMbr__EncdecDeclarations {
  INTEGER fx__dec__EtsiTs103759Data(BITSTRING &b, EtsiTs103759Core::EtsiTs103759Data &p_etsi_ts_103759_data) {
    loggers::get_instance().log_msg(">>> fx__dec__EtsiTs103759Data: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts103759_data_codec codec;
    OCTETSTRING              is = bit2oct(b);
    if (codec.decode(is, p_etsi_ts_103759_data) == -1) {
+65 −0
Original line number Diff line number Diff line
@@ -36,6 +36,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__EtsiTs102941Data(BITSTRING &b, EtsiTs102941MessagesCa::EtsiTs102941Data &p_etsi_ts_102941_data) {
    loggers::get_instance().log_msg(">>> fx__dec__EtsiTs102941Data: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_data_codec codec;
    OCTETSTRING              is = bit2oct(b);
    if (codec.decode(is, p_etsi_ts_102941_data) == -1) {
@@ -62,6 +67,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__EtsiTs102941DataContent(BITSTRING &b, EtsiTs102941MessagesCa::EtsiTs102941DataContent &p_etsi_ts_102941_data_content) {
    loggers::get_instance().log_msg(">>> fx__dec__EtsiTs102941DataContent: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_data_content_codec codec;
    OCTETSTRING                      is = bit2oct(b);
    if (codec.decode(is, p_etsi_ts_102941_data_content) == -1) {
@@ -88,6 +98,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__InnerEcRequest(BITSTRING &b, EtsiTs102941TypesEnrolment::InnerEcRequest &p_inner_request) {
    loggers::get_instance().log_msg(">>> fx__dec__InnerEcRequest: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_types_enrolment_inner_request codec;
    OCTETSTRING                                 is = bit2oct(b);
    if (codec.decode(is, p_inner_request) == -1) {
@@ -115,6 +130,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__InnerEcResponse(BITSTRING &b, EtsiTs102941TypesEnrolment::InnerEcResponse &p_inner_response) {
    loggers::get_instance().log_msg(">>> fx__dec__InnerEcResponse: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_types_enrolment_inner_response codec;
    OCTETSTRING                                  is = bit2oct(b);
    if (codec.decode(is, p_inner_response) == -1) {
@@ -142,6 +162,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__InnerAtRequest(BITSTRING &b, EtsiTs102941TypesAuthorization::InnerAtRequest &p_inner_request) {
    loggers::get_instance().log_msg(">>> fx__dec__InnerAtRequest: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_types_authorization_inner_request codec;
    OCTETSTRING                                     is = bit2oct(b);
    if (codec.decode(is, p_inner_request) == -1) {
@@ -169,6 +194,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__InnerAtResponse(BITSTRING &b, EtsiTs102941TypesAuthorization::InnerAtResponse &p_inner_response) {
    loggers::get_instance().log_msg(">>> fx__dec__InnerAtResponse: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_types_authorization_inner_response codec;
    OCTETSTRING                                      is = bit2oct(b);
    if (codec.decode(is, p_inner_response) == -1) {
@@ -196,6 +226,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__SharedAtRequest(BITSTRING &b, EtsiTs102941TypesAuthorization::SharedAtRequest &p_shared_at) {
    loggers::get_instance().log_msg(">>> fx__dec__SharedAtRequest: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_types_authorization_shared_at_request codec;
    OCTETSTRING                                         is = bit2oct(b);
    if (codec.decode(is, p_shared_at) == -1) {
@@ -223,6 +258,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__AuthorizationValidationRequest(BITSTRING &b, EtsiTs102941TypesAuthorizationValidation::AuthorizationValidationRequest &p_shared_at) {
    loggers::get_instance().log_msg(">>> fx__dec__AuthorizationValidationRequest: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_types_authorization_validation_request codec;
    OCTETSTRING                                          is = bit2oct(b);
    if (codec.decode(is, p_shared_at) == -1) {
@@ -250,6 +290,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__AuthorizationValidationResponse(BITSTRING &b, EtsiTs102941TypesAuthorizationValidation::AuthorizationValidationResponse &p_shared_at) {
    loggers::get_instance().log_msg(">>> fx__dec__AuthorizationValidationResponse: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_types_authorization_validation_response codec;
    OCTETSTRING                                           is = bit2oct(b);
    if (codec.decode(is, p_shared_at) == -1) {
@@ -304,6 +349,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__PublicKeys(BITSTRING &b, EtsiTs102941BaseTypes::PublicKeys &p_public_keys) {
    loggers::get_instance().log_msg(">>> fx__dec__PublicKeys: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_base_types_public_keys codec;
    OCTETSTRING                          is = bit2oct(b);
    if (codec.decode(is, p_public_keys) == -1) {
@@ -331,6 +381,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__PublicVerificationKey(BITSTRING &b, Ieee1609Dot2BaseTypes::PublicVerificationKey &p_public_verification_key) {
    loggers::get_instance().log_msg(">>> fx__dec__PublicVerificationKey: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    ieee_1609dot2_base_types_public_verification_key codec;
    OCTETSTRING                                      is = bit2oct(b);
    if (codec.decode(is, p_public_verification_key) == -1) {
@@ -358,6 +413,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__PublicEncryptionKey(BITSTRING &b, Ieee1609Dot2BaseTypes::PublicEncryptionKey &p_public_encryption_key) {
    loggers::get_instance().log_msg(">>> fx__dec__PublicEncryptionKey: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    ieee_1609dot2_base_types_public_encryption_key codec;
    OCTETSTRING                                    is = bit2oct(b);
    if (codec.decode(is, p_public_encryption_key) == -1) {
@@ -385,6 +445,11 @@ namespace LibItsPki__EncdecDeclarations {
  INTEGER fx__dec__CtlFormat(BITSTRING &b, EtsiTs102941TrustLists::CtlFormat &p_ctl_format) {
    loggers::get_instance().log_msg(">>> fx__dec__CtlFormat: ", b);

    // Sanity check
    if (b.lengthof() == 0) {
      return -1;
    }

    etsi_ts102941_trust_lists_ctl_format codec;
    OCTETSTRING                          is = bit2oct(b);
    if (codec.decode(is, p_ctl_format) == -1) {
Loading