joungkyun / genpasswd Goto Github PK
View Code? Open in Web Editor NEWGENPASSWD - generate password string to STDOUT with MD5, SHA256, SHA512
License: BSD 2-Clause "Simplified" License
GENPASSWD - generate password string to STDOUT with MD5, SHA256, SHA512
License: BSD 2-Clause "Simplified" License
apply autools before release 1.0.0
The configure script is passed that checks no libcrypt library. So, make build error.
[root@host ~]$ make
make all-recursive
make[1]: Entering directory `/root/work/github/z/genpasswd'
Making all in .
make[2]: Entering directory `/root/work/github/z/genpasswd'
gcc -DHAVE_CONFIG_H -DLANGDIR=\"/usr/local/share/locale\" -I. -Wall -g -O2 -c genpasswd.c
gcc -Wall -g -O2 -o genpasswd genpasswd.o
genpasswd.o: In function `main':
/root/work/github/z/genpasswd/genpasswd.c:351: undefined reference to `crypt'
collect2: error: ld returned 1 exit status
make[2]: *** [genpasswd] 오류 1
make[2]: Leaving directory `/root/work/github/z/genpasswd'
make[1]: *** [all-recursive] 오류 1
make[1]: Leaving directory `/root/work/github/z/genpasswd'
make: *** [all] 오류 2
The configure script will stop as follow:
[root@host ~]$ ./configure
...
checking libintl.h presence... yes
checking for libintl.h... yes
checking for crypts in -lcrypt... no
configure: error: libcrypt not found!
[root@host ~]$
on STDIN (-i) mode, don't check password complexity.
Expected result:
[root@host genpasswd]$ echo 'asdf' | ./genpasswd -i -mmd5
BAD PASSWORD: The password is shorter than 8 characters
[root@host genpasswd]$ echo 'asdfasdfqwer' | ./genpasswd -i -m md5
BAD PASSWORD: The password contains less than 3 character classes
[root@host genpasswd]$
Actual result:
[root@host genpasswd]$ echo 'asdf' | ./genpasswd -i -mmd5
$1$GbfSL8qd$1s/OdxepYJoo.BgRkkokF1
[root@host genpasswd]$ echo 'asdfasdfqwer' | ./genpasswd -i -m md5
$1$42ceug6a$cXolxxFcbKJYutADPK7gL.
[root@host genpasswd]$
genpasswd initial souce used o_getopt fucntion that linked with olibc (liboc.so).
Before release 1.0.0, I remove this dependency and replace getopt
Expected result:
[root@host genpasswd]$ echo 'asdf' | ./genpasswd
BAD PASSWORD: The password is shorter than 8 characters
[root@host genpasswd]$
Actual result:
[root@host genpasswd]$ echo 'asdf' | ./genpasswd
genpasswd 0.0.1 : generate password string
Usage: genpasswd [OPTION]
-h, --help this help messages
-i, --stdin given password with STDIN
-m, --method=[md5|sha256|sha512] Crypt algorithm [default: sha512]
-s, --salt=SALT user define salt [default: random string]
[root@host genpasswd]$
support i18n messages with gettext
need to remove z(result of test-install) and *.bz2 *.gz
_Expected :_
[root@an3 genpasswd]$ make check
Making check in .
make[1]: Entering directory `/root/work/github/genpasswd'
make[1]: Leaving directory `/root/work/github/genpasswd'
Making check in po
make[1]: Entering directory `/root/work/github/genpasswd/po'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/root/work/github/genpasswd/po'
Making check in tests
make[1]: Entering directory `/root/work/github/genpasswd/tests'
make check-TESTS
make[2]: Entering directory `/root/work/github/genpasswd/tests'
make[3]: Entering directory `/root/work/github/genpasswd/tests'
PASS: md5.test 1 - MD5 generate
PASS: md5.test 2 - MD5 matching
PASS: sha256.test 1 - SHA256 generate
PASS: sha256.test 2 - SHA256 matching
PASS: sha512.test 1 - SHA512 generate
PASS: sha512.test 2 - SHA512 matching
make[4]: Entering directory `/root/work/github/genpasswd/tests'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/root/work/github/genpasswd/tests'
============================================================================
Testsuite summary for genpasswd 1.0.0
============================================================================
# TOTAL: 6
# PASS: 6
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory `/root/work/github/genpasswd/tests'
make[2]: Leaving directory `/root/work/github/genpasswd/tests'
make[1]: Leaving directory `/root/work/github/genpasswd/tests'
[root@an3 genpasswd]$
missing dist README.md and LICENSE files
support travis-ci envirionment
user salt is limited 16byte as follow code:
if ( strlen (optarg) > 32 ) {
fprintf (stderr, "ERROR: too long value of -s (%s)\n\n", optarg);
usage ();
}
And, genpasswd use crypt and It is commonly used as a crypt below:
char *p = "$1$S/WROitE$Kop9a2nDlNmxCeUivQciP.";
char *o = crypt ("asdf", p);
if ( strcmp (p, o) == 0 )
printf ("OK\n";
else
printf ("Miss matched\n";
So, it doesn't neet to limit length of user define salt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.