bcrypt2.diff
| b/secure/lib/libcrypt/crypt-blowfish.c | ||
|---|---|---|
| 78 | 78 | |
| 79 | 79 |
static char encrypted[_PASSWORD_LEN]; |
| 80 | 80 |
static char gsalt[BCRYPT_MAXSALT * 4 / 3 + 1]; |
| 81 |
static char error[] = ":"; |
|
| 82 | 81 | |
| 83 | 82 |
static const u_int8_t Base64Code[] = |
| 84 | 83 |
"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
| ... | ... | |
| 228 | 227 |
salt++; |
| 229 | 228 | |
| 230 | 229 |
if (*salt > BCRYPT_VERSION) {
|
| 231 |
/* How do I handle errors ? Return ':' */ |
|
| 232 |
return error; |
|
| 230 |
/* How do I handle errors ? Return NULL according to |
|
| 231 |
crypt(3) */ |
|
| 232 |
return NULL; |
|
| 233 | 233 |
} |
| 234 | 234 | |
| 235 | 235 |
/* Check for minor versions */ |
| ... | ... | |
| 241 | 241 |
salt++; |
| 242 | 242 |
break; |
| 243 | 243 |
default: |
| 244 |
return error;
|
|
| 244 |
return NULL;
|
|
| 245 | 245 |
} |
| 246 | 246 |
} else |
| 247 | 247 |
minor = 0; |
| ... | ... | |
| 251 | 251 | |
| 252 | 252 |
if (salt[2] != '$') |
| 253 | 253 |
/* Out of sync with passwd entry */ |
| 254 |
return error;
|
|
| 254 |
return NULL;
|
|
| 255 | 255 | |
| 256 | 256 |
/* Computer power doesnt increase linear, 2^x should be fine */ |
| 257 | 257 |
if ((rounds = (u_int32_t) 1 << (logr = atoi(salt))) < BCRYPT_MINROUNDS) |
| 258 |
return error;
|
|
| 258 |
return NULL;
|
|
| 259 | 259 | |
| 260 | 260 |
/* Discard num rounds + "$" identifier */ |
| 261 | 261 |
salt += 3; |