From 7d2af49e0f344d78dc68d16f3db318be35430b38 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 22 Aug 2013 15:36:04 +0100 Subject: Add test for signature checking in rcl. --- test/rspamd_rcl_test.c | 12 +++++++++++- test/test.cfg.sig | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/test.cfg.sig (limited to 'test') 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 -- cgit v1.2.3