├── debian ├── compat ├── dirs ├── pwgen-udeb.dirs ├── pwgen-udeb.install ├── source │ └── format ├── pwgen.install ├── gbp.conf ├── rules ├── copyright ├── control └── changelog ├── .gitignore ├── configure.ac ├── sha1.h ├── depfix.sed ├── wordwrap.pl ├── pwgen.h ├── randnum.c ├── sha1num.c ├── pw_rand.c ├── Makefile.in ├── pw_phonemes.c ├── pwgen.1 ├── install-sh ├── pwgen.c └── sha1.c /debian/compat: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/sbin 3 | -------------------------------------------------------------------------------- /debian/pwgen-udeb.dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | -------------------------------------------------------------------------------- /debian/pwgen-udeb.install: -------------------------------------------------------------------------------- 1 | /usr/bin 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/pwgen.install: -------------------------------------------------------------------------------- 1 | /usr/bin 2 | /usr/share/man 3 | -------------------------------------------------------------------------------- /debian/gbp.conf: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | pristine-tar = True 3 | upstream-tag='v%(version)s' 4 | debian-branch=debian/master 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | config.cache 3 | config.log 4 | config.status 5 | configure 6 | pwgen 7 | build 8 | autom4te.cache 9 | *.o 10 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT(pwgen.c) 2 | AC_PREREQ(2.50) 3 | AC_PROG_CC 4 | AC_PROG_INSTALL 5 | AC_PATH_PROG(MV, mv, mv) 6 | AC_PATH_PROG(RM, rm, rm) 7 | AC_PATH_PROG(SED, sed, sed) 8 | AC_PATH_PROG(PERL, perl, perl) 9 | AC_CHECK_FUNCS(getopt_long) 10 | AC_CHECK_HEADERS(getopt.h) 11 | AC_OUTPUT(Makefile) 12 | -------------------------------------------------------------------------------- /sha1.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHA1_H 2 | #define _SHA1_H 3 | 4 | #ifndef uint8 5 | #define uint8 unsigned char 6 | #endif 7 | 8 | #ifndef uint32 9 | #define uint32 unsigned long int 10 | #endif 11 | 12 | typedef struct 13 | { 14 | uint32 total[2]; 15 | uint32 state[5]; 16 | uint8 buffer[64]; 17 | } 18 | sha1_context; 19 | 20 | void sha1_starts( sha1_context *ctx ); 21 | void sha1_update( sha1_context *ctx, uint8 *input, uint32 length ); 22 | void sha1_finish( sha1_context *ctx, uint8 digest[20] ); 23 | 24 | #endif /* sha1.h */ 25 | -------------------------------------------------------------------------------- /depfix.sed: -------------------------------------------------------------------------------- 1 | # 2 | # Insert the header..... 3 | # 4 | 1i\ 5 | # +++ Dependency line eater +++\ 6 | # \ 7 | # Makefile dependencies follow. This must be the last section in\ 8 | # the Makefile.in file\ 9 | # 10 | 11 | # 12 | # Remove line continuations.... 13 | # 14 | :FIRST 15 | y/ / / 16 | s/^ *// 17 | /\\$/{ 18 | N 19 | y/ / / 20 | s/\\\n */ / 21 | bFIRST 22 | } 23 | s/ */ /g 24 | 25 | s;/usr/include/[^ ]* *;;g 26 | s;/usr/lib/[^ ]* *;;g 27 | s;/mit/cygnus[^ ]* *;;g 28 | 29 | # 30 | # Now insert a trailing newline... 31 | # 32 | $a\ 33 | 34 | -------------------------------------------------------------------------------- /wordwrap.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # wordwrap.pl --- does word wrap 4 | # 5 | while (<>) { 6 | if (/^#/) { # don't word wrap comments 7 | print; 8 | next; 9 | } 10 | next if (/^$/); # skip blank lines 11 | $linelen = 0; 12 | @words = split; 13 | while (defined($word = shift @words)) { 14 | $word =~ s#\$\(srcdir\)/\.\./version.h#\$\(top_srcdir\)/version.h#; 15 | $word =~ s#\$\(srcdir\)/.\.\/\.\./version.h#\$\(top_srcdir\)/version.h#; 16 | $word =~ s#\$\(srcdir\)/.\.\/et/com_err.h#\$\(top_srcdir\)/lib/et/com_err.h#; 17 | if ($linelen > 0) { 18 | printf(" "); 19 | } 20 | $len = length($word) + 1; 21 | $linelen += $len; 22 | if ($linelen > 78) { 23 | printf("\\\n "); 24 | $linelen = 1+$len; 25 | } 26 | printf("%s", $word); 27 | } 28 | printf("\n"); 29 | } 30 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | #export DH_VERBOSE = 1 3 | 4 | include /usr/share/dpkg/architecture.mk 5 | 6 | #CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) 7 | #CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) 8 | #CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) 9 | #LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) 10 | 11 | # see FEATURE AREAS in dpkg-buildflags(1) 12 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 13 | 14 | # see ENVIRONMENT in dpkg-buildflags(1) 15 | # package maintainers to append CFLAGS 16 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 17 | # package maintainers to append LDFLAGS 18 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 19 | 20 | %: 21 | dh $@ 22 | 23 | override_dh_auto_configure: 24 | ./configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ 25 | --prefix=/usr --mandir=/usr/share/man 26 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: pwgen 3 | Upstream-Contact: tytso@mit.edu 4 | Source: https://github.com/tytso/pwgen 5 | 6 | Files: * 7 | Copyright: 2001, 2002, 2005, 2006, 2014 Theodore Ts'o 8 | License: GPL-2 9 | This program is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License, v2, as 11 | published by the Free Software Foundation 12 | . 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | . 18 | You should have received a copy of the GNU General Public License along 19 | with this program; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21 | . 22 | On Debian systems, the complete text of the GNU General Public 23 | License version 2 can be found in `/usr/share/common-licenses/GPL-2'. 24 | -------------------------------------------------------------------------------- /pwgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pwgen.h --- header file for password generator 3 | * 4 | * Copyright (C) 2001,2002 by Theodore Ts'o 5 | * 6 | * This file may be distributed under the terms of the GNU Public 7 | * License. 8 | */ 9 | 10 | struct pw_element { 11 | const char *str; 12 | int flags; 13 | }; 14 | 15 | /* 16 | * Flags for the pw_element 17 | */ 18 | #define CONSONANT 0x0001 19 | #define VOWEL 0x0002 20 | #define DIPTHONG 0x0004 21 | #define NOT_FIRST 0x0008 22 | 23 | /* 24 | * Flags for the pwgen function 25 | */ 26 | #define PW_DIGITS 0x0001 /* At least one digit */ 27 | #define PW_UPPERS 0x0002 /* At least one upper letter */ 28 | #define PW_SYMBOLS 0x0004 29 | #define PW_AMBIGUOUS 0x0008 30 | #define PW_NO_VOWELS 0x0010 31 | 32 | /* pointer to choose between random or sha1 pseudo random number generator */ 33 | extern int (*pw_number)(int max_num); 34 | 35 | extern const char *pw_symbols; 36 | extern const char *pw_ambiguous; 37 | 38 | /* Function prototypes */ 39 | 40 | /* pw_phonemes.c */ 41 | extern void pw_phonemes(char *buf, int size, int pw_flags, char *remove); 42 | 43 | /* pw_rand.c */ 44 | extern void pw_rand(char *buf, int size, int pw_flags, char *remove); 45 | 46 | /* randnum.c */ 47 | extern int pw_random_number(int max_num); 48 | 49 | /* sha1num.c */ 50 | extern void pw_sha1_init(char *sha1); 51 | extern int pw_sha1_number(int max_num); 52 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: pwgen 2 | Section: admin 3 | Priority: optional 4 | Build-Depends: debhelper (>= 12) 5 | Maintainer: Theodore Y. Ts'o 6 | Standards-Version: 4.4.0 7 | Homepage: https://github.com/tytso/pwgen 8 | Vcs-Browser: https://github.com/tytso/pwgen 9 | Vcs-Git: https://github.com/tytso/pwgen.git 10 | 11 | Package: pwgen 12 | Architecture: any 13 | Multi-Arch: foreign 14 | Depends: ${shlibs:Depends}, ${misc:Depends} 15 | Description: Automatic Password generation 16 | pwgen generates random, meaningless but pronounceable passwords. 17 | These passwords contain either only lowercase letters, or upper 18 | and lower case mixed, or digits thrown in. 19 | Uppercase letters and digits are placed in a way that eases 20 | remembering their position when memorizing only the word. 21 | 22 | Package: pwgen-udeb 23 | Architecture: any 24 | Multi-Arch: foreign 25 | Depends: ${shlibs:Depends}, ${misc:Depends} 26 | Section: debian-installer 27 | XC-Package-Type: udeb 28 | Description: Automatic Password generation 29 | pwgen generates random, meaningless but pronounceable passwords. 30 | These passwords contain either only lowercase letters, or upper 31 | and lower case mixed, or digits thrown in. 32 | Uppercase letters and digits are placed in a way that eases 33 | remembering their position when memorizing only the word. 34 | . 35 | pwgen-udeb is a minimal package used by debian-installer. 36 | 37 | -------------------------------------------------------------------------------- /randnum.c: -------------------------------------------------------------------------------- 1 | /* 2 | * randnum.c -- generate (good) randum numbers. 3 | * 4 | * Copyright (C) 2001,2002 by Theodore Ts'o 5 | * 6 | * This file may be distributed under the terms of the GNU Public 7 | * License. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include "pwgen.h" 20 | 21 | static int get_random_fd(void); 22 | 23 | static int get_random_fd() 24 | { 25 | static int fd = -2; 26 | 27 | if (fd == -2) { 28 | fd = open("/dev/urandom", O_RDONLY); 29 | if (fd == -1) 30 | fd = open("/dev/random", O_RDONLY | O_NONBLOCK); 31 | } 32 | return fd; 33 | } 34 | 35 | /* 36 | * Generate a random number n, where 0 <= n < max_num, using 37 | * /dev/urandom if possible. 38 | */ 39 | int pw_random_number(max_num) 40 | int max_num; 41 | { 42 | unsigned int rand_num; 43 | int i, fd = get_random_fd(); 44 | int lose_counter = 0, nbytes = sizeof(rand_num); 45 | char *cp = (char *) &rand_num; 46 | 47 | if (fd >= 0) { 48 | while (nbytes > 0) { 49 | i = read(fd, cp, nbytes); 50 | if ((i < 0) && 51 | ((errno == EINTR) || (errno == EAGAIN))) 52 | continue; 53 | if (i <= 0) { 54 | if (lose_counter++ == 8) 55 | break; 56 | continue; 57 | } 58 | nbytes -= i; 59 | cp += i; 60 | lose_counter = 0; 61 | } 62 | } 63 | if (nbytes == 0) 64 | return (rand_num % max_num); 65 | 66 | /* We weren't able to use /dev/random, fail hard */ 67 | 68 | fprintf(stderr, "No entropy available!\n"); 69 | exit(1); 70 | } 71 | -------------------------------------------------------------------------------- /sha1num.c: -------------------------------------------------------------------------------- 1 | /* 2 | * sha1num.c --- generate sha1 hash based, pseudo random numbers 3 | * 4 | * Copyright (C) 2005 by Olivier Guerrier 5 | * 6 | * This file may be distributed under the terms of the GNU Public 7 | * License. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include "pwgen.h" 14 | #include "sha1.h" 15 | 16 | sha1_context sha1_ctx; 17 | char *sha1_seed; 18 | const char *sha1_magic="pwgen"; 19 | unsigned char sha1sum[20]; 20 | int sha1sum_idx=20; 21 | 22 | void pw_sha1_init(char *sha1) 23 | { 24 | int i = 0; 25 | char *seed; 26 | FILE *f; 27 | unsigned char buf[1024]; 28 | 29 | if ((seed = strchr(sha1,'#'))) { 30 | *(seed++) = 0; 31 | sha1_seed = malloc(strlen(seed)+1); 32 | if (!sha1_seed) { 33 | fprintf(stderr, "Couldn't malloc sha1_seed buffer.\n"); 34 | exit(1); 35 | } 36 | strcpy(sha1_seed, seed); 37 | } 38 | else { 39 | sha1_seed = malloc(strlen(sha1_magic)+1); 40 | if (!sha1_seed) { 41 | fprintf(stderr, "Couldn't malloc sha1_seed buffer.\n"); 42 | exit(1); 43 | } 44 | strcpy(sha1_seed, sha1_magic); 45 | } 46 | 47 | if( ! ( f = fopen( sha1, "rb" ) ) ) { 48 | fprintf(stderr, "Couldn't open file: %s.\n", sha1); 49 | exit(1); 50 | } 51 | 52 | sha1_starts( &sha1_ctx ); 53 | while( ( i = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) { 54 | sha1_update( &sha1_ctx, buf, i ); 55 | } 56 | 57 | fclose(f); 58 | 59 | return; 60 | } 61 | 62 | 63 | int pw_sha1_number(int max_num) 64 | { 65 | int val; 66 | sha1_context ctx; 67 | 68 | if (sha1sum_idx>19) { 69 | sha1sum_idx = 0; 70 | sha1_update(&sha1_ctx, (unsigned char *) sha1_seed, 71 | strlen(sha1_seed)); 72 | ctx = sha1_ctx; 73 | sha1_finish(&ctx, sha1sum ); 74 | } 75 | val = (int) (sha1sum[sha1sum_idx++] / ((float) 256) * max_num); 76 | return (val); 77 | } 78 | -------------------------------------------------------------------------------- /pw_rand.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pw_rand.c --- generate completely random (and hard to remember) 3 | * passwords 4 | * 5 | * Copyright (C) 2001,2002 by Theodore Ts'o 6 | * 7 | * This file may be distributed under the terms of the GNU Public 8 | * License. 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | #include "pwgen.h" 15 | 16 | const char *pw_digits = "0123456789"; 17 | const char *pw_uppers = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 18 | const char *pw_lowers = "abcdefghijklmnopqrstuvwxyz"; 19 | const char *pw_symbols = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; 20 | const char *pw_ambiguous = "B8G6I1l0OQDS5Z2"; 21 | const char *pw_vowels = "01aeiouyAEIOUY"; 22 | 23 | static void remove_chars(char *buf, const char *remove) 24 | { 25 | const char *cp; 26 | 27 | if (!remove) 28 | return; 29 | for (cp = remove; *cp; cp++) { 30 | char *r = strchr(buf, *cp); 31 | 32 | if (r == NULL) 33 | continue; 34 | memmove(r, r+1, strlen(r)); 35 | } 36 | } 37 | 38 | static int find_chars(char *buf, const char *set) 39 | { 40 | const char *cp; 41 | 42 | for (cp = set; *cp; cp++) 43 | if (strchr(buf, *cp)) 44 | return 1; 45 | return 0; 46 | } 47 | 48 | void pw_rand(char *buf, int size, int pw_flags, char *remove) 49 | { 50 | char ch, *chars, *wchars; 51 | int i, len, feature_flags; 52 | 53 | len = 0; 54 | if (pw_flags & PW_DIGITS) { 55 | len += strlen(pw_digits); 56 | } 57 | if (pw_flags & PW_UPPERS) { 58 | len += strlen(pw_uppers); 59 | } 60 | len += strlen(pw_lowers); 61 | if (pw_flags & PW_SYMBOLS) { 62 | len += strlen(pw_symbols); 63 | } 64 | chars = malloc(len+1); 65 | if (!chars) { 66 | fprintf(stderr, "Couldn't malloc pw_rand buffer.\n"); 67 | exit(1); 68 | } 69 | wchars = chars; 70 | if (pw_flags & PW_DIGITS) { 71 | strcpy(wchars, pw_digits); 72 | wchars += strlen(pw_digits); 73 | } 74 | if (pw_flags & PW_UPPERS) { 75 | strcpy(wchars, pw_uppers); 76 | wchars += strlen(pw_uppers); 77 | } 78 | strcpy(wchars, pw_lowers); 79 | wchars += strlen(pw_lowers); 80 | if (pw_flags & PW_SYMBOLS) { 81 | strcpy(wchars, pw_symbols); 82 | } 83 | if (remove) { 84 | if (pw_flags & PW_AMBIGUOUS) 85 | remove_chars(chars, pw_ambiguous); 86 | if (pw_flags & PW_NO_VOWELS) 87 | remove_chars(chars, pw_vowels); 88 | remove_chars(chars, remove); 89 | if ((pw_flags & PW_DIGITS) && 90 | !find_chars(chars, pw_digits)) { 91 | fprintf(stderr, 92 | "Error: No digits left in the valid set\n"); 93 | exit(1); 94 | } 95 | if ((pw_flags & PW_UPPERS) && 96 | !find_chars(chars, pw_uppers)) { 97 | fprintf(stderr, 98 | "Error: No upper case letters left in " 99 | "the valid set\n"); 100 | exit(1); 101 | } 102 | if ((pw_flags & PW_SYMBOLS) && 103 | !find_chars(chars, pw_symbols)) { 104 | fprintf(stderr, 105 | "Error: No symbols left in the valid set\n"); 106 | exit(1); 107 | } 108 | if (chars[0] == '\0') { 109 | fprintf(stderr, 110 | "Error: No characters left in the valid set\n"); 111 | exit(1); 112 | } 113 | } 114 | len = strlen(chars); 115 | try_again: 116 | feature_flags = (size > 2) ? pw_flags : 0; 117 | i = 0; 118 | while (i < size) { 119 | ch = chars[pw_number(len)]; 120 | if ((pw_flags & PW_AMBIGUOUS) && strchr(pw_ambiguous,ch)) 121 | continue; 122 | if ((pw_flags & PW_NO_VOWELS) && strchr(pw_vowels, ch)) 123 | continue; 124 | buf[i++] = ch; 125 | if ((feature_flags & PW_DIGITS) && 126 | strchr(pw_digits, ch)) 127 | feature_flags &= ~PW_DIGITS; 128 | if ((feature_flags & PW_UPPERS) && 129 | strchr(pw_uppers, ch)) 130 | feature_flags &= ~PW_UPPERS; 131 | if ((feature_flags & PW_SYMBOLS) && 132 | strchr(pw_symbols, ch)) 133 | feature_flags &= ~PW_SYMBOLS; 134 | } 135 | if (feature_flags & (PW_UPPERS | PW_DIGITS | PW_SYMBOLS)) 136 | goto try_again; 137 | buf[size] = 0; 138 | free(chars); 139 | return; 140 | } 141 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | PWGEN_VERSION=2.08 2 | 3 | srcdir = @srcdir@ 4 | top_srcdir = @top_srcdir@ 5 | VPATH = @srcdir@ 6 | datarootdir = @datarootdir@ 7 | top_builddir = . 8 | my_dir = . 9 | prefix = @prefix@ 10 | mandir = @mandir@ 11 | INSTALL = @INSTALL@ 12 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 13 | INSTALL_DATA = @INSTALL_DATA@ 14 | 15 | WALL_OPTS = -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \ 16 | -Wshadow -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align \ 17 | -pedantic 18 | CC = @CC@ 19 | DEFS = @DEFS@ 20 | CFLAGS = @CFLAGS@ $(WALL_OPTS) 21 | CPPFLAGS = @CPPFLAGS@ 22 | ALL_CFLAGS = $(CPPFLAGS) $(DEFS) $(USE_WFLAGS) $(CFLAGS) $(XTRA_CFLAGS) 23 | LDFLAGS = @LDFLAGS@ 24 | RM = @RM@ 25 | MV = @MV@ 26 | SED = @SED@ 27 | PERL = @PERL@ 28 | TAR = tar 29 | 30 | all:: pwgen 31 | 32 | .c.o: 33 | $(CC) -c $(ALL_CFLAGS) $< -o $@ 34 | 35 | OBJS= pwgen.o \ 36 | pw_phonemes.o \ 37 | pw_rand.o \ 38 | randnum.o \ 39 | sha1.o \ 40 | sha1num.o 41 | 42 | SRCS= $(srcdir)/pwgen.c \ 43 | $(srcdir)/pw_phonemes.c \ 44 | $(srcdir)/pw_rand.c \ 45 | $(srcdir)/randnum.c \ 46 | $(srcdir)/sha1.c \ 47 | $(srcdir)/sha1num.c 48 | 49 | 50 | pwgen: $(OBJS) 51 | $(CC) $(LDFLAGS) -o pwgen $(OBJS) 52 | 53 | install: pwgen pwgen.1 54 | mkdir -p $(DESTDIR)$(prefix)/bin $(DESTDIR)$(mandir)/man1 55 | $(INSTALL_PROGRAM) pwgen $(DESTDIR)$(prefix)/bin/pwgen 56 | $(INSTALL_DATA) $(srcdir)/pwgen.1 $(DESTDIR)$(mandir)/man1/pwgen.1 57 | 58 | clean: 59 | $(RM) -f $(OBJS) pwgen *~ 60 | 61 | distclean: clean 62 | $(RM) -rf config.status config.log config.cache Makefile \ 63 | $(srcdir)/Makefile.in.old $(srcdir)/.exclude-file \ 64 | $(srcdir)/autom4te.cache 65 | 66 | # 67 | # Build source tar ball... 68 | # 69 | 70 | SRCROOT = pwgen-$(PWGEN_VERSION) 71 | 72 | $(srcdir)/.exclude-file: 73 | a=$(SRCROOT); \ 74 | (cd $(srcdir) && find . \( -name \*~ -o -name \*.orig \ 75 | -o -name .git -o -name \*.rej \ 76 | -o -name TAGS -o -name \*.old -o -name \*.gmo \ 77 | -o -name config.log -o -name config.cache \ 78 | -o -name config.status -o -name Makefile \ 79 | -o -name build -o -name autom4te.cache \ 80 | -o -name changed-files -o -name .#\* \) \ 81 | -print) | sed -e "s/^./$$a/" > $(srcdir)/.exclude-file 82 | echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file 83 | >> $(srcdir)/.exclude-file 84 | 85 | source_tar_file: $(srcdir)/.exclude-file 86 | cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf pwgen $$a ; \ 87 | $(TAR) -c -h -v -f - \ 88 | -X $$a/.exclude-file $$a | \ 89 | gzip -9 > pwgen-$(PWGEN_VERSION).tar.gz 90 | rm -f $(srcdir)/.exclude-file $(srcdir)/../$(SRCROOT) 91 | # 92 | # Autoconf magic... 93 | # 94 | 95 | $(top_builddir)/config.status: $(top_srcdir)/configure 96 | cd $(top_builddir); ./config.status --recheck 97 | 98 | Makefile: $(srcdir)/Makefile.in $(DEP_MAKEFILE) $(top_builddir)/config.status 99 | cd $(top_builddir); CONFIG_FILES=$(my_dir)/Makefile ./config.status 100 | 101 | $(top_srcdir)/configure: $(top_srcdir)/configure.ac 102 | cd $(top_srcdir) && autoconf 103 | 104 | # 105 | # Make depend magic... 106 | # 107 | 108 | .depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl 109 | if test -n "$(SRCS)" ; then \ 110 | $(CC) -M $(ALL_CFLAGS) $(SRCS) | \ 111 | $(SED) -f $(top_srcdir)/depfix.sed \ 112 | -e 's; $(srcdir)/; $$(srcdir)/;g' \ 113 | -e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \ 114 | -e 's; $(top_builddir)/; $$(top_builddir)/;g' \ 115 | -e 's; \./; ;g' \ 116 | -e '/^ *\\$$/d' | \ 117 | $(PERL) $(top_srcdir)/wordwrap.pl > .depend; \ 118 | else :; fi 119 | 120 | depend:: .depend 121 | if test -n "$(SRCS)" ; then \ 122 | sed -e '/^# +++ Dependency line eater +++/,$$d' \ 123 | < $(srcdir)/Makefile.in | cat - .depend \ 124 | > $(srcdir)/Makefile.in.new; \ 125 | if cmp -s $(srcdir)/Makefile.in $(srcdir)/Makefile.in.new ; then \ 126 | $(RM) $(srcdir)/Makefile.in.new ; \ 127 | else \ 128 | $(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \ 129 | $(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \ 130 | fi ; else :; fi 131 | 132 | # +++ Dependency line eater +++ 133 | # 134 | # Makefile dependencies follow. This must be the last section in 135 | # the Makefile.in file 136 | # 137 | pwgen.o: $(srcdir)/pwgen.c $(srcdir)/pwgen.h 138 | pw_phonemes.o: $(srcdir)/pw_phonemes.c $(srcdir)/pwgen.h 139 | pw_rand.o: $(srcdir)/pw_rand.c $(srcdir)/pwgen.h 140 | randnum.o: $(srcdir)/randnum.c $(srcdir)/pwgen.h 141 | sha1.o: $(srcdir)/sha1.c $(srcdir)/sha1.h 142 | sha1num.o: $(srcdir)/sha1num.c $(srcdir)/pwgen.h $(srcdir)/sha1.h 143 | -------------------------------------------------------------------------------- /pw_phonemes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pw_phonemes.c --- generate secure passwords using phoneme rules 3 | * 4 | * Copyright (C) 2001,2002 by Theodore Ts'o 5 | * 6 | * This file may be distributed under the terms of the GNU Public 7 | * License. 8 | */ 9 | 10 | #include 11 | #include 12 | #include "pwgen.h" 13 | 14 | struct pw_element elements[] = { 15 | { "a", VOWEL }, 16 | { "ae", VOWEL | DIPTHONG }, 17 | { "ah", VOWEL | DIPTHONG }, 18 | { "ai", VOWEL | DIPTHONG }, 19 | { "b", CONSONANT }, 20 | { "c", CONSONANT }, 21 | { "ch", CONSONANT | DIPTHONG }, 22 | { "d", CONSONANT }, 23 | { "e", VOWEL }, 24 | { "ee", VOWEL | DIPTHONG }, 25 | { "ei", VOWEL | DIPTHONG }, 26 | { "f", CONSONANT }, 27 | { "g", CONSONANT }, 28 | { "gh", CONSONANT | DIPTHONG | NOT_FIRST }, 29 | { "h", CONSONANT }, 30 | { "i", VOWEL }, 31 | { "ie", VOWEL | DIPTHONG }, 32 | { "j", CONSONANT }, 33 | { "k", CONSONANT }, 34 | { "l", CONSONANT }, 35 | { "m", CONSONANT }, 36 | { "n", CONSONANT }, 37 | { "ng", CONSONANT | DIPTHONG | NOT_FIRST }, 38 | { "o", VOWEL }, 39 | { "oh", VOWEL | DIPTHONG }, 40 | { "oo", VOWEL | DIPTHONG}, 41 | { "p", CONSONANT }, 42 | { "ph", CONSONANT | DIPTHONG }, 43 | { "qu", CONSONANT | DIPTHONG}, 44 | { "r", CONSONANT }, 45 | { "s", CONSONANT }, 46 | { "sh", CONSONANT | DIPTHONG}, 47 | { "t", CONSONANT }, 48 | { "th", CONSONANT | DIPTHONG}, 49 | { "u", VOWEL }, 50 | { "v", CONSONANT }, 51 | { "w", CONSONANT }, 52 | { "x", CONSONANT }, 53 | { "y", CONSONANT }, 54 | { "z", CONSONANT } 55 | }; 56 | 57 | #define NUM_ELEMENTS (sizeof(elements) / sizeof (struct pw_element)) 58 | 59 | void pw_phonemes(char *buf, int size, int pw_flags, char *remove) 60 | { 61 | int c, i, len, flags, feature_flags; 62 | int prev, should_be, first; 63 | const char *str; 64 | char ch, *cp; 65 | 66 | try_again: 67 | feature_flags = pw_flags; 68 | c = 0; 69 | prev = 0; 70 | should_be = 0; 71 | first = 1; 72 | 73 | should_be = pw_number(2) ? VOWEL : CONSONANT; 74 | 75 | while (c < size) { 76 | i = pw_number(NUM_ELEMENTS); 77 | str = elements[i].str; 78 | len = strlen(str); 79 | flags = elements[i].flags; 80 | /* Filter on the basic type of the next element */ 81 | if ((flags & should_be) == 0) 82 | continue; 83 | /* Handle the NOT_FIRST flag */ 84 | if (first && (flags & NOT_FIRST)) 85 | continue; 86 | /* Don't allow VOWEL followed a Vowel/Dipthong pair */ 87 | if ((prev & VOWEL) && (flags & VOWEL) && 88 | (flags & DIPTHONG)) 89 | continue; 90 | /* Don't allow us to overflow the buffer */ 91 | if (len > size-c) 92 | continue; 93 | 94 | /* 95 | * OK, we found an element which matches our criteria, 96 | * let's do it! 97 | */ 98 | strcpy(buf+c, str); 99 | 100 | /* Handle PW_UPPERS */ 101 | if (pw_flags & PW_UPPERS) { 102 | if ((first || flags & CONSONANT) && 103 | (pw_number(10) < 2)) { 104 | buf[c] = toupper(buf[c]); 105 | feature_flags &= ~PW_UPPERS; 106 | } 107 | } 108 | 109 | /* Handle the AMBIGUOUS flag */ 110 | if (pw_flags & PW_AMBIGUOUS) { 111 | buf[c+len] = '\0'; /* To make strpbrk() happy */ 112 | cp = strpbrk(buf, pw_ambiguous); 113 | if (cp) 114 | goto try_again; 115 | } 116 | 117 | c += len; 118 | 119 | /* Time to stop? */ 120 | if (c >= size) 121 | break; 122 | 123 | /* 124 | * Handle PW_DIGITS 125 | */ 126 | if (pw_flags & PW_DIGITS) { 127 | if (!first && (pw_number(10) < 3)) { 128 | do { 129 | ch = pw_number(10)+'0'; 130 | } while ((pw_flags & PW_AMBIGUOUS) 131 | && strchr(pw_ambiguous, ch)); 132 | buf[c++] = ch; 133 | buf[c] = 0; 134 | feature_flags &= ~PW_DIGITS; 135 | 136 | first = 1; 137 | prev = 0; 138 | should_be = pw_number(2) ? 139 | VOWEL : CONSONANT; 140 | continue; 141 | } 142 | } 143 | 144 | /* Handle PW_SYMBOLS */ 145 | if (pw_flags & PW_SYMBOLS) { 146 | if (!first && (pw_number(10) < 2)) { 147 | do { 148 | ch = pw_symbols[ 149 | pw_number(strlen(pw_symbols))]; 150 | } while ((pw_flags & PW_AMBIGUOUS) 151 | && strchr(pw_ambiguous, ch)); 152 | buf[c++] = ch; 153 | buf[c] = 0; 154 | feature_flags &= ~PW_SYMBOLS; 155 | } 156 | } 157 | 158 | /* 159 | * OK, figure out what the next element should be 160 | */ 161 | if (should_be == CONSONANT) { 162 | should_be = VOWEL; 163 | } else { /* should_be == VOWEL */ 164 | if ((prev & VOWEL) || 165 | (flags & DIPTHONG) || 166 | (pw_number(10) > 3)) 167 | should_be = CONSONANT; 168 | else 169 | should_be = VOWEL; 170 | } 171 | prev = flags; 172 | first = 0; 173 | } 174 | if (feature_flags & (PW_UPPERS | PW_DIGITS | PW_SYMBOLS)) 175 | goto try_again; 176 | } 177 | -------------------------------------------------------------------------------- /pwgen.1: -------------------------------------------------------------------------------- 1 | .TH PWGEN 1 "August 2017" "pwgen version 2.08" 2 | .SH NAME 3 | pwgen \- generate pronounceable passwords 4 | .SH SYNOPSIS 5 | .B pwgen 6 | [ 7 | .I OPTION 8 | ] 9 | [ 10 | .I pw_length 11 | ] 12 | [ 13 | .I num_pw 14 | ] 15 | .SH DESCRIPTION 16 | The 17 | .B pwgen 18 | program generates passwords which are designed to be easily memorized by 19 | humans, while being as secure as possible. Human-memorable passwords 20 | are never going to be as secure as completely random 21 | passwords. In particular, passwords generated by 22 | .B pwgen 23 | without the 24 | .B \-s 25 | option should not be used in places where the password could be attacked 26 | via an off-line brute-force attack. On the other hand, completely 27 | randomly generated passwords have a tendency to be written down, 28 | and are subject to being compromised in that fashion. 29 | .PP 30 | The 31 | .B pwgen 32 | program is designed 33 | to be used both interactively, and in shell scripts. Hence, 34 | its default behavior differs depending on whether the standard output 35 | is a tty device or a pipe to another program. Used interactively, 36 | .B pwgen 37 | will display a screenful of passwords, allowing the user to pick a single 38 | password, and then quickly erase the screen. This prevents someone from 39 | being able to "shoulder surf" the user's chosen password. 40 | .PP 41 | When standard output (stdout) is not a tty, 42 | .B pwgen 43 | will only generate one password, as this tends to be much more convenient 44 | for shell scripts, and in order to be 45 | compatible with previous versions of this program. 46 | .B 47 | .SH OPTIONS 48 | .TP 49 | .B \-0, \--no-numerals 50 | Don't include numbers in the generated passwords. 51 | .TP 52 | .B \-1 53 | Print the generated passwords one per line. 54 | .TP 55 | .B \-A, \--no-capitalize 56 | Don't bother to include any capital letters in the generated passwords. 57 | .TP 58 | .B \-a, --alt-phonics 59 | This option doesn't do anything special; it is present only for 60 | backwards compatibility. 61 | .TP 62 | .B \-B, --ambiguous 63 | Don't use characters that could be confused by the user when printed, 64 | such as 'l' and '1', or '0' or 'O'. This reduces the number of possible 65 | passwords significantly, and as such reduces the quality of the 66 | passwords. It may be useful for users who have bad vision, but in 67 | general use of this option is not recommended. 68 | .TP 69 | .B \-c, --capitalize 70 | Include at least one capital letter in the password. This is the default 71 | if the standard output is a tty device. 72 | .TP 73 | .B \-C 74 | Print the generated passwords in columns. This is the default if the 75 | standard output is a tty device. 76 | .TP 77 | .B \-N, --num-passwords=\fInum 78 | Generate 79 | .I num 80 | passwords. This defaults to a screenful if passwords are 81 | printed by columns, and one password otherwise. 82 | .TP 83 | .B \-n, --numerals 84 | Include at least one number in the password. This is the default 85 | if the standard output is a tty device. 86 | .TP 87 | .B \-H, --sha1=\fI/path/to/file[#seed] 88 | Will use the sha1's hash of given file and the optional seed to create 89 | password. It will allow you to compute the same password later, 90 | if you remember the file, seed, and pwgen's options used. 91 | ie: pwgen -H ~/your_favorite.mp3#your@email.com gives 92 | a list of possibles passwords for your pop3 account, and you can 93 | ask this list again and again. 94 | .IP 95 | .B WARNING: 96 | The passwords generated using this option are not very random. If you use 97 | this option, make sure the attacker can not obtain a copy of the file. 98 | Also, note that the name of the file may be easily available from the 99 | ~/.history or ~/.bash_history file. 100 | .TP 101 | .B \-h, --help 102 | Print a help message. 103 | .TP 104 | .B \-r \fIchars\fR, \fB--remove-chars=\fIchars 105 | Don't use the specified characters in password. This option will 106 | disable the phomeme-based generator and uses the random password 107 | generator. 108 | .TP 109 | .B \-s, --secure 110 | Generate completely random, hard-to-memorize passwords. These should 111 | only be used for machine passwords, since otherwise it's almost 112 | guaranteed that users will simply write the password on a piece of 113 | paper taped to the monitor... 114 | .TP 115 | .B \-v, --no-vowels 116 | Generate random passwords that do not contain vowels or numbers that 117 | might be mistaken for vowels. It provides less secure passwords to 118 | allow system administrators to not have to worry with random passwords 119 | accidentally contain offensive substrings. 120 | .TP 121 | .B \-y, --symbols 122 | Include at least one special character in the password. 123 | .SH AUTHOR 124 | This version of 125 | .B pwgen 126 | was written by Theodore Ts'o . 127 | It is modelled after a program 128 | originally written by Brandon S. Allbery, and then 129 | later extensively modified by Olaf Titz, Jim Lynch, and others. 130 | It was rewritten from scratch by Theodore Ts'o because the original program 131 | was somewhat of a hack, and thus hard to maintain, and because 132 | the licensing status of the program was unclear. 133 | .SH SEE ALSO 134 | .BR passwd (1) 135 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5. 5 | # 6 | # Calling this script install-sh is preferred over install.sh, to prevent 7 | # `make' implicit rules from creating a file called install from it 8 | # when there is no Makefile. 9 | # 10 | # This script is compatible with the BSD install script, but was written 11 | # from scratch. 12 | # 13 | 14 | 15 | # set DOITPROG to echo to test this script 16 | 17 | # Don't use :- since 4.3BSD and earlier shells don't like it. 18 | doit="${DOITPROG-}" 19 | 20 | 21 | # put in absolute paths if you don't have them in your path; or use env. vars. 22 | 23 | mvprog="${MVPROG-mv}" 24 | cpprog="${CPPROG-cp}" 25 | chmodprog="${CHMODPROG-chmod}" 26 | chownprog="${CHOWNPROG-chown}" 27 | chgrpprog="${CHGRPPROG-chgrp}" 28 | stripprog="${STRIPPROG-strip}" 29 | rmprog="${RMPROG-rm}" 30 | mkdirprog="${MKDIRPROG-mkdir}" 31 | 32 | tranformbasename="" 33 | transform_arg="" 34 | instcmd="$mvprog" 35 | chmodcmd="$chmodprog 0755" 36 | chowncmd="" 37 | chgrpcmd="" 38 | stripcmd="" 39 | rmcmd="$rmprog -f" 40 | mvcmd="$mvprog" 41 | src="" 42 | dst="" 43 | dir_arg="" 44 | 45 | while [ x"$1" != x ]; do 46 | case $1 in 47 | -c) instcmd="$cpprog" 48 | shift 49 | continue;; 50 | 51 | -d) dir_arg=true 52 | shift 53 | continue;; 54 | 55 | -m) chmodcmd="$chmodprog $2" 56 | shift 57 | shift 58 | continue;; 59 | 60 | -o) chowncmd="$chownprog $2" 61 | shift 62 | shift 63 | continue;; 64 | 65 | -g) chgrpcmd="$chgrpprog $2" 66 | shift 67 | shift 68 | continue;; 69 | 70 | -s) stripcmd="$stripprog" 71 | shift 72 | continue;; 73 | 74 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 75 | shift 76 | continue;; 77 | 78 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 79 | shift 80 | continue;; 81 | 82 | *) if [ x"$src" = x ] 83 | then 84 | src=$1 85 | else 86 | # this colon is to work around a 386BSD /bin/sh bug 87 | : 88 | dst=$1 89 | fi 90 | shift 91 | continue;; 92 | esac 93 | done 94 | 95 | if [ x"$src" = x ] 96 | then 97 | echo "install: no input file specified" 98 | exit 1 99 | else 100 | true 101 | fi 102 | 103 | if [ x"$dir_arg" != x ]; then 104 | dst=$src 105 | src="" 106 | 107 | if [ -d $dst ]; then 108 | instcmd=: 109 | else 110 | instcmd=mkdir 111 | fi 112 | else 113 | 114 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 115 | # might cause directories to be created, which would be especially bad 116 | # if $src (and thus $dsttmp) contains '*'. 117 | 118 | if [ -f $src -o -d $src ] 119 | then 120 | true 121 | else 122 | echo "install: $src does not exist" 123 | exit 1 124 | fi 125 | 126 | if [ x"$dst" = x ] 127 | then 128 | echo "install: no destination specified" 129 | exit 1 130 | else 131 | true 132 | fi 133 | 134 | # If destination is a directory, append the input filename; if your system 135 | # does not like double slashes in filenames, you may need to add some logic 136 | 137 | if [ -d $dst ] 138 | then 139 | dst="$dst"/`basename $src` 140 | else 141 | true 142 | fi 143 | fi 144 | 145 | ## this sed command emulates the dirname command 146 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 147 | 148 | # Make sure that the destination directory exists. 149 | # this part is taken from Noah Friedman's mkinstalldirs script 150 | 151 | # Skip lots of stat calls in the usual case. 152 | if [ ! -d "$dstdir" ]; then 153 | defaultIFS=' 154 | ' 155 | IFS="${IFS-${defaultIFS}}" 156 | 157 | oIFS="${IFS}" 158 | # Some sh's can't handle IFS=/ for some reason. 159 | IFS='%' 160 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 161 | IFS="${oIFS}" 162 | 163 | pathcomp='' 164 | 165 | while [ $# -ne 0 ] ; do 166 | pathcomp="${pathcomp}${1}" 167 | shift 168 | 169 | if [ ! -d "${pathcomp}" ] ; 170 | then 171 | $mkdirprog "${pathcomp}" 172 | else 173 | true 174 | fi 175 | 176 | pathcomp="${pathcomp}/" 177 | done 178 | fi 179 | 180 | if [ x"$dir_arg" != x ] 181 | then 182 | $doit $instcmd $dst && 183 | 184 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && 185 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && 186 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && 187 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi 188 | else 189 | 190 | # If we're going to rename the final executable, determine the name now. 191 | 192 | if [ x"$transformarg" = x ] 193 | then 194 | dstfile=`basename $dst` 195 | else 196 | dstfile=`basename $dst $transformbasename | 197 | sed $transformarg`$transformbasename 198 | fi 199 | 200 | # don't allow the sed command to completely eliminate the filename 201 | 202 | if [ x"$dstfile" = x ] 203 | then 204 | dstfile=`basename $dst` 205 | else 206 | true 207 | fi 208 | 209 | # Make a temp file name in the proper directory. 210 | 211 | dsttmp=$dstdir/#inst.$$# 212 | 213 | # Move or copy the file name to the temp name 214 | 215 | $doit $instcmd $src $dsttmp && 216 | 217 | trap "rm -f ${dsttmp}" 0 && 218 | 219 | # and set any options; do chmod last to preserve setuid bits 220 | 221 | # If any of these fail, we abort the whole thing. If we want to 222 | # ignore errors from any of these, just make sure not to ignore 223 | # errors from the above "$doit $instcmd $src $dsttmp" command. 224 | 225 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && 226 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && 227 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && 228 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && 229 | 230 | # Now rename the file to the real destination. 231 | 232 | $doit $rmcmd -f $dstdir/$dstfile && 233 | $doit $mvcmd $dsttmp $dstdir/$dstfile 234 | 235 | fi && 236 | 237 | 238 | exit 0 239 | -------------------------------------------------------------------------------- /pwgen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pwgen.c --- generate secure passwords 3 | * 4 | * Copyright (C) 2001,2002 by Theodore Ts'o 5 | * 6 | * This file may be distributed under the terms of the GNU Public 7 | * License. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #ifdef HAVE_GETOPT_H 16 | #include 17 | #endif 18 | 19 | #include "pwgen.h" 20 | 21 | /* Globals variables */ 22 | int (*pw_number)(int max_num); 23 | 24 | /* Program parameters set via getopt */ 25 | 26 | int pw_length = 8; 27 | int num_pw = -1; 28 | int pwgen_flags = 0; 29 | int do_columns = 0; 30 | 31 | #ifdef HAVE_GETOPT_LONG 32 | struct option pwgen_options[] = { 33 | { "alt-phonics", no_argument, 0, 'a' }, 34 | { "capitalize", no_argument, 0, 'c' }, 35 | { "numerals", no_argument, 0, 'n'}, 36 | { "symbols", no_argument, 0, 'y'}, 37 | { "num-passwords", required_argument, 0, 'N'}, 38 | { "remove-chars", required_argument, 0, 'r' }, 39 | { "secure", no_argument, 0, 's' }, 40 | { "help", no_argument, 0, 'h'}, 41 | { "no-numerals", no_argument, 0, '0' }, 42 | { "no-capitalize", no_argument, 0, 'A' }, 43 | { "sha1", required_argument, 0, 'H' }, 44 | { "ambiguous", no_argument, 0, 'B' }, 45 | { "no-vowels", no_argument, 0, 'v' }, 46 | { 0, 0, 0, 0} 47 | }; 48 | #endif 49 | 50 | const char *pw_options = "01AaBCcnN:sr:hH:vy"; 51 | 52 | static void usage(void) 53 | { 54 | fputs("Usage: pwgen [ OPTIONS ] [ pw_length ] [ num_pw ]\n\n", stderr); 55 | fputs("Options supported by pwgen:\n", stderr); 56 | fputs(" -c or --capitalize\n", stderr); 57 | fputs("\tInclude at least one capital letter in the password\n", 58 | stderr); 59 | fputs(" -A or --no-capitalize\n", stderr); 60 | fputs("\tDon't include capital letters in the password\n", 61 | stderr); 62 | fputs(" -n or --numerals\n", stderr); 63 | fputs("\tInclude at least one number in the password\n", stderr); 64 | fputs(" -0 or --no-numerals\n", stderr); 65 | fputs("\tDon't include numbers in the password\n", 66 | stderr); 67 | fputs(" -y or --symbols\n", stderr); 68 | fputs("\tInclude at least one special symbol in the password\n", 69 | stderr); 70 | fputs(" -r or --remove-chars=\n", stderr); 71 | fputs("\tRemove characters from the set of characters to " 72 | "generate passwords\n", stderr); 73 | fputs(" -s or --secure\n", stderr); 74 | fputs("\tGenerate completely random passwords\n", stderr); 75 | fputs(" -B or --ambiguous\n", stderr); 76 | fputs("\tDon't include ambiguous characters in the password\n", 77 | stderr); 78 | fputs(" -h or --help\n", stderr); 79 | fputs("\tPrint a help message\n", stderr); 80 | fputs(" -H or --sha1=path/to/file[#seed]\n", stderr); 81 | fputs("\tUse sha1 hash of given file as a (not so) random generator\n", 82 | stderr); 83 | fputs(" -C\n\tPrint the generated passwords in columns\n", stderr); 84 | fputs(" -1\n\tDon't print the generated passwords in columns\n", 85 | stderr); 86 | fputs(" -v or --no-vowels\n", stderr); 87 | fputs("\tDo not use any vowels so as to avoid accidental nasty words\n", 88 | stderr); 89 | exit(1); 90 | } 91 | 92 | 93 | int main(int argc, char **argv) 94 | { 95 | int term_width = 80; 96 | int c, i; 97 | int num_cols = -1; 98 | char *buf, *tmp; 99 | char *remove=NULL; 100 | void (*pwgen)(char *inbuf, int size, int pw_flags, char *remove); 101 | 102 | pwgen = pw_phonemes; 103 | pw_number = pw_random_number; 104 | if (isatty(1)) 105 | do_columns = 1; 106 | pwgen_flags |= PW_DIGITS | PW_UPPERS; 107 | 108 | while (1) { 109 | #ifdef HAVE_GETOPT_LONG 110 | c = getopt_long(argc, argv, pw_options, pwgen_options, 0); 111 | #else 112 | c = getopt(argc, argv, pw_options); 113 | #endif 114 | if (c == -1) 115 | break; 116 | switch (c) { 117 | case '0': 118 | pwgen_flags &= ~PW_DIGITS; 119 | break; 120 | case 'A': 121 | pwgen_flags &= ~PW_UPPERS; 122 | break; 123 | case 'a': 124 | break; 125 | case 'B': 126 | pwgen_flags |= PW_AMBIGUOUS; 127 | break; 128 | case 'c': 129 | pwgen_flags |= PW_UPPERS; 130 | break; 131 | case 'n': 132 | pwgen_flags |= PW_DIGITS; 133 | break; 134 | case 'N': 135 | num_pw = strtol(optarg, &tmp, 0); 136 | if (*tmp) { 137 | fprintf(stderr, 138 | "Invalid number of passwords: %s\n", 139 | optarg); 140 | exit(1); 141 | } 142 | break; 143 | case 's': 144 | pwgen = pw_rand; 145 | break; 146 | case 'C': 147 | do_columns = 1; 148 | break; 149 | case '1': 150 | do_columns = 0; 151 | break; 152 | case 'H': 153 | pw_sha1_init(optarg); 154 | pw_number = pw_sha1_number; 155 | break; 156 | case 'y': 157 | pwgen_flags |= PW_SYMBOLS; 158 | break; 159 | case 'v': 160 | pwgen = pw_rand; 161 | pwgen_flags |= PW_NO_VOWELS; 162 | break; 163 | case 'r': 164 | remove = strdup(optarg); 165 | pwgen = pw_rand; 166 | break; 167 | case 'h': 168 | case '?': 169 | usage(); 170 | break; 171 | } 172 | } 173 | if (optind < argc) { 174 | pw_length = strtol(argv[optind], &tmp, 0); 175 | if (pw_length < 5) 176 | pwgen = pw_rand; 177 | if (pwgen != pw_rand) { 178 | if (pw_length <= 2) 179 | pwgen_flags &= ~PW_UPPERS; 180 | if (pw_length <= 1) 181 | pwgen_flags &= ~PW_DIGITS; 182 | } 183 | if (*tmp) { 184 | fprintf(stderr, "Invalid password length: %s\n", 185 | argv[optind]); 186 | exit(1); 187 | } 188 | optind++; 189 | } 190 | 191 | if (optind < argc) { 192 | num_pw = strtol(argv[optind], &tmp, 0); 193 | if (*tmp) { 194 | fprintf(stderr, "Invalid number of passwords: %s\n", 195 | argv[optind]); 196 | exit(1); 197 | } 198 | } 199 | 200 | if (do_columns) { 201 | num_cols = term_width / (pw_length+1); 202 | if (num_cols == 0) 203 | num_cols = 1; 204 | } 205 | if (num_pw < 0) 206 | num_pw = do_columns ? num_cols * 20 : 1; 207 | 208 | buf = malloc(pw_length+1); 209 | if (!buf) { 210 | fprintf(stderr, "Couldn't malloc password buffer.\n"); 211 | exit(1); 212 | } 213 | for (i=0; i < num_pw; i++) { 214 | pwgen(buf, pw_length, pwgen_flags, remove); 215 | if (!do_columns || ((i % num_cols) == (num_cols-1)) || 216 | (i == (num_pw - 1))) 217 | printf("%s\n", buf); 218 | else 219 | printf("%s ", buf); 220 | } 221 | free(buf); 222 | return 0; 223 | } 224 | -------------------------------------------------------------------------------- /sha1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FIPS-180-1 compliant SHA-1 implementation 3 | * 4 | * Copyright (C) 2001-2003 Christophe Devine 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | #include 22 | 23 | #include "sha1.h" 24 | 25 | 26 | void sha1_process(sha1_context *ctx, uint8 data[64]); 27 | 28 | 29 | #define GET_UINT32(n,b,i) \ 30 | { \ 31 | (n) = ( (uint32) (b)[(i) ] << 24 ) \ 32 | | ( (uint32) (b)[(i) + 1] << 16 ) \ 33 | | ( (uint32) (b)[(i) + 2] << 8 ) \ 34 | | ( (uint32) (b)[(i) + 3] ); \ 35 | } 36 | 37 | #define PUT_UINT32(n,b,i) \ 38 | { \ 39 | (b)[(i) ] = (uint8) ( (n) >> 24 ); \ 40 | (b)[(i) + 1] = (uint8) ( (n) >> 16 ); \ 41 | (b)[(i) + 2] = (uint8) ( (n) >> 8 ); \ 42 | (b)[(i) + 3] = (uint8) ( (n) ); \ 43 | } 44 | 45 | void sha1_starts(ctx) 46 | sha1_context *ctx; 47 | { 48 | ctx->total[0] = 0; 49 | ctx->total[1] = 0; 50 | 51 | ctx->state[0] = 0x67452301; 52 | ctx->state[1] = 0xEFCDAB89; 53 | ctx->state[2] = 0x98BADCFE; 54 | ctx->state[3] = 0x10325476; 55 | ctx->state[4] = 0xC3D2E1F0; 56 | } 57 | 58 | void sha1_process(ctx, data) 59 | sha1_context *ctx; 60 | uint8 data[64]; 61 | { 62 | uint32 temp, W[16], A, B, C, D, E; 63 | 64 | GET_UINT32( W[0], data, 0 ); 65 | GET_UINT32( W[1], data, 4 ); 66 | GET_UINT32( W[2], data, 8 ); 67 | GET_UINT32( W[3], data, 12 ); 68 | GET_UINT32( W[4], data, 16 ); 69 | GET_UINT32( W[5], data, 20 ); 70 | GET_UINT32( W[6], data, 24 ); 71 | GET_UINT32( W[7], data, 28 ); 72 | GET_UINT32( W[8], data, 32 ); 73 | GET_UINT32( W[9], data, 36 ); 74 | GET_UINT32( W[10], data, 40 ); 75 | GET_UINT32( W[11], data, 44 ); 76 | GET_UINT32( W[12], data, 48 ); 77 | GET_UINT32( W[13], data, 52 ); 78 | GET_UINT32( W[14], data, 56 ); 79 | GET_UINT32( W[15], data, 60 ); 80 | 81 | #define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) 82 | 83 | #define R(t) \ 84 | ( \ 85 | temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \ 86 | W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ 87 | ( W[t & 0x0F] = S(temp,1) ) \ 88 | ) 89 | 90 | #define P(a,b,c,d,e,x) \ 91 | { \ 92 | e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \ 93 | } 94 | 95 | A = ctx->state[0]; 96 | B = ctx->state[1]; 97 | C = ctx->state[2]; 98 | D = ctx->state[3]; 99 | E = ctx->state[4]; 100 | 101 | #define F(x,y,z) (z ^ (x & (y ^ z))) 102 | #define K 0x5A827999 103 | 104 | P( A, B, C, D, E, W[0] ); 105 | P( E, A, B, C, D, W[1] ); 106 | P( D, E, A, B, C, W[2] ); 107 | P( C, D, E, A, B, W[3] ); 108 | P( B, C, D, E, A, W[4] ); 109 | P( A, B, C, D, E, W[5] ); 110 | P( E, A, B, C, D, W[6] ); 111 | P( D, E, A, B, C, W[7] ); 112 | P( C, D, E, A, B, W[8] ); 113 | P( B, C, D, E, A, W[9] ); 114 | P( A, B, C, D, E, W[10] ); 115 | P( E, A, B, C, D, W[11] ); 116 | P( D, E, A, B, C, W[12] ); 117 | P( C, D, E, A, B, W[13] ); 118 | P( B, C, D, E, A, W[14] ); 119 | P( A, B, C, D, E, W[15] ); 120 | P( E, A, B, C, D, R(16) ); 121 | P( D, E, A, B, C, R(17) ); 122 | P( C, D, E, A, B, R(18) ); 123 | P( B, C, D, E, A, R(19) ); 124 | 125 | #undef K 126 | #undef F 127 | 128 | #define F(x,y,z) (x ^ y ^ z) 129 | #define K 0x6ED9EBA1 130 | 131 | P( A, B, C, D, E, R(20) ); 132 | P( E, A, B, C, D, R(21) ); 133 | P( D, E, A, B, C, R(22) ); 134 | P( C, D, E, A, B, R(23) ); 135 | P( B, C, D, E, A, R(24) ); 136 | P( A, B, C, D, E, R(25) ); 137 | P( E, A, B, C, D, R(26) ); 138 | P( D, E, A, B, C, R(27) ); 139 | P( C, D, E, A, B, R(28) ); 140 | P( B, C, D, E, A, R(29) ); 141 | P( A, B, C, D, E, R(30) ); 142 | P( E, A, B, C, D, R(31) ); 143 | P( D, E, A, B, C, R(32) ); 144 | P( C, D, E, A, B, R(33) ); 145 | P( B, C, D, E, A, R(34) ); 146 | P( A, B, C, D, E, R(35) ); 147 | P( E, A, B, C, D, R(36) ); 148 | P( D, E, A, B, C, R(37) ); 149 | P( C, D, E, A, B, R(38) ); 150 | P( B, C, D, E, A, R(39) ); 151 | 152 | #undef K 153 | #undef F 154 | 155 | #define F(x,y,z) ((x & y) | (z & (x | y))) 156 | #define K 0x8F1BBCDC 157 | 158 | P( A, B, C, D, E, R(40) ); 159 | P( E, A, B, C, D, R(41) ); 160 | P( D, E, A, B, C, R(42) ); 161 | P( C, D, E, A, B, R(43) ); 162 | P( B, C, D, E, A, R(44) ); 163 | P( A, B, C, D, E, R(45) ); 164 | P( E, A, B, C, D, R(46) ); 165 | P( D, E, A, B, C, R(47) ); 166 | P( C, D, E, A, B, R(48) ); 167 | P( B, C, D, E, A, R(49) ); 168 | P( A, B, C, D, E, R(50) ); 169 | P( E, A, B, C, D, R(51) ); 170 | P( D, E, A, B, C, R(52) ); 171 | P( C, D, E, A, B, R(53) ); 172 | P( B, C, D, E, A, R(54) ); 173 | P( A, B, C, D, E, R(55) ); 174 | P( E, A, B, C, D, R(56) ); 175 | P( D, E, A, B, C, R(57) ); 176 | P( C, D, E, A, B, R(58) ); 177 | P( B, C, D, E, A, R(59) ); 178 | 179 | #undef K 180 | #undef F 181 | 182 | #define F(x,y,z) (x ^ y ^ z) 183 | #define K 0xCA62C1D6 184 | 185 | P( A, B, C, D, E, R(60) ); 186 | P( E, A, B, C, D, R(61) ); 187 | P( D, E, A, B, C, R(62) ); 188 | P( C, D, E, A, B, R(63) ); 189 | P( B, C, D, E, A, R(64) ); 190 | P( A, B, C, D, E, R(65) ); 191 | P( E, A, B, C, D, R(66) ); 192 | P( D, E, A, B, C, R(67) ); 193 | P( C, D, E, A, B, R(68) ); 194 | P( B, C, D, E, A, R(69) ); 195 | P( A, B, C, D, E, R(70) ); 196 | P( E, A, B, C, D, R(71) ); 197 | P( D, E, A, B, C, R(72) ); 198 | P( C, D, E, A, B, R(73) ); 199 | P( B, C, D, E, A, R(74) ); 200 | P( A, B, C, D, E, R(75) ); 201 | P( E, A, B, C, D, R(76) ); 202 | P( D, E, A, B, C, R(77) ); 203 | P( C, D, E, A, B, R(78) ); 204 | P( B, C, D, E, A, R(79) ); 205 | 206 | #undef K 207 | #undef F 208 | 209 | ctx->state[0] += A; 210 | ctx->state[1] += B; 211 | ctx->state[2] += C; 212 | ctx->state[3] += D; 213 | ctx->state[4] += E; 214 | } 215 | 216 | void sha1_update(ctx, input, length ) 217 | sha1_context *ctx; 218 | uint8 *input; 219 | uint32 length; 220 | { 221 | uint32 left, fill; 222 | 223 | if( ! length ) return; 224 | 225 | left = ctx->total[0] & 0x3F; 226 | fill = 64 - left; 227 | 228 | ctx->total[0] += length; 229 | ctx->total[0] &= 0xFFFFFFFF; 230 | 231 | if( ctx->total[0] < length ) 232 | ctx->total[1]++; 233 | 234 | if( left && length >= fill ) 235 | { 236 | memcpy( (void *) (ctx->buffer + left), 237 | (void *) input, fill ); 238 | sha1_process( ctx, ctx->buffer ); 239 | length -= fill; 240 | input += fill; 241 | left = 0; 242 | } 243 | 244 | while( length >= 64 ) 245 | { 246 | sha1_process( ctx, input ); 247 | length -= 64; 248 | input += 64; 249 | } 250 | 251 | if( length ) 252 | { 253 | memcpy( (void *) (ctx->buffer + left), 254 | (void *) input, length ); 255 | } 256 | } 257 | 258 | static uint8 sha1_padding[64] = 259 | { 260 | 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 262 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 263 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 264 | }; 265 | 266 | void sha1_finish( ctx, digest ) 267 | sha1_context *ctx; 268 | uint8 digest[20]; 269 | { 270 | uint32 last, padn; 271 | uint32 high, low; 272 | uint8 msglen[8]; 273 | 274 | high = ( ctx->total[0] >> 29 ) 275 | | ( ctx->total[1] << 3 ); 276 | low = ( ctx->total[0] << 3 ); 277 | 278 | PUT_UINT32( high, msglen, 0 ); 279 | PUT_UINT32( low, msglen, 4 ); 280 | 281 | last = ctx->total[0] & 0x3F; 282 | padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); 283 | 284 | sha1_update( ctx, sha1_padding, padn ); 285 | sha1_update( ctx, msglen, 8 ); 286 | 287 | PUT_UINT32( ctx->state[0], digest, 0 ); 288 | PUT_UINT32( ctx->state[1], digest, 4 ); 289 | PUT_UINT32( ctx->state[2], digest, 8 ); 290 | PUT_UINT32( ctx->state[3], digest, 12 ); 291 | PUT_UINT32( ctx->state[4], digest, 16 ); 292 | } 293 | 294 | #ifdef TEST 295 | 296 | #include 297 | #include 298 | 299 | /* 300 | * those are the standard FIPS-180-1 test vectors 301 | */ 302 | 303 | static char *msg[] = 304 | { 305 | "abc", 306 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 307 | NULL 308 | }; 309 | 310 | static char *val[] = 311 | { 312 | "a9993e364706816aba3e25717850c26c9cd0d89d", 313 | "84983e441c3bd26ebaae4aa1f95129e5e54670f1", 314 | "34aa973cd4c4daa4f61eeb2bdbad27316534016f" 315 | }; 316 | 317 | int main( argc, argv ) 318 | int argc; 319 | char **argv; 320 | { 321 | FILE *f; 322 | int i, j; 323 | char output[41]; 324 | sha1_context ctx; 325 | unsigned char buf[1000]; 326 | unsigned char sha1sum[20]; 327 | 328 | if( argc < 2 ) 329 | { 330 | printf( "\n SHA-1 Validation Tests:\n\n" ); 331 | 332 | for( i = 0; i < 3; i++ ) 333 | { 334 | printf( " Test %d ", i + 1 ); 335 | 336 | sha1_starts( &ctx ); 337 | 338 | if( i < 2 ) 339 | { 340 | sha1_update( &ctx, (uint8 *) msg[i], 341 | strlen( msg[i] ) ); 342 | } 343 | else 344 | { 345 | memset( buf, 'a', 1000 ); 346 | 347 | for( j = 0; j < 1000; j++ ) 348 | { 349 | sha1_update( &ctx, (uint8 *) buf, 1000 ); 350 | } 351 | } 352 | 353 | sha1_finish( &ctx, sha1sum ); 354 | 355 | for( j = 0; j < 20; j++ ) 356 | { 357 | sprintf( output + j * 2, "%02x", sha1sum[j] ); 358 | } 359 | 360 | if( memcmp( output, val[i], 40 ) ) 361 | { 362 | printf( "failed!\n" ); 363 | return( 1 ); 364 | } 365 | 366 | printf( "passed.\n" ); 367 | } 368 | 369 | printf( "\n" ); 370 | } 371 | else 372 | { 373 | if( ! ( f = fopen( argv[1], "rb" ) ) ) 374 | { 375 | perror( "fopen" ); 376 | return( 1 ); 377 | } 378 | 379 | sha1_starts( &ctx ); 380 | 381 | while( ( i = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) 382 | { 383 | sha1_update( &ctx, buf, i ); 384 | } 385 | 386 | sha1_finish( &ctx, sha1sum ); 387 | 388 | for( j = 0; j < 20; j++ ) 389 | { 390 | printf( "%02x", sha1sum[j] ); 391 | } 392 | 393 | printf( " %s\n", argv[1] ); 394 | } 395 | 396 | return( 0 ); 397 | } 398 | 399 | #endif 400 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | pwgen (2.08-2) unstable; urgency=medium 2 | 3 | * Convert debian/rules file to use dh 4 | * Update the debhelper compatibility level to 12 5 | * Update Debian policy compliance to 4.0.0 6 | * fix unreliable support of --capitalize when --ambiguous 7 | is requested 8 | 9 | -- Theodore Y. Ts'o Sat, 03 Aug 2019 11:26:29 -0400 10 | 11 | pwgen (2.08-1) unstable; urgency=medium 12 | 13 | * New upstream version 14 | * Suppress trailing space after the last password (Closes: #794635) 15 | * Make pwgen -s more "secure" for 1 and 2 character passwords 16 | (Closes: #666725) 17 | * Fix option parsing of "pwgen --no-capitalize --no-vowels" (Closes: #791908) 18 | * Add new option --remove-chars which removes chars from the set of 19 | characters used to generate passwords (Closes: #836334) 20 | * Add cross-compilation to debian/rules (Closes: #695148) 21 | * Update control and copyright files to point at pwgen at github for 22 | the home directory and primary git repository 23 | (Closes: #454500, #855495, #846517) 24 | * Update Debian policy compliance to 4.0.0 25 | 26 | -- Theodore Y. Ts'o Mon, 07 Aug 2017 00:51:45 -0400 27 | 28 | pwgen (2.07-1.1) unstable; urgency=medium 29 | 30 | * Non-maintainer upload. 31 | * Add multiarch metadata (Closes: #693964) 32 | * Fix manpage typo (Closes: #579178) 33 | * Stop -s from overwriting other flags (Closes: #436912) 34 | 35 | -- Wookey Thu, 22 Oct 2015 22:14:04 +0100 36 | 37 | pwgen (2.07-1) unstable; urgency=high 38 | 39 | * New upstream version 40 | * Remove backwards compatibility for no-tty mode. Addresses 41 | CVE-2013-4440 (Closes: #725507) 42 | * Fail hard if /dev/urandom and /dev/random are not available. 43 | Addresses CVE-2013-4442 and Launchpad #1183213 (Closes: #767008) 44 | * Fix pwgen -B so that it doesn't accidentally generate passwords with 45 | ambiguous characters after changing the case of some letters. 46 | Addresses Launchpad Bugs #638418 and #1349863 47 | * Fix potential portability bug on architectures where unsgined ints 48 | are not 4 bytes long 49 | * Update Debian policy compliance to 3.9.6.0 50 | * Build with Debian hardening using dpkg-buildflags 51 | 52 | -- Theodore Y. Ts'o Mon, 27 Oct 2014 23:30:52 -0400 53 | 54 | pwgen (2.06-1) unstable; urgency=low 55 | 56 | * New upstream version 57 | * Fix pwgen -Bs so that this option combination works correctly 58 | (Closes: #368010) 59 | * Fix the pwgen -Bc option combination (Closes: #355153) 60 | * Fix typo in pwgen man page (Closes: #376147) 61 | * Make the -s option imply the -nc options (Closes: #427969) 62 | * Add -v option to generate passwords without vowels (Closes: #387461) 63 | 64 | -- Theodore Y. Ts'o Wed, 4 Jul 2007 19:19:26 -0400 65 | 66 | pwgen (2.05-1) unstable; urgency=low 67 | 68 | * Add a udeb for debian-installer. Thanks to Martin Michlmayr for the 69 | patch. (Closes: #271115) 70 | * Fix bug which would cause pwgen to loop forever if the password length 71 | is 1. 72 | * Fix spelling errors in the man page. (Closes: #323538) 73 | 74 | -- Theodore Y. Ts'o Sun, 15 Jan 2006 23:16:59 -0500 75 | 76 | pwgen (2.04-1) unstable; urgency=low 77 | 78 | * New upstream version. 79 | * Adopt maintainership of pwgen. (Closes: #282076) 80 | * Fix minor bug in man page. (Closes: #311461) 81 | * Convert from debmake to debhelper 82 | * Add the --sha1 option so that pwgen uses the SHA1 hash to generate 83 | (not so) random passwords. 84 | * Add --symbols option which adds special symbols to the password. 85 | (Closes: #154561) 86 | * Add short options for --no-capitalize and --no-numerals and make those 87 | options work when --secure is specified. 88 | * Add --ambiguous option which avoids characters that can be confused by 89 | the user. (Closes: #51307) 90 | * Fix bug where --no-capitalized and --no-numerals were ignored for short 91 | passwords. (Closes: #276307) 92 | * In the pwgen man page, explain that human-memorable passwords are 93 | subject to off-line brute force attacks. (Closes: #276976) 94 | * Allow one or more capital letters and digits in human-friendly 95 | passwords (Closes: #182595) 96 | 97 | -- Theodore Y. Ts'o Wed, 15 Jun 2005 00:39:10 -0400 98 | 99 | pwgen (2.03-1) unstable; urgency=high 100 | 101 | * New upstream release (Thanks Ted for the quick release! :-) 102 | (Closes: #170312, #176688). 103 | * Bugs fixed in previous release 104 | (Closes: #166959, #167485) 105 | 106 | -- Vincent Renardias Thu, 16 Jan 2003 11:07:14 +0100 107 | 108 | pwgen (2.02-2) unstable; urgency=low 109 | 110 | * Apply small fix from Matthew J Backes (Closes: #176082). 111 | 112 | -- Vincent Renardias Mon, 13 Jan 2003 16:09:17 +0100 113 | 114 | pwgen (2.02-1) unstable; urgency=low 115 | 116 | * new upstream release; fixes the following bugs (Thanks Ted!): 117 | - If the number of characters is less than 5, force the use 118 | of the fully random generator, since the quality of phonetic 119 | generator is really bad if the lengths are small --- and if 120 | the length is less than or equal to 2, pwgen will loop 121 | forever (Closes: #117137). 122 | - Fix e-mail address in man page (Closes: #150579). 123 | - #include the appropriate header files to avoid -Wall warnings 124 | (Closes: #126774). 125 | - Fix floating point exception errors if the password is longer 126 | than terminal width (Closes: #113571). 127 | - Return an exit value of 0 when pwgen on success 128 | (Closes: #118181, #102063). 129 | 130 | -- Vincent Renardias Tue, 16 Jul 2002 11:32:40 +0200 131 | 132 | pwgen (2.01-3) unstable; urgency=low 133 | 134 | * Package is not native anymore (Closes: #44169). 135 | * pwgen now accept to generate passwords longer than 16 chars 136 | (Closes: #54957). 137 | * pwgen now really honors the password length (Closes: #70580). 138 | * The /usr/doc symlink is created (Closes: #102452). 139 | 140 | -- Vincent Renardias Thu, 6 Dec 2001 17:38:58 +0100 141 | 142 | pwgen (2.01-2) unstable; urgency=low 143 | 144 | * Fix copyright file (Closes: #104207). 145 | The very purpose of having the /usr/share/licences directory is 146 | precisely to avoid to duplicate the GPL text in every package. 147 | This is explicitely allowed by the Debian policy unless it changed recently. 148 | 149 | -- Vincent Renardias Tue, 10 Jul 2001 20:46:25 +0200 150 | 151 | pwgen (2.01-1) unstable; urgency=low 152 | 153 | * Now using new GPL'd code from Ted T'so. 154 | 155 | -- Vincent Renardias Thu, 21 Jun 2001 11:57:22 +0200 156 | 157 | pwgen (1-17) unstable; urgency=low 158 | 159 | * Brandon has put is code under the BSD licence. 160 | Closes: #39130. 161 | * Remove extra junk files in source archive (yo, *~). 162 | * Ack NMU fixed bugs (Closes: 80763, #89985). 163 | * Really add /usr/doc/pwgen (NOT sntop!) link (Closes: #90335). 164 | 165 | -- Vincent Renardias Wed, 13 Jun 2001 11:34:10 +0200 166 | 167 | pwgen (1-16) unstable; urgency=low 168 | 169 | * Fixed debian/rules 170 | manpages moved from /usr/man to /usr/share/man closes: #80763 171 | docs in /usr/doc moved to /usr/share/doc closes: #89985 172 | * lintian clean 173 | 174 | -- Fredrik Steen Sat, 17 Mar 2001 13:23:11 +0100 175 | 176 | pwgen (1-15) unstable; urgency=low 177 | 178 | * Fix debian/rules; 179 | closes: #54001: can not build from source. 180 | 181 | -- Vincent Renardias Tue, 4 Jan 2000 14:53:58 +0100 182 | 183 | pwgen (1-14) unstable; urgency=low 184 | 185 | * Fix bug #38630. 186 | 187 | -- Vincent Renardias Wed, 2 Jun 1999 14:55:04 +0200 188 | 189 | pwgen (1-13) unstable; urgency=low 190 | 191 | * install pwgen in mode 755, not 555. 192 | 193 | -- Vincent Renardias Mon, 25 Jan 1999 05:51:20 +0100 194 | 195 | pwgen (1-12) unstable; urgency=low 196 | 197 | * Plenty of good stuff contributed by Jim Lynch : 198 | * added -h and --help to the list of supported options. 199 | == pwgen (1-11.4) unstable; urgency=low 200 | * Cleaned up options parser. Now: 201 | - all options exclude repetition of themselves 202 | - -acn excludes -s 203 | - -s excludes -acn 204 | - -h in a future release. 205 | Note: this finshes fixes of Bug#25525. 206 | == pwgen (1-11.3) unstable; urgency=low 207 | * Made the function header for pwgen() be ANSI-compatible 208 | * Note: I just discovered that 1-11.1 fixes Bug#25525, and 209 | the parser will be fixed in .4, when I tighten up the parser. 210 | == pwgen (1-11.2) unstable; urgency=low 211 | * Modified manpage to combine the descriptions for short options with 212 | their equivalent long options. 213 | == pwgen (1-11.1) unstable; urgency=low 214 | * Added command-line arg handling (-a, -c, -n, -s) which implement 215 | the old preprocessor definitions ALTPHON, CAPITALIZE, NUMERALS and 216 | an unhooked secure password generator, respectively. Define ALLBYOPTS 217 | in the preprocessor to activate. When defined, ALTPHON, CAPITALIZE and 218 | NUMERALS have no effect. When not defined, is practically identical to 219 | version 1-11. The default for 1-11.1 will have ALLBYOPTS defined. Now, 220 | one copy of the pwgen binary will suffice when 16 would have been needed 221 | before to provide the same functionality. Also, the long options 222 | --alt-phonics, --capitalize, --numerals and --secure are identical 223 | aliases to -a, -c, -n and -s, respectively. 224 | * updated man page pwgen.1 to reflect all new functionality. 225 | * updated Makefile so it defines ALLBYOPTS and no longer defines ALTPHON, 226 | CAPITALIZE and NUMERALS when compiling pwgen (and spwgen; this 227 | has no effect, the secure option in pwgen is identical to the 228 | implementation in spwgen. So, I have arranged for the Makefile to 229 | not build or install spwgen.) 230 | 231 | -- Vincent Renardias Fri, 24 Apr 1998 19:37:50 +0200 232 | 233 | pwgen (1-11) unstable; urgency=low 234 | 235 | * Corrected usage string (Bug #21612). 236 | 237 | -- Vincent Renardias Fri, 24 Apr 1998 19:37:50 +0200 238 | 239 | pwgen (1-10) unstable; urgency=low 240 | 241 | * Corrected typo. in manpage (Bug #15027). 242 | 243 | -- Vincent Renardias Thu, 18 Dec 1997 05:08:06 +0100 244 | 245 | pwgen (1-9) unstable; urgency=low 246 | 247 | * Added a 'spwgen' command to get more 'secure' passwords. 248 | Fixes bug #13162. 249 | 250 | -- Vincent Renardias Mon, 10 Nov 1997 06:14:12 +0100 251 | 252 | pwgen (1-8) unstable; urgency=low 253 | 254 | * Documented bug #10192 so that it becomes a feature. _(; 255 | 256 | -- Vincent Renardias Wed, 28 May 1997 21:06:38 +0200 257 | 258 | pwgen (1-7) unstable; urgency=low 259 | 260 | * Rebuilt with libc6. 261 | 262 | -- Vincent Renardias Thu, 1 May 1997 21:45:05 +0200 263 | 264 | pwgen (1-6) unstable; urgency=low 265 | 266 | * Changed architecture from control file (i386 => any). 267 | 268 | -- Vincent Renardias Sat, 19 Apr 1997 10:42:34 +0200 269 | 270 | pwgen (1-5) unstable; urgency=low 271 | 272 | * Modified usage info (Fixes bug #8227). 273 | 274 | -- Vincent Renardias Mon, 24 Mar 1997 23:33:11 +0100 275 | 276 | pwgen (1-4) unstable; urgency=low 277 | 278 | * Modified RNG initialisation (Fixes Bug #6508). 279 | 280 | -- Vincent Renardias Sat, 11 Jan 1997 22:58:24 +0100 281 | 282 | pwgen (1-3) unstable; urgency=low 283 | 284 | * Maintainer changed 285 | * Tuned Makefile 286 | 287 | -- Vincent Renardias Sat, 19 Oct 1996 04:32:26 +0200 288 | 289 | pwgen (1-2) unstable; urgency=low 290 | 291 | * Binary not stripped 292 | * More documentation regarding the origin of the package 293 | 294 | -- Christoph Lameter Thu, 26 Sep 1996 14:51:46 +0800 295 | 296 | pwgen (1-1) unstable; urgency=low 297 | 298 | * Initial Release 299 | 300 | -- Christoph Lameter Fri, 20 Sep 1996 14:51:46 +0800 301 | 302 | Local variables: 303 | mode: debian-changelog 304 | End: 305 | --------------------------------------------------------------------------------