diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-05-25 20:14:18 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-05-25 20:14:18 +0400 |
commit | 5a0ad4684967e746b71f635f397ea4c0ae373f69 (patch) | |
tree | 5f6b5c4d8d5cec4c562dab2cad761ea4daad2d6d /src/dkim.h | |
parent | 3f333be9d531f0edecf3f31a241a8692e79a86bd (diff) | |
download | rspamd-5a0ad4684967e746b71f635f397ea4c0ae373f69.tar.gz rspamd-5a0ad4684967e746b71f635f397ea4c0ae373f69.zip |
Implement key extracting for dkim records.
Diffstat (limited to 'src/dkim.h')
-rw-r--r-- | src/dkim.h | 17 |
1 files changed, 9 insertions, 8 deletions
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 |