2018-06-19 11:32:16 +08:00
|
|
|
/*************************************************************************
|
2018-09-06 19:51:23 +08:00
|
|
|
> File Name: cert_conf.h
|
2018-06-19 11:32:16 +08:00
|
|
|
> Author:
|
|
|
|
|
> Mail:
|
|
|
|
|
> Created Time: Fri 01 Jun 2018 12:06:26 AM PDT
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef _CERT_INIT_H
|
|
|
|
|
#define _CERT_INIT_H
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <event.h>
|
2019-11-05 11:38:40 +08:00
|
|
|
#include <openssl/x509.h>
|
|
|
|
|
#include <openssl/evp.h>
|
2018-06-19 11:32:16 +08:00
|
|
|
|
2019-11-05 11:38:40 +08:00
|
|
|
#include <MESA/Maat_rule.h>
|
|
|
|
|
#include <MESA/MESA_htable.h>
|
2018-07-09 14:32:41 +08:00
|
|
|
|
2019-05-24 15:09:34 +08:00
|
|
|
#define CT_PATH_MAX 256
|
|
|
|
|
#define CT_ARRARY_LEN (CT_PATH_MAX/2)
|
|
|
|
|
#define CT_STRING_MAX 1024
|
|
|
|
|
|
2019-11-11 17:45:03 +08:00
|
|
|
struct tfe_http_request{
|
2018-09-10 10:01:27 +08:00
|
|
|
#define DATALEN 128
|
|
|
|
|
int thread_id;
|
2018-09-20 10:11:15 +08:00
|
|
|
int is_valid;
|
2018-09-06 19:51:23 +08:00
|
|
|
char *odata;
|
2018-09-10 10:01:27 +08:00
|
|
|
X509 *origin;
|
|
|
|
|
int keyring_id;
|
2019-08-08 16:06:23 +08:00
|
|
|
char *sni;
|
2018-09-10 10:01:27 +08:00
|
|
|
char rkey[DATALEN];
|
2020-04-14 17:01:08 +08:00
|
|
|
struct timespec create_time;
|
2018-09-06 19:51:23 +08:00
|
|
|
struct evhttp_request *evh_req;
|
|
|
|
|
};
|
2018-06-19 11:32:16 +08:00
|
|
|
|
2018-09-06 19:51:23 +08:00
|
|
|
struct pxy_obj_keyring{
|
2019-05-24 15:09:34 +08:00
|
|
|
int keyring_id;
|
2020-10-30 19:37:24 +08:00
|
|
|
int use_hsm;
|
|
|
|
|
int slot_id;
|
2019-08-08 17:12:18 +08:00
|
|
|
uint64_t expire_time;
|
|
|
|
|
EVP_PKEY *key;
|
2019-11-11 17:45:03 +08:00
|
|
|
X509 *issuer;
|
2019-05-24 15:09:34 +08:00
|
|
|
char keyring_type[CT_ARRARY_LEN];
|
|
|
|
|
char public_algo[CT_STRING_MAX];
|
|
|
|
|
char v3_ctl[CT_STRING_MAX];
|
2019-11-11 17:45:03 +08:00
|
|
|
int is_send;
|
2019-11-21 17:35:09 +08:00
|
|
|
int is_valid;
|
2019-11-28 15:08:37 +08:00
|
|
|
time_t op_time;
|
2019-08-08 17:12:18 +08:00
|
|
|
atomic64_t ref_cnt;
|
2018-10-22 11:15:57 +08:00
|
|
|
STACK_OF(X509) *stack_ca;
|
2018-09-06 19:51:23 +08:00
|
|
|
};
|
2018-07-09 14:32:41 +08:00
|
|
|
|
2018-09-10 10:01:27 +08:00
|
|
|
struct _initer_addr_t{
|
2020-04-14 17:01:08 +08:00
|
|
|
uint16_t e_port; /*libevent prot*/
|
2018-10-22 11:15:57 +08:00
|
|
|
uint16_t maat_port; /*maat redis port*/
|
|
|
|
|
char maat_ip[16]; /*maat redis ip */
|
|
|
|
|
int dbindex; /*maat redis dbindex*/
|
|
|
|
|
|
2022-08-23 14:38:29 +08:00
|
|
|
uint16_t local_redis_port; /*store redis port */
|
|
|
|
|
char local_redis_ip[16]; /*store redis ip*/
|
|
|
|
|
char local_redis_passwd[128];
|
2020-04-14 17:01:08 +08:00
|
|
|
|
|
|
|
|
uint16_t statsd_port;
|
|
|
|
|
char statsd_server[16];
|
2018-06-19 11:32:16 +08:00
|
|
|
};
|
|
|
|
|
|
2018-09-18 14:48:55 +08:00
|
|
|
struct ntc_maat_t{
|
2018-10-22 11:15:57 +08:00
|
|
|
unsigned int maat_json_switch;
|
|
|
|
|
unsigned int effective_interval_s;
|
2018-09-18 14:48:55 +08:00
|
|
|
char info_path[128];
|
|
|
|
|
char pxy_path[128];
|
|
|
|
|
char inc_cfg_dir[128];
|
|
|
|
|
char full_cfg_dir[128];
|
|
|
|
|
};
|
|
|
|
|
|
2018-06-19 11:32:16 +08:00
|
|
|
struct config_bucket_t{
|
2019-05-24 15:09:34 +08:00
|
|
|
Maat_feather_t feather;
|
|
|
|
|
int table_id;
|
2019-08-21 14:03:53 +08:00
|
|
|
int mode;
|
2019-05-24 15:09:34 +08:00
|
|
|
unsigned int local_debug;
|
2018-06-19 11:32:16 +08:00
|
|
|
unsigned int thread_nu;
|
2018-09-10 10:01:27 +08:00
|
|
|
unsigned int expire_after;
|
2018-12-13 10:12:24 +08:00
|
|
|
char ca_path[128];
|
|
|
|
|
char uninsec_path[128];
|
2018-09-18 14:48:55 +08:00
|
|
|
struct ntc_maat_t maat_t;
|
2018-09-10 10:01:27 +08:00
|
|
|
struct _initer_addr_t addr_t;
|
2018-06-19 11:32:16 +08:00
|
|
|
};
|
|
|
|
|
|
2020-04-14 17:01:08 +08:00
|
|
|
extern struct config_bucket_t *cfg_instanec();
|
2018-06-19 11:32:16 +08:00
|
|
|
|
2020-11-12 15:42:28 +08:00
|
|
|
void cert_store_init_config(const char *config);
|
2018-06-19 11:32:16 +08:00
|
|
|
|
|
|
|
|
#endif
|