31 |
|
|
32 |
#include <stdlib.h> |
#include <stdlib.h> |
33 |
#include <string.h> |
#include <string.h> |
34 |
#include <md5-rsa.h> |
#include <md5.h> |
35 |
#include <ctype.h> |
#include <ctype.h> |
36 |
#ifdef HAVE_STRINGS_H |
#ifdef HAVE_STRINGS_H |
37 |
# include <strings.h> |
# include <strings.h> |
108 |
} |
} |
109 |
|
|
110 |
/* given an interpretor and a script, produce an executable script */ |
/* given an interpretor and a script, produce an executable script */ |
111 |
int sieve_script_parse(sieve_interp_t *interp, FILE *script, |
int sieve_script_parse(sieve_interp_t *interp, FILE *script, |
112 |
void *script_context, sieve_script_t **ret) |
void *script_context, sieve_script_t **ret) |
113 |
{ |
{ |
114 |
sieve_script_t *s; |
sieve_script_t *s; |
811 |
|
|
812 |
static int makehash(unsigned char hash[HASHSIZE], char *s1, char *s2) |
static int makehash(unsigned char hash[HASHSIZE], char *s1, char *s2) |
813 |
{ |
{ |
814 |
MD5_CTX ctx; |
struct md5_ctx ctx; |
815 |
|
|
816 |
MD5Init(&ctx); |
md5_init_ctx (&ctx); |
817 |
MD5Update(&ctx, (unsigned char*) s1, strlen(s1)); |
md5_process_bytes (s1, strlen(s1), &ctx); |
818 |
MD5Update(&ctx, (unsigned char*) s2, strlen(s2)); |
md5_process_bytes (s2, strlen(s2), &ctx); |
819 |
MD5Final(hash, &ctx); |
md5_finish_ctx (&ctx, hash); |
820 |
|
|
821 |
return SIEVE_OK; |
return SIEVE_OK; |
822 |
} |
} |
823 |
|
|
824 |
/* execute a script on a message, producing side effects via callbacks. |
/* execute a script on a message, producing side effects via callbacks. |