Commit 3ba8e0e2 authored by Yann Garcia's avatar Yann Garcia

Unify security external function names

parent 44d1384d
This diff is collapsed.
......@@ -79,7 +79,7 @@ int http_codec::decode (const OCTETSTRING& data, LibItsHttp__TypesAndValues::Htt
response.version__minor() = std::stoi(m[2].str().c_str());
response.statuscode() = std::stoi(m[3].str().c_str());
response.statustext() = CHARSTRING(m[4].str().c_str());
LibItsHttp__TypesAndValues::HeaderLines headers;
LibItsHttp__TypesAndValues::Headers headers;
std::string content_type;
decode_headers(decoding_buffer, headers, content_type);
response.header() = headers;
......@@ -104,7 +104,7 @@ int http_codec::decode (const OCTETSTRING& data, LibItsHttp__TypesAndValues::Htt
request.uri() = CHARSTRING(m[2].str().c_str());
request.version__major() = std::stoi(m[3].str().c_str());
request.version__minor() = std::stoi(m[4].str().c_str());
LibItsHttp__TypesAndValues::HeaderLines headers;
LibItsHttp__TypesAndValues::Headers headers;
std::string content_type;
decode_headers(decoding_buffer, headers, content_type);
request.header() = headers;
......@@ -141,10 +141,10 @@ int http_codec::encode_request(const LibItsHttp__TypesAndValues::Request& p_requ
p_encoding_buffer.put_cs("\r\n");
// Encode headers excepeted the Content-Length
const LibItsHttp__TypesAndValues::HeaderLines& headers = p_request.header();
const LibItsHttp__TypesAndValues::Headers& headers = p_request.header();
std::string content_type;
for (int i = 0; i < headers.size_of(); i++) {
const LibItsHttp__TypesAndValues::HeaderLine& header = headers[i];
const LibItsHttp__TypesAndValues::Header& header = headers[i];
loggers::get_instance().log_msg("http_codec::encode_request: Processing header ", header.header__name());
if (std::string(static_cast<const char*>(header.header__name())).compare("Content-Length") == 0) { // Skip it, processed later
loggers::get_instance().log("http_codec::encode_request: Skip it");
......@@ -240,10 +240,10 @@ int http_codec::encode_response (const LibItsHttp__TypesAndValues::Response& p_r
p_encoding_buffer.put_cs("\r\n");
// Encode headers excepeted the Content-Length
const LibItsHttp__TypesAndValues::HeaderLines& headers = p_response.header();
const LibItsHttp__TypesAndValues::Headers& headers = p_response.header();
std::string content_type;
for (int i = 0; i < headers.size_of(); i++) {
const LibItsHttp__TypesAndValues::HeaderLine& header = headers[i];
const LibItsHttp__TypesAndValues::Header& header = headers[i];
loggers::get_instance().log_msg("http_codec::encode_response: Processing header ", header.header__name());
p_encoding_buffer.put_cs(header.header__name());
p_encoding_buffer.put_cs(": ");
......@@ -321,7 +321,7 @@ int http_codec::encode_response (const LibItsHttp__TypesAndValues::Response& p_r
return 0;
}
int http_codec::decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAndValues::HeaderLines& headers, std::string& p_content_type) {
int http_codec::decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAndValues::Headers& headers, std::string& p_content_type) {
loggers::get_instance().log(">>> http_codec::decode_headers");
loggers::get_instance().log_to_hexa("http_codec::decode_headers", decoding_buffer);
......@@ -331,7 +331,7 @@ int http_codec::decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAn
switch(get_line(decoding_buffer, cstr, true)) {
case 0: {
loggers::get_instance().log_msg("http_codec::decode_headers: ", cstr);
LibItsHttp__TypesAndValues::HeaderLine header;
LibItsHttp__TypesAndValues::Header header;
if (decode_header(cstr, header) == -1) {
loggers::get_instance().warning("http_codec::decode_headers: Failed to decode header %s", static_cast<const char*>(cstr));
return -1;
......@@ -357,7 +357,7 @@ int http_codec::decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAn
} // End of 'while' statement
}
int http_codec::decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValues::HeaderLine& header) {
int http_codec::decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValues::Header& header) {
loggers::get_instance().log_msg(">>> http_codec::decode_header", header_line);
try {
......
......@@ -14,8 +14,8 @@ namespace LibItsHttp__TypesAndValues {
class HttpMessage;
class Request;
class Response;
class HeaderLines;
class HeaderLine;
class Headers;
class Header;
}
namespace LibItsHttp__MessageBodyTypes {
class HttpMessageBody;
......@@ -59,8 +59,8 @@ private:
int encode_response (const LibItsHttp__TypesAndValues::Response& p_response, TTCN_Buffer& p_encoding_buffer);
int encode_body(const LibItsHttp__MessageBodyTypes::HttpMessageBody& p_message_body, OCTETSTRING& p_encoding_buffer, const std::string& p_content_type);
int decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAndValues::HeaderLines& headers, std::string& p_content_type);
int decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValues::HeaderLine& header);
int decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAndValues::Headers& headers, std::string& p_content_type);
int decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValues::Header& header);
int decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBodyTypes::HttpMessageBody& message_body, const std::string& p_content_type);
int get_line(TTCN_Buffer& buffer, CHARSTRING& to, const bool concatenate_header_lines = false);
......
......@@ -830,11 +830,11 @@ int security_services::sign_tbs_data(const IEEE1609dot2::ToBeSignedData& p_tbs_d
if (p_params[params::signature].compare("NISTP-256") == 0) {
result = sign_ecdsa_nistp256(hashed_data, p_signature, p_params);
} else if (p_params[params::signature].compare("BP-256") == 0) {
//result = sign_ecdsa_brainpoolp256(hashed_data, p_signature, p_params);
//result = sign_ecdsa_brainpoolp256r1(hashed_data, p_signature, p_params);
loggers::get_instance().error("security_services::sign_tbs_data: TODO");
result = -1;
} else if (p_params[params::signature].compare("BP-384") == 0) {
//result = sign_ecdsa_brainpoolp256(hashed_data, p_signature, p_params);
//result = sign_ecdsa_brainpoolp384r1(hashed_data, p_signature, p_params);
loggers::get_instance().error("security_services::sign_tbs_data: TODO");
result = -1;
} else {
......
......@@ -240,8 +240,8 @@ do
elif [ "$i" == "Pki" ]
then
cp ${CC_SRC_PATH}/EncDec/LibItsPki_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/EncDec/LibItsSecurity_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Externals/LibItsSecurity_externals.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
# cp ${CC_SRC_PATH}/EncDec/LibItsSecurity_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
# cp ${CC_SRC_PATH}/Externals/LibItsSecurity_externals.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/Pki_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/Pki_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/Pki_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
......
Subproject commit 87d844cc4272334377ad31bb5befa9d0ed23792f
Subproject commit 4b09f4e418e6e62ce9be0a9a44a5c1c9805585d9
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment