/[imapfilter]/imapfilter/passwd.c
ViewVC logotype

Diff of /imapfilter/passwd.c

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

revision 1.12 by lefcha, Mon May 26 08:29:58 2003 UTC revision 1.13 by lefcha, Sun Jul 27 15:55:40 2003 UTC
# Line 48  get_password(char *passwd, size_t pwlen) Line 48  get_password(char *passwd, size_t pwlen)
48  int  int
49  encrypt_passwords(FILE * fd, account_t ** accts)  encrypt_passwords(FILE * fd, account_t ** accts)
50  {  {
51          int i;          int i, n;
         char *c;  
52          unsigned char iv[EVP_MAX_IV_LENGTH];          unsigned char iv[EVP_MAX_IV_LENGTH];
53          unsigned char *key;          unsigned char *key;
54          unsigned char buf[ENCRYPTION_BUF];          unsigned char buf[ENCRYPTION_BUF];
# Line 66  encrypt_passwords(FILE * fd, account_t * Line 65  encrypt_passwords(FILE * fd, account_t *
65          srandom(time(NULL));          srandom(time(NULL));
66    
67          /* Initialization vector. */          /* Initialization vector. */
68          c = ultostr(1 + random() % 100000000, 10);          n = 1 + random() % 100000000, 10;
69          snprintf(iv, EVP_MAX_IV_LENGTH, "%08s", c);          snprintf(iv, EVP_MAX_IV_LENGTH, "%08d", n);
70          fprintf(fd, "%s\n", iv);          fprintf(fd, "%s\n", iv);
71    
72          EVP_CIPHER_CTX_init(&ctx);          EVP_CIPHER_CTX_init(&ctx);

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26