diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/cryprov.h | 2 | ||||
-rw-r--r-- | runtime/libgcry.c | 6 | ||||
-rw-r--r-- | runtime/libgcry.h | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/runtime/cryprov.h b/runtime/cryprov.h index 5b694f46..8496b745 100644 --- a/runtime/cryprov.h +++ b/runtime/cryprov.h @@ -36,6 +36,4 @@ BEGINinterface(cryprov) /* name must also be changed in ENDinterface macro! */ rsRetVal (*OnFileClose)(void *pFileInstData, off64_t offsLogfile); ENDinterface(cryprov) #define cryprovCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ -rsRetVal initCrypt(int gcry_mode, char * iniVector); -rsRetVal doCrypt(char *buf, size_t *len); #endif /* #ifndef INCLUDED_CRYPROV_H */ diff --git a/runtime/libgcry.c b/runtime/libgcry.c index 94e087ac..5fd55360 100644 --- a/runtime/libgcry.c +++ b/runtime/libgcry.c @@ -14,9 +14,11 @@ * For the current implementation, there must always be an IV record * followed by an END record. Each records is LF-terminated. Record * types can simply be extended in the future by specifying new - * keywords (like "IV") before the colon. + * types (like "IV") before the colon. * To identify a file as rsyslog encryption info file, it must start with * the line "FILETYPE:rsyslog-enrcyption-info" + * There are some size constraints: the recordtype must be 31 bytes at + * most and the actual value (between : and LF) must be 1023 bytes at most. * * This file is part of rsyslog. * @@ -191,7 +193,7 @@ gcryfileConstruct(gcryctx ctx, gcryfile *pgf, uchar *logfn) CHKmalloc(gf = calloc(1, sizeof(struct gcryfile_s))); gf->ctx = ctx; - snprintf(fn, sizeof(fn), "%s.encinfo", logfn); + snprintf(fn, sizeof(fn), "%s%s", logfn, ENCINFO_SUFFIX); fn[MAXFNAME] = '\0'; /* be on save side */ gf->eiName = (uchar*) strdup(fn); *pgf = gf; diff --git a/runtime/libgcry.h b/runtime/libgcry.h index 6e677130..857d2352 100644 --- a/runtime/libgcry.h +++ b/runtime/libgcry.h @@ -52,6 +52,9 @@ int rsgcryEncrypt(gcryfile pF, uchar *buf, size_t *len); #define RSGCRYE_EI_OPEN 1 /* error opening .encinfo file */ #define RSGCRYE_OOM 4 /* ran out of memory */ +#define EIF_MAX_RECTYPE_LEN 31 /* max length of record types */ +#define EIF_MAX_VALUE_LEN 1023 /* max length of value types */ #define RSGCRY_FILETYPE_NAME "rsyslog-enrcyption-info" +#define ENCINFO_SUFFIX ".encinfo" #endif /* #ifndef INCLUDED_LIBGCRY_H */ |