Split secrets.h to public and core + miscellaneous cleanup

Also, changed some function names to this_style from thisStyle. More of
this in later commits.
This commit is contained in:
Esa Korhonen
2017-01-27 13:14:31 +02:00
parent 6cc205dafa
commit 1f9b18e3bc
15 changed files with 107 additions and 72 deletions

View File

@ -45,16 +45,16 @@ MXS_BEGIN_DECLS
typedef struct
{
int feedback_enable; /**< Enable/Disable Notification feedback */
char *feedback_url; /**< URL to which the data is sent */
char *feedback_user_info; /**< User info included in the feedback data sent */
int feedback_timeout; /**< An attempt to write/read the data times out and fails after this many seconds */
int feedback_connect_timeout; /**< An attempt to send the data times out and fails after this many seconds */
int feedback_last_action; /**< Holds the feedback last send action status */
int feedback_frequency; /*< Frequency of the housekeeper task */
char *release_info; /**< Operating system Release name */
char *sysname; /**< Operating system name */
uint8_t *mac_sha1; /**< First available MAC address*/
int feedback_enable; /**< Enable/Disable Notification feedback */
char *feedback_url; /**< URL to which the data is sent */
char *feedback_user_info; /**< User info included in the feedback data sent */
int feedback_timeout; /**< An attempt to write/read the data times out and fails after this many seconds */
int feedback_connect_timeout;/**< An attempt to send the data times out and fails after this many seconds */
int feedback_last_action; /**< Holds the feedback last send action status */
int feedback_frequency; /*< Frequency of the housekeeper task */
char *release_info; /**< Operating system Release name */
char *sysname; /**< Operating system name */
uint8_t *mac_sha1; /**< First available MAC address*/
} FEEDBACK_CONF;
extern char *gw_bin2hex(char *out, const uint8_t *in, unsigned int len);

View File

@ -43,7 +43,7 @@ typedef enum routing_capability
/** Result sets are delivered in one buffer; implies RCAP_TYPE_STMT_OUTPUT. */
RCAP_TYPE_RESULTSET_OUTPUT = 0x0050, /* 0b0000000001110000 */
} routing_capability_t;
} mxs_routing_capability_t;
#define RCAP_TYPE_NONE 0

View File

@ -13,48 +13,15 @@
*/
/**
* @file secrets.h
*
* @verbatim
* Revision History
*
* Date Who Description
* 23/06/2013 Massimiliano Pinto Initial implementation
*
* @endverbatim
* @file include/maxscale/secrets.h - MaxScale config file password decryption
*/
#include <maxscale/cdefs.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <openssl/aes.h>
MXS_BEGIN_DECLS
#define MAXSCALE_KEYLEN 32
#define MAXSCALE_IV_LEN 16
/**
* The key structure held in the secrets file
*/
typedef struct maxkeys
{
unsigned char enckey[MAXSCALE_KEYLEN];
unsigned char initvector[MAXSCALE_IV_LEN];
} MAXKEYS;
enum
{
MXS_PASSWORD_MAXLEN = 79
};
extern int secrets_writeKeys(const char *directory);
extern char *decryptPassword(const char *);
extern char *encryptPassword(const char*, const char *);
char *decrypt_password(const char *);
MXS_END_DECLS