Testsuite: fix testcase use of paths
[exim.git] / src / src / dkim.c
index 5883596a725e2b27c535db4cd3169516074d11fa..5c9d2279e165767715385013862a330b81023c9d 100644 (file)
@@ -45,7 +45,7 @@ The return string is tainted, having come from off-site.
 uschar *
 dkim_exim_query_dns_txt(const uschar * name)
 {
-dns_answer * dnsa = store_get(sizeof(dns_answer), TRUE);       /* use tainted mem */
+dns_answer * dnsa = store_get_dns_answer();
 dns_scan dnss;
 rmark reset_point = store_mark();
 gstring * g = NULL;
@@ -95,6 +95,8 @@ return NULL;  /*XXX better error detail?  logging? */
 void
 dkim_exim_init(void)
 {
+if (f.dkim_init_done) return;
+f.dkim_init_done = TRUE;
 pdkim_init();
 }
 
@@ -103,6 +105,8 @@ pdkim_init();
 void
 dkim_exim_verify_init(BOOL dot_stuffing)
 {
+dkim_exim_init();
+
 /* There is a store-reset between header & body reception
 so cannot use the main pool. Any allocs done by Exim
 memory-handling must use the perm pool. */
@@ -569,6 +573,8 @@ void
 dkim_exim_sign_init(void)
 {
 int old_pool = store_pool;
+
+dkim_exim_init();
 store_pool = POOL_MAIN;
 pdkim_init_context(&dkim_sign_ctx, FALSE, &dkim_exim_query_dns_txt);
 store_pool = old_pool;