summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-22 15:36:04 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-22 15:36:04 +0100
commit7d2af49e0f344d78dc68d16f3db318be35430b38 (patch)
treec39e9a117aa7fc838bd68ae2d14e1cc36862ae95 /test
parent8c6093d121a50bccaaba0ee0b731e8803239ae5b (diff)
downloadrspamd-7d2af49e0f344d78dc68d16f3db318be35430b38.tar.gz
rspamd-7d2af49e0f344d78dc68d16f3db318be35430b38.zip
Add test for signature checking in rcl.
Diffstat (limited to 'test')
-rw-r--r--test/rspamd_rcl_test.c12
-rw-r--r--test/test.cfg.sig1
2 files changed, 12 insertions, 1 deletions
diff --git a/test/rspamd_rcl_test.c b/test/rspamd_rcl_test.c
index c4e114409..e5112cd59 100644
--- a/test/rspamd_rcl_test.c
+++ b/test/rspamd_rcl_test.c
@@ -55,10 +55,18 @@ const gchar *rcl_test_valid[] = {
"param = \"value\";\n"
"param2 = value\n"
"array = [ 1, 1mb, test]}\n"
- ".include \"./test.cfg\"}",
+ ".includes \"./test.cfg\"}",
NULL
};
+static const gchar test_pubkey[] = ""
+"-----BEGIN PUBLIC KEY-----\n"
+"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlhk2u5nbTVgEskmS+qZcAj339\n"
+"bLwEK/TXdd0G3d4BVKpF712frw+YwetRdmRRYL5EdjiF01Bv3s6QmsThAJX/li/c\n"
+"Q15YFxhvq9DZ0qJmL7e1NzORo6m/WLRK9wxWA+PXSvSUKrlZ3kt9ygD4z5QZ3/td\n"
+"qil9VM6Mz7P1HJ0KywIDAQAB\n"
+"-----END PUBLIC KEY-----\n";
+
void
rspamd_rcl_test_func (void)
{
@@ -71,6 +79,8 @@ rspamd_rcl_test_func (void)
cur = rcl_test_valid;
while (*cur != NULL) {
parser = rspamd_cl_parser_new ();
+ rspamd_cl_pubkey_add (parser, test_pubkey, sizeof (test_pubkey) - 1, &err);
+ g_assert_no_error (err);
g_assert (parser != NULL);
rspamd_cl_parser_add_chunk (parser, *cur, strlen (*cur), &err);
g_assert_no_error (err);
diff --git a/test/test.cfg.sig b/test/test.cfg.sig
new file mode 100644
index 000000000..de849d59c
--- /dev/null
+++ b/test/test.cfg.sig
@@ -0,0 +1 @@
+BD %j7|"r{v>:LW(dL4{lOE5ߥ]&S/PMՁɔl,@%.@̭V< ^%89_M:rlF!2(1 \ No newline at end of file