From 5a0ad4684967e746b71f635f397ea4c0ae373f69 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 25 May 2012 20:14:18 +0400 Subject: Implement key extracting for dkim records. --- src/dkim.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/dkim.h') diff --git a/src/dkim.h b/src/dkim.h index a7ad514bf..6bb26887d 100644 --- a/src/dkim.h +++ b/src/dkim.h @@ -136,19 +136,20 @@ typedef struct rspamd_dkim_context_s { gchar *selector; time_t timestamp; time_t expiration; - gchar *b; - gchar *bh; + gint8 *b; + gint8 *bh; GList *hlist; guint ver; + gchar *dns_key; } rspamd_dkim_context_t; -typedef struct rspamd_dkim_key_s { - memory_pool_t *pool; - /* TODO: make this structure */ -} rspamd_dkim_key_t; +typedef guint8 rspamd_dkim_key_t; struct worker_task; +/* Err MUST be freed if it is not NULL, key is allocated by slice allocator */ +typedef void (*dkim_key_handler_f)(rspamd_dkim_key_t *key, gsize keylen, rspamd_dkim_context_t *ctx, gpointer ud, GError *err); + /** * Create new dkim context from signature * @param sig message's signature @@ -165,8 +166,8 @@ rspamd_dkim_context_t* rspamd_create_dkim_context (const gchar *sig, memory_pool * @param s async session to make request * @return */ -rspamd_dkim_key_t* rspamd_get_dkim_key (rspamd_dkim_context_t *ctx, struct rspamd_dns_resolver *resolver, - struct rspamd_async_session *s); +gboolean rspamd_get_dkim_key (rspamd_dkim_context_t *ctx, struct rspamd_dns_resolver *resolver, + struct rspamd_async_session *s, dkim_key_handler_f handler, gpointer ud); /** * Check task for dkim context using dkim key -- cgit v1.2.3