summaryrefslogtreecommitdiffstats
path: root/aclk/aclk_otp.c
diff options
context:
space:
mode:
Diffstat (limited to 'aclk/aclk_otp.c')
-rw-r--r--aclk/aclk_otp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/aclk/aclk_otp.c b/aclk/aclk_otp.c
index 411a5f891..658e04f9b 100644
--- a/aclk/aclk_otp.c
+++ b/aclk/aclk_otp.c
@@ -2,16 +2,12 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "aclk_otp.h"
+#include "aclk_util.h"
+#include "aclk.h"
-#include "../daemon/common.h"
+#include "daemon/common.h"
-#include "../mqtt_websockets/c-rbuf/include/ringbuffer.h"
-
-// CentOS 7 has older version that doesn't define this
-// same goes for MacOS
-#ifndef UUID_STR_LEN
-#define UUID_STR_LEN 37
-#endif
+#include "mqtt_websockets/c-rbuf/include/ringbuffer.h"
struct dictionary_singleton {
char *key;
@@ -213,7 +209,7 @@ static int parse_passwd_response(const char *json_str, struct auth_data *auth) {
json = json_tokener_parse(json_str);
if (!json) {
- error("JSON-C failed to parse the payload of http respons of /env endpoint");
+ error("JSON-C failed to parse the payload of http response of /env endpoint");
return 1;
}
@@ -363,7 +359,7 @@ static int aclk_parse_otp_error(const char *json_str) {
json = json_tokener_parse(json_str);
if (!json) {
- error("JSON-C failed to parse the payload of http respons of /env endpoint");
+ error("JSON-C failed to parse the payload of http response of /env endpoint");
return 1;
}
@@ -734,7 +730,7 @@ static int parse_json_env(const char *json_str, aclk_env_t *env) {
json = json_tokener_parse(json_str);
if (!json) {
- error("JSON-C failed to parse the payload of http respons of /env endpoint");
+ error("JSON-C failed to parse the payload of http response of /env endpoint");
return 1;
}
@@ -846,7 +842,11 @@ int aclk_get_env(aclk_env_t *env, const char* aclk_hostname, int aclk_port) {
return 1;
}
- buffer_sprintf(buf, "/api/v1/env?v=%s&cap=json$claim_id=%s", &(VERSION[1]) /* skip 'v' at beginning */, agent_id);
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
+ buffer_sprintf(buf, "/api/v1/env?v=%s&cap=json,proto&claim_id=%s", &(VERSION[1]) /* skip 'v' at beginning */, agent_id);
+#else
+ buffer_sprintf(buf, "/api/v1/env?v=%s&cap=json&claim_id=%s", &(VERSION[1]) /* skip 'v' at beginning */, agent_id);
+#endif
freez(agent_id);
req.host = (char*)aclk_hostname;