Changeset 618
- Timestamp:
- 01/07/08 15:19:28 (5 months ago)
- Files:
-
- 1 modified
-
trunk/storage/authreg_mysql.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/storage/authreg_mysql.c
r541 r618 30 30 enum mysql_pws_crypt { MPC_PLAIN, MPC_CRYPT }; 31 31 32 static char salter[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ./"; 33 32 34 typedef struct mysqlcontext_st { 33 35 MYSQL * conn; … … 174 176 snprintf(irealm, MYSQL_LR+1, "%s", realm); 175 177 178 if (ctx->password_type == MPC_CRYPT) { 179 char salt[12] = "$1$"; 180 int i; 181 182 srand(time(0)); 183 for(i=0; i<8; i++) 184 salt[3+i] = salter[rand()%64]; 185 salt[11] = '\0'; 186 strcpy(password, crypt(password, salt)); 187 } 188 176 189 password[256]= '\0'; 177 190
