From c4d93f6e22d71386d5a5949ba1bd447e728ea060 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 31 Mar 2023 14:55:39 +0200 Subject: [PATCH] Add UpperTester support --- ccsrc/security/src/security_externals.cc | 10 +++++----- ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn | 7 +++---- ttcn/LibSecurity/ttcn/LibSecurity_Signature.ttcn | 13 ++++++------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ccsrc/security/src/security_externals.cc b/ccsrc/security/src/security_externals.cc index e129ea7..5150be2 100644 --- a/ccsrc/security/src/security_externals.cc +++ b/ccsrc/security/src/security_externals.cc @@ -129,7 +129,7 @@ OCTETSTRING LibSecurity__Hash::fx__hash(const OCTETSTRING& p_to_be_hashed, const return hash; } -OCTETSTRING LibSecurity__Signature::fx__enc__xmldsig__signed__info(const http__www__w3__org__2000__09__xmldsig::Signature_signedInfo& s) { // FIXME Use enc/dec TITAN function external function f_enc_value(in Value x) return bitstring with { extension "prototype(convert) encode(abc)" } +BITSTRING LibSecurity__Signature::fx__enc__xmldsig__signed__info(const http__www__w3__org__2000__09__xmldsig::Signature_signedInfo& s) { // FIXME Use enc/dec TITAN function external function f_enc_value(in Value x) return bitstring with { extension "prototype(convert) encode(abc)" } loggers::get_instance().log(">>> fx__enc__xmldsig__signed__info"); TTCN_EncDec::clear_error(); @@ -147,10 +147,10 @@ OCTETSTRING LibSecurity__Signature::fx__enc__xmldsig__signed__info(const http__w OCTETSTRING os = char2oct(CHARSTRING(str.c_str())); loggers::get_instance().log_msg("fx__enc__xmldsig__signed__info: os: ", os); - return os; + return oct2bit(os); } -OCTETSTRING LibSecurity__Signature::fx__enc__xmldsig(const http__www__w3__org__2000__09__xmldsig::Signature& s) { // FIXME Use enc/dec TITAN function external function f_enc_value(in Value x) return bitstring with { extension "prototype(convert) encode(abc)" } +BITSTRING LibSecurity__Signature::fx__enc__xmldsig(const http__www__w3__org__2000__09__xmldsig::Signature& s) { // FIXME Use enc/dec TITAN function external function f_enc_value(in Value x) return bitstring with { extension "prototype(convert) encode(abc)" } loggers::get_instance().log(">>> fx__enc__xmldsig"); TTCN_EncDec::clear_error(); @@ -168,10 +168,10 @@ OCTETSTRING LibSecurity__Signature::fx__enc__xmldsig(const http__www__w3__org__2 OCTETSTRING os = char2oct(CHARSTRING(str.c_str())); loggers::get_instance().log_msg("fx__enc__xmldsig: os: ", os); - return os; + return oct2bit(os); } -INTEGER LibSecurity__Signature::fx__dec__xmldsig(const BITSTRING& bs, http__www__w3__org__2000__09__xmldsig::Signature& s) { // FIXME Use enc/dec TITAN function external function f_enc_value(in Value x) return bitstring with { extension "prototype(convert) encode(abc)" } +INTEGER LibSecurity__Signature::fx__dec__xmldsig(BITSTRING& bs, http__www__w3__org__2000__09__xmldsig::Signature& s) { // FIXME Use enc/dec TITAN function external function f_enc_value(in Value x) return bitstring with { extension "prototype(convert) encode(abc)" } loggers::get_instance().log(">>> fx__dec__xmldsig"); std::string str(static_cast(oct2char(bit2oct(bs)))); diff --git a/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn b/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn index 767bc83..9d0271c 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn @@ -22,19 +22,18 @@ module LibHttp_TestSystem { inout HttpMessage; } - type component HttpComponent extends SelfSyncComp { // FIXME To be rename into HttpTest + type component HttpComponent extends SelfSyncComp { port HttpPort httpPort; port HttpPort httpPort_notif; // timers timer tc_wait := PX_TWAIT; timer tc_ac := PX_TAC; timer tc_noac := PX_TNOAC; - } // End of component HttpComponent - type component HttpTestAdapter { // FIXME To be rename into HttpTestSystem + type component HttpTestAdapter { port HttpPort httpPort; port HttpPort httpPort_notif; - } // End of component TestAdapter + } // End of component HttpTestAdapter } // End of module LibHttp_TestSystem diff --git a/ttcn/LibSecurity/ttcn/LibSecurity_Signature.ttcn b/ttcn/LibSecurity/ttcn/LibSecurity_Signature.ttcn index bf2b5e1..1d0b524 100644 --- a/ttcn/LibSecurity/ttcn/LibSecurity_Signature.ttcn +++ b/ttcn/LibSecurity/ttcn/LibSecurity_Signature.ttcn @@ -2,15 +2,14 @@ module LibSecurity_Signature { import from http_www_w3_org_2000_09_xmldsig all; - external function fx_enc_xmldsig_signed_info(in Signature.signedInfo s) return octetstring; // Use encvalue decoration - //external function fx_enc_PullRequest_1(in PullRequest p_pull_request) return bitstring with {extension "prototype(convert) encode(XML)"} - //external function fx_dec_PullRequest_1(inout bitstring b, out PullRequest p_pull_request)return integer with {extension "prototype(sliding) decode(XML)"} + external function fx_enc_xmldsig_signed_info(in Signature.signedInfo s) return bitstring + with {extension "prototype(convert) encode(XML)"}; - external function fx_enc_xmldsig(in Signature s) return octetstring; // Use encvalue decoration - //external function fx_enc_PullRequest_1(in PullRequest p_pull_request) return bitstring with {extension "prototype(convert) encode(XML)"} - //external function fx_dec_PullRequest_1(inout bitstring b, out PullRequest p_pull_request)return integer with {extension "prototype(sliding) decode(XML)"} + external function fx_enc_xmldsig(in Signature s) return bitstring + with {extension "prototype(convert) encode(XML)"}; - external function fx_dec_xmldsig(in bitstring bs, out Signature s) return integer; + external function fx_dec_xmldsig(inout bitstring bs, out Signature s) return integer + with {extension "prototype(sliding) decode(XML)"}; /** * @desc Sign message -- GitLab