Commit cc00d0c1 authored by yangjian's avatar yangjian

add Op and curl-http2.0

parent 612fa15c
......@@ -125,9 +125,27 @@ void GenerateAuthDataApiImpl::generate_auth_data(
conv::hex_str_to_uint8(key_s.c_str(), key);
// print_buffer("udm_ueau", "Result For F1-Alg: key", key , 16);
opc_s = response_data.at("encOpcKey");
conv::hex_str_to_uint8(opc_s.c_str(), opc);
//opc_s = response_data.at("encOpcKey");
//conv::hex_str_to_uint8(opc_s.c_str(), opc);
// print_buffer("udm_ueau", "Result For F1-Alg: opc", opc , 16);
opc_s = response_data.at("encOpcKey");
uint8_t op_value[16] = {0};
conv::hex_str_to_uint8(opc_s.c_str(), op_value);
std::string encTopcKey = response_data.at("encTopcKey");
if(!encTopcKey.compare("Opc"))
{
memcpy(opc,op_value,16);
}
else if (!encTopcKey.compare("Op"))
{
Authentication_5gaka::ComputeOPc(key, op_value, opc);
}
else
{
Logger::udm_ueau().error("no encTopcKey");
}
amf_s = response_data.at("authenticationManagementField");
conv::hex_str_to_uint8(amf_s.c_str(), amf);
......
......@@ -86,6 +86,9 @@ long Curl::curl_http_client(std::string remoteUri, std::string Method,
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &callback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, httpData.get());
curl_easy_setopt(curl, CURLOPT_HEADERDATA, httpHeaderData.get());
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
if (!Method.compare("POST") || !Method.compare("PUT") ||
!Method.compare("PATCH")) {
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, msgBody.length());
......
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