pike.git / src / crypt.c

version» Context lines:

pike.git/src/crypt.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: crypt.c,v 1.8 2003/11/11 13:47:26 grubba Exp $ + || $Id: crypt.c,v 1.9 2003/12/07 19:42:03 marcus Exp $   */      /*    * From Andy Tanenbaum's book "Computer Networks",    * rewritten in C    */      struct block {    unsigned char b_data[64];   };
pike.git/src/crypt.c:207:    }    f(j, &key, p, &x);    for (k = 31; k >= 0; k--) {    p->b_data[k+32] = b.b_data[k] ^ x.b_data[k];    }    }    transpose(p, &swap, 64);    transpose(p, &FinalTr, 64);   }    - char *crypt(char *pw, char *salt) + char *crypt(const char *pw, const char *salt)   {       char pwb[66];    static char result[16]; -  register char *p = pwb; +  register char *p = pwb, *p2;    struct ordering new_etr;    register int i;       while (*pw && p < &pwb[64]) {    register int j = 7;       while (j--) {    *p++ = (*pw >> j) & 01;    }    pw++;
pike.git/src/crypt.c:258:    }    }    }       if (result[1] == 0) result[1] = result[0];       for (i = 0; i < 25; i++) encrypt(pwb,0);    EP = &etr;       p = pwb; -  pw = result+2; +  p2 = result+2;    while (p < &pwb[66]) {    register int c = 0;    register int j = 6;       while (j--) {    c <<= 1;    c |= *p++;    }    c += '.'; /* becomes >= '.' */    if (c > '9') c += 7; /* not in [./0-9], becomes upper */    if (c > 'Z') c += 6; /* not in [A-Z], becomes lower */ -  *pw++ = (char) c; +  *p2++ = (char) c;    } -  *pw = 0; +  *p2 = 0;    return result;   }