=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/passwd/Attic/pwd_gensalt.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/passwd/Attic/pwd_gensalt.c 1998/07/04 18:27:04 1.8 --- src/usr.bin/passwd/Attic/pwd_gensalt.c 1998/07/05 21:08:32 1.9 *************** *** 1,4 **** ! /* $OpenBSD: pwd_gensalt.c,v 1.8 1998/07/04 18:27:04 provos Exp $ */ /* * Copyright 1997 Niels Provos * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: pwd_gensalt.c,v 1.9 1998/07/05 21:08:32 provos Exp $ */ /* * Copyright 1997 Niels Provos * All rights reserved. *************** *** 91,100 **** salt[2] = '\0'; } else if (!strcmp(now, "newsalt")) { u_int32_t rounds = atol(next); - if (rounds < 725) - rounds = 725; if (max < 10) return 0; salt[0] = _PASSWORD_EFMT1; to64(&salt[1], (u_int32_t) rounds, 4); to64(&salt[5], arc4random(), 4); --- 91,103 ---- salt[2] = '\0'; } else if (!strcmp(now, "newsalt")) { u_int32_t rounds = atol(next); if (max < 10) return 0; + /* Check rounds, 24 bit is max */ + if (rounds < 7250) + rounds = 7250; + else if (rounds > 0xffffff) + rounds = 0xffffff; salt[0] = _PASSWORD_EFMT1; to64(&salt[1], (u_int32_t) rounds, 4); to64(&salt[5], arc4random(), 4);