Coder Social home page Coder Social logo

genpasswd's People

Contributors

joungkyun avatar

Watchers

 avatar  avatar

genpasswd's Issues

configure pass when crypt library doesn't exists

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 ~]$

can't check password complexity on stdin mode

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]$

remove dependency olibc

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

print help messages when execute without command line options

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]$

add automake test-suites

_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]$

enhanced salt strength

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.