/[mailutils]/mailutils/sieve/script.c
ViewVC logotype

Diff of /mailutils/sieve/script.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by sroberts, Sun Jan 6 02:33:14 2002 UTC revision 1.6 by gray, Tue Sep 3 09:37:59 2002 UTC
# Line 31  OF OR IN CONNECTION WITH THE USE OR PERF Line 31  OF OR IN CONNECTION WITH THE USE OR PERF
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>
# Line 108  int script_require(sieve_script_t *s, ch Line 108  int script_require(sieve_script_t *s, ch
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;
# Line 811  const char * sieve_errname (int e) Line 811  const char * sieve_errname (int e)
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.

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26