aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-09 17:13:12 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-09 17:13:12 +0100
commitc2351037b581724ce6d6cbcf4da5a0115b87c8de (patch)
treed55bd57d8bda456308b21cba7827fb2e2fc272a0 /src/libstat
parentf5c0d7116e373fa48ab465e8d8dcae1ddaf44932 (diff)
downloadrspamd-c2351037b581724ce6d6cbcf4da5a0115b87c8de.tar.gz
rspamd-c2351037b581724ce6d6cbcf4da5a0115b87c8de.zip
[Feature] Support multiple base32 alphabets
Diffstat (limited to 'src/libstat')
-rw-r--r--src/libstat/backends/sqlite3_backend.c2
-rw-r--r--src/libstat/learn_cache/redis_cache.c2
-rw-r--r--src/libstat/stat_process.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libstat/backends/sqlite3_backend.c b/src/libstat/backends/sqlite3_backend.c
index 38f296177..1ddfa6f17 100644
--- a/src/libstat/backends/sqlite3_backend.c
+++ b/src/libstat/backends/sqlite3_backend.c
@@ -502,7 +502,7 @@ rspamd_sqlite3_opendb (rspamd_mempool_t *pool,
tk_conf = tokenizer->get_config (pool, stcf->clcf->tokenizer, &sz);
/* Encode to base32 */
- tok_conf_encoded = rspamd_encode_base32 (tk_conf, sz);
+ tok_conf_encoded = rspamd_encode_base32 (tk_conf, sz, RSPAMD_BASE32_DEFAULT);
if (rspamd_sqlite3_run_prstmt (pool, bk->sqlite, bk->prstmt,
RSPAMD_STAT_BACKEND_SAVE_TOKENIZER,
diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c
index bdf83f858..73a72a614 100644
--- a/src/libstat/learn_cache/redis_cache.c
+++ b/src/libstat/learn_cache/redis_cache.c
@@ -225,7 +225,7 @@ rspamd_stat_cache_redis_generate_id (struct rspamd_task *task)
b32out = rspamd_mempool_alloc (task->task_pool,
sizeof (out) * 8 / 5 + 3);
i = rspamd_encode_base32_buf (out, sizeof (out), b32out,
- sizeof (out) * 8 / 5 + 2);
+ sizeof (out) * 8 / 5 + 2, RSPAMD_BASE32_DEFAULT);
if (i > 0) {
/* Zero terminate */
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 93287dc68..aed588073 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -180,7 +180,7 @@ rspamd_stat_process_tokenize (struct rspamd_stat_ctx *st_ctx,
}
rspamd_cryptobox_hash_final (&hst, hout);
- b32_hout = rspamd_encode_base32 (hout, sizeof (hout));
+ b32_hout = rspamd_encode_base32 (hout, sizeof (hout), RSPAMD_BASE32_DEFAULT);
/*
* We need to strip it to 32 characters providing ~160 bits of
* hash distribution