tech-crypto archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
re: pwhash - added -x option
hi JP.
can you use "cvs diff -up"? (unified diff and likely function
name options.) you can put "diff -up" in ~/.cvsrc.
i think i'd rather this didn't try to be tricky and re-use 2
lines, but have the case 'x' be its own chunk, and perhaps it
should grow a "DO_CHECK" that is set instead of DO_SED, and
that print_passwd() considers the same as DO_SED. this should
only total less than 10 extra lines without conflating options.
thanks!
.mrg.
> 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':
>
> --0000000000008971a4057b9321c2
> Content-Type: text/html; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> <div dir=3D"ltr"><div>I have the need to check against hashes generated by =
> pwhash (I have a CGI script doing logins).=C2=A0 I'd like an option in =
> pwhash to explicitly specify the setting for crypt() (rather than create a =
> whole separate binary).=C2=A0 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).=C2=A0 I added a -x, the option argumen=
> t explicitly specifies the crypt() setting.<br></div><div><br></div><div>An=
> yway, just thought someone else might be interested.</div><div><br></div><d=
> iv>JP<br></div><div><br></div><div>P.S.=C2=A0 I'm not sure how to submi=
> t patches, but I ran `cvs diff` in /usr/src/usr.bin/pwhash and this is the =
> output</div><div><br></div><div>
> <pre>Index: pwhash.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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 | str=
> ing]\n",
> ---
> > "Usage: %s [-km] [-b rounds] [-S rounds] [-s salt] [-x setti=
> ng] [-p | string]\n",
> 118a120
> > case DO_CRYPT:
> 149c151
> < while ((opt =3D getopt(argc, argv, "kmpS:s:b:")) !=3D -1) {
> ---
> > while ((opt =3D getopt(argc, argv, "kmpS:s:b:x:")) !=3D -1)=
> {
> 179a182
> > case 'x':</pre>
>
> </div></div>
>
> --0000000000008971a4057b9321c2--
>
Home |
Main Index |
Thread Index |
Old Index