Commit 56338331 authored by YannGarcia's avatar YannGarcia
Browse files

Fix Issue: Errors because of removing trailing 0A and 0D bytes from HTTP responses

parent 5ee2557f
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ int http_codec::encode_response (const LibItsHttp__TypesAndValues::Response& p_r
  if (_ec.is_content_length_present == 0x01) {
    loggers::get_instance().log_msg("http_codec::encode_request: Add body ", os);
    p_encoding_buffer.put_os(os);
    p_encoding_buffer.put_cs("\r\n");
    //    p_encoding_buffer.put_cs("\r\n");
  }
  
  loggers::get_instance().log_to_hexa("<<< http_codec::encode_response: ", p_encoding_buffer);
@@ -504,6 +504,8 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
    body = s;
  }
  loggers::get_instance().log_msg("http_codec::decode_body: Aligned body=", body);
  loggers::get_instance().log("http_codec::decode_body: body length=%d", body.lengthof());
  /* TODO To be removed
  // Remove CRLF if any
  int counter = 0;
  if ((body[body.lengthof() - 1].get_octet() == 0x0d) || (body[body.lengthof() - 1].get_octet() == 0x0a)) {
@@ -513,10 +515,10 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
    }
  }
  loggers::get_instance().log("http_codec::decode_body: counter=%d", counter);
  loggers::get_instance().log("http_codec::decode_body: body length=%d", body.lengthof());
  body = OCTETSTRING(body.lengthof() - counter, static_cast<const unsigned char*>(body));
  */
  if (_dc.chunked){
    counter = 0;
    int counter = 0;
    int prev = 0;
    OCTETSTRING os(0, nullptr);
    do {
@@ -554,8 +556,8 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
      }
    } while (counter < body.lengthof()); // Process next chunk if any
    body = os;
  }
    loggers::get_instance().log_msg("http_codec::decode_body: Finalised body=", body);
  }
  // Check if HTTP message body contains binary characters
  for (int i = 0; i < body.lengthof(); i++) {
    unsigned char c = body[i].get_octet();
+3 −3
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ LibItsPki_Pics.PICS_HTTP_POST_URI_AT := "/"
LibItsPki_Pics.PICS_HTTP_POST_URI_ATV                := "/"
LibItsPki_Pics.PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY  := '5C25F97607DFC62972A147FAD8B7A7C939569F0F95ECD4C641724A68B51836E5'O
LibItsPki_Pics.PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY   := '020144E5174B0AFDA86BDB8B643B68D40030F5BDB9A9F090C64852CC3C20C9D5AD'O
LibItsPki_Pics.PICS_ITS_S_CANONICAL_ID               := '455453492d4954532d303031'O
LibItsPki_Pics.PICS_ITS_S_CANONICAL_ID               := '455453492D4954532D303031'O
LibItsPki_Pics.PICS_TS_EA_CERTIFICATE_ID             := "CERT_IDNOMIC_EA"
LibItsPki_Pics.PICS_TS_AA_CERTIFICATE_ID             := "CERT_IDNOMIC_AA"

@@ -54,7 +54,7 @@ system.httpAtPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/

[EXECUTE]
# The EnrolmentResponse message shall be sent by the EA to the ITS-S across the interface at reference point S3 in response to a received EnrolmentRequest message
#ItsPki_TestCases.TC_SECPKI_EA_ENR_RCV_01_BV
ItsPki_TestCases.TC_SECPKI_EA_ENR_RCV_01_BV
# Check that EA doesn't accept Enrolment rekeying request when enrolment is not permitted by signing certificate
#ItsPki_TestCases.TC_SECPKI_EA_ENR_RCV_02_BI

@@ -77,7 +77,7 @@ system.httpAtPort.params := "HTTP(codecs=http_its:http_etsi_ieee1609dot2_codec)/
#ItsPki_TestCases.TC_SECPKI_EA_AUTHVAL_RCV_01_BV

#
ItsPki_TestCases.TC_SECPKI_AA_AUTH_RCV_01_BV
#ItsPki_TestCases.TC_SECPKI_AA_AUTH_RCV_01_BV
#ItsPki_TestCases.TC_SECPKI_AA_AUTH_RCV_03_BI
#ItsPki_TestCases.TC_SECPKI_AA_AUTH_RCV_04_BI
#ItsPki_TestCases.TC_SECPKI_AA_AUTH_RCV_05_BI
Compare 13eeec47 to 767200b2
Original line number Diff line number Diff line
Subproject commit 13eeec47fc27bf506420a9c8f4260b1dd237463f
Subproject commit 767200b2a309e674bfa3c843d39634b3c5b0814d