-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathagent.h
More file actions
117 lines (108 loc) · 6.84 KB
/
agent.h
File metadata and controls
117 lines (108 loc) · 6.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/******************************************************************************/
/* Copyright 2021 Keyfactor */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain a */
/* copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless */
/* required by applicable law or agreed to in writing, software distributed */
/* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES */
/* OR CONDITIONS OF ANY KIND, either express or implied. See the License for */
/* thespecific language governing permissions and limitations under the */
/* License. */
/******************************************************************************/
#ifndef AGENT_H_
#define AGENT_H_
#include "session.h"
#include "schedule.h"
#include "config.h"
int run_job(struct SessionJob* job);
int init_platform( int argc, char* argv[] );
bool release_platform( void );
#ifdef __MAKE_LIBRARY__
int KF_main( int argc, char* argv[]);
#endif
/******************************************************************************/
/************************* SYSTEM GLOBAL VARIABLES ****************************/
/******************************************************************************/
extern struct SessionInfo SessionData;
extern struct ScheduledJob* JobList;
extern struct ConfigData* ConfigData;
extern struct ScheduledJob* currentJob; /* Defined in schedule.c */
#if defined(__OPEN_SSL__)
extern char engine_id[21];
#endif
#if defined(__TPM__)
#include <tpm2-tss-engine.h>
extern ENGINE* e;
#endif
/* Versioning Information */
/* 2.0.0.0 = Created wrapper class */
/* 2.1.0.0 = Added TPM for raspberry pi into version */
/* 2.5.0.0 = Added the following functionality: */
/* * Log to file upon agent shutting down */
/* * Agent runs through all jobs once, */
/* this allows cron to schedule it */
/* * Added warning log level */
/* * Added a priority queue for agent jobs upon initial retrieval */
/* * Ignore any chained jobs - inventory jobs will always */
/* run immediate */
/* * Check if a store is a directory before reading/writing */
/* * Check if re-enrollment, inventory, or management jobs */
/* are targeting the agent certificate & don't run those jobs. */
/* * Added agent cert re-enrollment on Error response to reenroll */
/* 2.5.1.0 = Added the following: */
/* * Fixed a bug in openSSL cleanup causing segfaults */
/* * Added a check to the inventory and management jobs to */
/* validate cert store exists */
/* * Added sanity checks on the initial configuration file */
/* * Set default logging level to INFO */
/* 2.5.2.0 = Fixed bugs in openSSL layer when performing management jobs */
/* 2.6.0.0 = Modified Agent to work with Keyfactor Platform v8.5.2 */
/* Includes fixes to wrapper layers for managing keypairs */
/* 2.6.1.0 = Added -c switch to allow config file to be passed as a parameter */
/* 2.7.0.0 = Added -h switch to use hostname_datetime for agent name */
/* Added second registration hit for use with RegistrationHandler */
/* 2.7.1.0 = Fixed bug with agent cert expiry */
/* 2.7.2.0 = Fixed bug with HResult being returned instead of CodeString */
/* 2.8.0.0 = Added the following: */
/* * Updated licensing information */
/* * Added Bootstrap certificate support via config file */
/* 2.8.1.0 = Fixed logging to file bug */
/* 2.8.2.0 = Fixed some memory leaks */
/* 2.8.3.0 = Fixed more memory leak posibilities */
/* 2.8.4.0 = Fixed re-registration issue where AgentId was not updated */
/* 2.8.5.0 = Changed logging functionality */
/* 2.8.6.0 = Minor bug fixes */
/* 2.8.7.0 = Fixed Agent cert renewal issue for A0100007 and A0100008 codes */
/* 2.8.8.0 = Agent now re-registers as new agent if its own certificate */
/* has expired */
/* 2.9.0.0 = Added custom client parameters stub to sessions. These params */
/* get added to every hit of /Session/Register */
/* 2.9.1.0 = Fixed issue where CSRs max length was too small for RSA/4096 */
/* 2.9.2.0 = Fixed but in getting date time for agent's name */
/* 2.10.0.0 = Fixed issue with openSSL management remove job */
/* 2.11.0.0 = Allow agent to be made into a library */
/* 2.12.0.0 = Update bootstrap certificate use case */
/* 2.14.0.0 = Add command line switch to send X-ARR-ClientCert header to KF */
/* 2.14.1.0 = Updated logging associated with v2.14.0.0 */
/* 2.14.2.0 = Updated parameter processing & usage printing */
/* 2.14.2.1 = Set up long options & cleaned usage output */
/* 2.14.3.0 = Upgraded for EJBCA DN State Key & openssl v3.0 compatibility */
/* 2.15.0.0 = Minor bug improvements */
/* 2.15.1.0 = Updated for v12 API modifications */
/* 2.15.2.0 = Updated DTO for Warning to allow agent rotation */
/* 2.16.0.0 = Updated TPM for default passkey */
/* 2.16.0.1 = Updated Makefile for OpenSSL v3.x */
/* 2.16.1.0 = Modified agent to not send GUID capabilities. Compile bug fix */
/* 2.17.0.0 = Modified agent to accept ECDSA as well as ECC for a keytype */
/* 2.18.0.0 = Modified agent to skip using agent certificate & openssl fix */
/* 2.19.0.0 = Modified agent to fix bug with writing agent certificate to file*/
#define AGENT_MAJOR 2ULL
#define AGENT_MINOR 19ULL
#define AGENT_MICRO 0ULL
#define AGENT_BUILD 0ULL
#define AGENT_VERSION \
((AGENT_MAJOR << 48) | \
(AGENT_MINOR << 32) | \
(AGENT_MICRO << 16) | \
(AGENT_BUILD))
#endif /* AGENT_H_ */