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

@ -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