60 Commits

Author SHA1 Message Date
Marco d'Itri
19eb4fa5ef mkpasswd: move a forgotten comment to the right place 2019-07-18 04:47:38 +02:00
Marco d'Itri
a0c0bf7144 Split the help messages in multiple strings
To help translators.
2019-06-24 05:07:43 +02:00
Marco d'Itri
2b78ca68df mkpasswd: support the "gost-yescrypt" hash 2019-06-23 15:40:12 +02:00
Marco d'Itri
830c3e3a7c Update the copyright year everywhere 2019-06-23 15:40:12 +02:00
Marco d'Itri
4d24d493ff mkpasswd: implement a generic way to provide the hash type 2018-10-14 03:41:14 +02:00
Marco d'Itri
88a7462301 mkpasswd: support the other hash types in libxcrypt
Among them scrypt and bcrypt.
2018-10-14 03:19:48 +02:00
Marco d'Itri
4362ef1fc4 mkpasswd: reorder the hash types
From the most secure to the less, accordingly to libxcrypt's crypt(5).
2018-10-14 02:33:13 +02:00
Marco d'Itri
b91c9057da mkpasswd: correctly print the available methods as columns 2018-10-14 01:14:09 +02:00
Marco d'Itri
b2ae96cf3f mkpasswd: adopt the John the Ripper naming of hash types
And add hidden compatibility aliases for the old ones.
(Except than the bcrypt variants, since there is no proof that anybody
ever used this program for them.)

See https://github.com/besser82/libxcrypt/pull/26 for more information.
2018-10-10 01:12:27 +02:00
Marco d'Itri
ae31f61a34 mkpasswd: include crypt.h on Solaris 2018-09-20 00:18:06 +02:00
Marco d'Itri
d4d7cd1096 mkpasswd: fix rounds support for bcrypt 2x and 2y 2018-09-20 00:18:06 +02:00
Marco d'Itri
3197cb7db4 mkpasswd: support letting crypt_gensalt decide the prefix
If crypt_gensalt (as implemented by Solaris and modern versions of
libxcrypt) is passed a NULL prefix then it will decide by itself which
algorithm should be used by default.
2018-09-20 00:18:06 +02:00
Marco d'Itri
61f4e5d64c mkpasswd: simplify a check for errors
salt is a const char *, so we know that it cannot be modified as a side
effect.
2018-09-16 03:36:38 +02:00
Marco d'Itri
c1cb4b2ca0 mkpasswd: update the libowcrypt Makefile section
Distributions which have crypt_gensalt in libowcrypt now should define
a HAVE_LIBOWCRYPT=1 Makefile variable.
2018-09-16 03:36:38 +02:00
Marco d'Itri
44775cb342 mkpasswd: rename HAVE_XCRYPT to HAVE_XCRYPT_H 2018-09-16 03:36:38 +02:00
Marco d'Itri
7a325d277c mkpasswd: ifdef out the entropy gathering code on Solaris 2018-09-16 03:35:38 +02:00
Marco d'Itri
19e44ac2ec mkpasswd: let crypt_gensalt collect entropy by itself
Let crypt_gensalt(3) collect entropy by itself instead of having
mkpasswd provide it.
This is supported by the libxcrypt implementation of crypt_gensalt(3).
2018-09-16 03:35:38 +02:00
Marco d'Itri
8392fd349d mkpasswd: use perror with crypt and crypt_gensalt
Only some implementations of crypt(3) set errno on errors.
2018-09-12 02:26:55 +02:00
Marco d'Itri
fbeb327936 mkpasswd: update the copyright year 2018-05-25 01:44:38 +02:00
Marco d'Itri
fdd5a596b0 mkpasswd: support passwords of arbitrary length
Closes: #899254
2018-05-22 05:04:54 +02:00
Marco d'Itri
a9f59fdd52 Update the copyright years 2018-01-13 01:15:48 +01:00
Petr Písař
50b57a6fb7 Remove unused variables in get_random_bytes()
If getentropy() is available, GCC warns about unsused variables:

mkpasswd.c: In function ‘get_random_bytes’:
mkpasswd.c:369:13: warning: unused variable ‘bytes_read’ [-Wunused-variable]
     ssize_t bytes_read;
             ^~~~~~~~~~
