支持CERTEX HSM接口调用

读取配置表PXY_PROFILE_HSM
重构配置读取代码
This commit is contained in:
fengweihao
2020-11-12 15:56:34 +08:00
parent 9962458ad6
commit d452d7b5f2
15 changed files with 4201 additions and 388 deletions

View File

@@ -18,6 +18,8 @@
#include <MESA/Maat_rule.h>
#include <MESA/MESA_htable.h>
#include "rlib_load.h"
#define CT_PATH_MAX 256
#define CT_ARRARY_LEN (CT_PATH_MAX/2)
#define CT_STRING_MAX 1024
@@ -38,57 +40,58 @@ struct tfe_http_request{
struct pxy_obj_keyring{
int keyring_id;
int use_hsm;
int slot_id;
atomic64_t ref_cnt;
uint64_t expire_time;
time_t op_time;
EVP_PKEY *key;
X509 *issuer;
char v3_ctl[CT_STRING_MAX];
char keyring_type[CT_ARRARY_LEN];
char public_algo[CT_STRING_MAX];
char v3_ctl[CT_STRING_MAX];
int is_send;
int is_valid;
time_t op_time;
atomic64_t ref_cnt;
CK_SESSION_HANDLE session;
STACK_OF(X509) *stack_ca;
};
struct _initer_addr_t{
uint16_t e_port; /*libevent prot*/
uint16_t maat_port; /*maat redis port*/
char maat_ip[16]; /*maat redis ip */
int dbindex; /*maat redis dbindex*/
uint16_t store_port; /*store redis port */
char store_ip[16]; /*store redis ip*/
uint16_t statsd_port;
char statsd_server[16];
struct pxy_profile_hsm
{
int profile_id;
int ref_cnt;
char *server_ip;
char *passwd;
pthread_mutex_t lock;
};
struct ntc_maat_t{
unsigned int maat_json_switch;
unsigned int effective_interval_s;
char info_path[128];
char pxy_path[128];
char inc_cfg_dir[128];
char full_cfg_dir[128];
enum kerying_profile_table
{
POLICY_PROFLIE_TABLE_KERING,
POLICY_PROFILE_TABLE_HSM,
POLICY_PROFILE_TABLE_MAX
};
struct config_bucket_t{
Maat_feather_t feather;
int table_id;
struct cert_store_policy{
int mode;
unsigned int enable;
unsigned int local_debug;
unsigned int thread_nu;
unsigned int expire_after;
Maat_feather_t feather;
int plolicy_table_id[POLICY_PROFILE_TABLE_MAX];
uint16_t e_port;
uint16_t store_port;
char store_ip[46];
char ca_path[128];
char uninsec_path[128];
struct ntc_maat_t maat_t;
struct _initer_addr_t addr_t;
};
extern struct config_bucket_t *cfg_instanec();
extern struct cert_store_policy * g_certstore_policy;
void cert_store_init_config(const char *config);
void cert_store_init_config(struct cert_store_policy *certstore_policy, const char *main_profile);
#endif

View File

@@ -103,7 +103,7 @@ typedef struct {
} x509_forge_thread;
int cert_store_session_init();
int cert_store_session_init(struct cert_store_policy *certstore_policy, const char *main_profile);
void sigproc(int __attribute__((__unused__))sig);