I have the need to check against hashes generated by pwhash (I have a CGI script doing logins). I'd like an option in pwhash to explicitly specify the setting for crypt() (rather than create a whole separate binary). The -s option almost does this except that it verifies that there is no $ in the optarg (to ensure DES), so the changes to the source are minimal (5 lines). I added a -x, the option argument explicitly specifies the crypt() setting.
Anyway, just thought someone else might be interested.
JP
P.S. I'm not sure how to submit patches, but I ran `cvs diff` in /usr/src/usr.bin/pwhash and this is the output
Index: pwhash.c
===================================================================
RCS file: /cvsroot/src/usr.bin/pwhash/pwhash.c,v
retrieving revision 1.15
diff -r1.15 pwhash.c
56a57
> #define DO_CRYPT 5
63c64
< "Usage: %s [-km] [-b rounds] [-S rounds] [-s salt] [-p | string]\n",
---
> "Usage: %s [-km] [-b rounds] [-S rounds] [-s salt] [-x setting] [-p | string]\n",
118a120
> case DO_CRYPT:
149c151
< while ((opt = getopt(argc, argv, "kmpS:s:b:")) != -1) {
---
> while ((opt = getopt(argc, argv, "kmpS:s:b:x:")) != -1) {
179a182
> case 'x':