mkpasswd.c:368:9: warning: unused variable ‘fd’ [-Wunused-variable]
     int fd;
         ^~

This patch fixes it.
2017-12-27 03:09:58 +01:00
Marco d'Itri
6557a52b3e mkpasswd: use getentropy(2) on recent Linux 2017-12-10 17:14:26 +01:00
Marco d'Itri
182fdaaaaa mkpasswd: refactoring 2017-12-10 17:13:03 +01:00
Andreas Stieger
a786e83add fix FSF address in mkpasswd.c 2017-08-22 16:59:53 +02:00
Marco d'Itri
fb823a251a Annotate more functions with NORETURN
Contributed by Sami Kerola.
Closes #48 from Github.
2017-02-26 23:33:01 +01:00
Marco d'Itri
5e33209e13 Fix minor compiler warnings
Fix a lot of minor compiler warnings with no practical effect.
Contributed by Sami Kerola.
2017-02-26 23:12:47 +01:00
Marco d'Itri
a4815eb370 BSD portability fixes 2017-02-26 14:13:27 +01:00
Marco d'Itri
4ac83a5f49 mkpasswd: fix compile time error with HAVE_ARC4RANDOM_BUF
Patch from MacPorts.
2017-02-26 04:29:11 +01:00
Marco d'Itri
3b38b4fd1d mkpasswd: define _DEFAULT_SOURCE
Since glibc 2.20 it replaces the deprecated _BSD_SOURCE macro.
2016-03-28 18:37:43 +02:00
Marco d'Itri
09d4a0fe88 mkpasswd: exit if crypt_gensalt on Solaris fails 2015-03-23 04:31:02 +01:00
Marco d'Itri
4fa1cd69e4 mkpasswd: use arc4random_buf where available 2014-12-26 19:55:51 +01:00
Marco d'Itri
b207df0805 mkpasswd: support OpenBSD's new hash 2b 2014-12-26 19:55:51 +01:00
Marco d'Itri
5120051324 mkpasswd: fix a memory leak 2014-09-13 02:42:29 +02:00
Marco d'Itri
0ba80dd8b3 mkpasswd: correctly report read(2) failures
They would always be reported as a short read.
2014-09-13 02:42:29 +02:00
Marco d'Itri
9c0fbf514b mkpasswd: the number of random bytes is unsigned 2014-09-13 02:42:29 +02:00
Igor Pashev
4a77be3e03 Port mkpasswd to Solaris/Dyson 2014-05-02 04:26:50 +02:00
Marco d'Itri
d2ee7af1d7 Extract the version number from the changelog 2014-02-07 06:33:08 +01:00
Marco d'Itri
366ca9bcbe mkpasswd: fix an underflow in the parser for -R
Reported by mahkoh on github:
https://github.com/rfc1036/whois/issues/12
2014-02-06 01:03:05 +01:00
Marco d'Itri
865f6025eb Handle --help as success for mkpasswd too 2013-04-10 17:25:05 +02:00
Marco d'Itri
6c3ca39f25 Imported Debian version 5.0.12 2013-03-30 02:31:41 +01:00
Marco d'Itri
9627a203ce Imported Debian version 5.0.1 2013-03-30 02:31:39 +01:00
Marco d'Itri
6b108b4fd4 Imported Debian version 4.7.35 2013-03-30 02:31:38 +01:00
Marco d'Itri
b3164a2b0f Imported Debian version 4.7.33 2013-03-30 02:31:37 +01:00
Marco d'Itri
bd837394e6 Imported Debian version 4.7.29 2013-03-30 02:31:36 +01:00
Marco d'Itri
ce5e346d70 Imported Debian version 4.7.27 2013-03-30 02:31:36 +01:00
Marco d'Itri
e90424d179 Imported Debian version 4.7.26 2013-03-30 02:31:36 +01:00
Marco d'Itri
d0c35c4219 Imported Debian version 4.7.25 2013-03-30 02:31:36 +01:00
Marco d'Itri
9ad7ad696c Imported Debian version 4.7.7 2013-03-30 02:31:32 +01:00
Marco d'Itri
8d33311a68 Imported Debian version 4.7.6 2013-03-30 02:31:32 +01:00