aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-29 17:29:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-29 17:29:24 +0100
commit6bb8bcbbaa479c8475754fcc86e204061b92c64a (patch)
treec2378078a8b17b9cc74859fb9ef2819a54a8e489 /src/fuzzy_storage.h
parent5e6e842bd1eac64a39e809be7b1383e29bf3a75a (diff)
downloadrspamd-6bb8bcbbaa479c8475754fcc86e204061b92c64a.tar.gz
rspamd-6bb8bcbbaa479c8475754fcc86e204061b92c64a.zip
Add encryption to fuzzy storage.
Diffstat (limited to 'src/fuzzy_storage.h')
-rw-r--r--src/fuzzy_storage.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/fuzzy_storage.h b/src/fuzzy_storage.h
index 57d7b5cc7..2e97f8190 100644
--- a/src/fuzzy_storage.h
+++ b/src/fuzzy_storage.h
@@ -4,6 +4,7 @@
#include "config.h"
#include "rspamd.h"
#include "shingles.h"
+#include "cryptobox.h"
#define RSPAMD_FUZZY_VERSION 3
@@ -34,4 +35,32 @@ RSPAMD_PACKED(rspamd_fuzzy_reply) {
float prob;
};
+RSPAMD_PACKED(rspamd_fuzzy_encrypted_req_hdr) {
+ guchar magic[4];
+ guchar reserved[8];
+ guchar pubkey[rspamd_cryptobox_PKBYTES];
+ guchar nonce[rspamd_cryptobox_NONCEBYTES];
+ guchar mac[rspamd_cryptobox_MACBYTES];
+};
+
+RSPAMD_PACKED(rspamd_fuzzy_encrypted_cmd) {
+ struct rspamd_fuzzy_encrypted_req_hdr hdr;
+ struct rspamd_fuzzy_cmd cmd;
+};
+
+RSPAMD_PACKED(rspamd_fuzzy_encrypted_shingle_cmd) {
+ struct rspamd_fuzzy_encrypted_req_hdr hdr;
+ struct rspamd_fuzzy_shingle_cmd cmd;
+};
+
+RSPAMD_PACKED(rspamd_fuzzy_encrypted_rep_hdr) {
+ guchar nonce[rspamd_cryptobox_NONCEBYTES];
+ guchar mac[rspamd_cryptobox_MACBYTES];
+};
+
+RSPAMD_PACKED(rspamd_fuzzy_encrypted_reply) {
+ struct rspamd_fuzzy_encrypted_rep_hdr hdr;
+ struct rspamd_fuzzy_reply rep;
+};
+
#endif