Skip to content

Commit 893d6bb

Browse files
committed
Changed to reporting capabilities by string vs GUID
1 parent 38109a3 commit 893d6bb

5 files changed

Lines changed: 21 additions & 8 deletions

File tree

agent.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
struct SessionInfo SessionData;
6262
struct ScheduledJob* JobList;
6363

64+
/* KF v9 Adds in text capabilities */
65+
const char* cap_pem_inventory = "CertStores.PEM.Inventory";
66+
const char* cap_pem_management = "CertStores.PEM.Management";
67+
const char* cap_pem_reenrollment = "CertStores.PEM.Reenrollment";
68+
const char* cap_fetch_logs = "Custom.FetchLogs";
69+
6470
#if defined(__OPEN_SSL__)
6571
char engine_id[21]; /* 20 Characters should be enough */
6672
#endif

agent.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ extern struct ScheduledJob* currentJob; /* Defined in schedule.c */
9999
/* 2.15.2.0 = Updated DTO for Warning to allow agent rotation */
100100
/* 2.16.0.0 = Updated TPM for default passkey */
101101
/* 2.16.0.1 = Updated Makefile for OpenSSL v3.x */
102-
#define AGENT_VERSION 0x0002001000000001
102+
/* 2.16.1.0 = Modified agent to not send GUID capabilities. Compile bug fix */
103+
#define AGENT_VERSION 0x0002001000010000
103104

104105
#endif /* AGENT_H_ */

constants.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
#define CAP_PEM_REENROLLMENT "aa015d10-cffc-41f7-a9a4-c9615f6f3bdf"
2020
#define CAP_FETCH_LOGS "0D8CF0C8-56CA-4B8A-B16A-C062018E170D"
2121

22+
/* KF v9 adds in text Capabilities - they are defined in agent.c */
23+
extern const char* cap_pem_inventory;
24+
extern const char* cap_pem_management;
25+
extern const char* cap_pem_reenrollment;
26+
extern const char* cap_fetch_logs;
27+
2228
/* The following capabilities are not implemented in the C-Agent */
2329
#define CAP_AWS_INVENTORY "afb8c78d-1436-4c93-a8e7-0218c2cb6955"
2430
#define CAP_AWS_MANAGEMENT "56c1e4f9-366c-44b3-8cae-1b8f39e2026c"

httpclient.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int handle_curl_error(CURL *curl, int errNum) {
7171
/* When tracing, dump the error buffer to stderr */
7272
if ( is_log_trace() ) {
7373
size_t len = strlen( errBuff );
74-
log_error( "%s::%s-libcurl: (%d) ", LOG_INF, errNum );
74+
log_error( "%s::%s(%d) -libcurl: (%d) ", LOG_INF, errNum );
7575
if ( len ) {
7676
log_error( "%s::%s(%d) : %s%s", LOG_INF, errBuff,
7777
((errBuff[len-1] != '\n') ? "\n" : ""));
@@ -432,8 +432,8 @@ int http_post_json(const char* url, const char* username,
432432
if ((add_client_cert_to_header) && (NULL != client_cert_compressed)) {
433433
log_debug("%s::%s(%d) : Adding client certificate to %s header", LOG_INF, CLIENT_CERT_HEADER);
434434
char certBuf[MAX_CERT_SIZE];
435-
stripCR(client_cert_compressed);
436-
(void)snprintf(certBuf, MAX_CERT_SIZE, "%s: %s",CLIENT_CERT_HEADER, client_cert_compressed);
435+
stripCR((char*)client_cert_compressed);
436+
(void)snprintf(certBuf, MAX_CERT_SIZE, "%s: %s",CLIENT_CERT_HEADER, (char*)client_cert_compressed);
437437
list = curl_slist_append(list, certBuf);
438438
} else {
439439
log_debug("%s::%s(%d) : Skipping adding header = %s", LOG_INF, CLIENT_CERT_HEADER);

session.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ static bool register_add_capabilities(struct SessionRegisterReq* sessionReq)
272272
sessionReq->Capabilities_count = 4;
273273
sessionReq->Capabilities = calloc(sessionReq->Capabilities_count, sizeof(char*));
274274
if ( sessionReq->Capabilities ) {
275-
sessionReq->Capabilities[0] = strdup(CAP_PEM_INVENTORY);
276-
sessionReq->Capabilities[1] = strdup(CAP_PEM_MANAGEMENT);
277-
sessionReq->Capabilities[2] = strdup(CAP_PEM_REENROLLMENT);
278-
sessionReq->Capabilities[3] = strdup(CAP_FETCH_LOGS);
275+
sessionReq->Capabilities[0] = strdup(cap_pem_inventory);
276+
sessionReq->Capabilities[1] = strdup(cap_pem_management);
277+
sessionReq->Capabilities[2] = strdup(cap_pem_reenrollment);
278+
sessionReq->Capabilities[3] = strdup(cap_fetch_logs);
279279
bResult = true;
280280
} else {
281281
log_error("%s::%s(%d) : Out of memory", LOG_INF);

0 commit comments

Comments
 (0)