debian/0000755000000000000000000000000012221034300007151 5ustar debian/ruby-tests.rb0000644000000000000000000000006212111135601011621 0ustar Dir['{spec,test}/**/*.rb'].each { |f| require f } debian/source/0000755000000000000000000000000012221001631010452 5ustar debian/source/format0000644000000000000000000000001412111135601011663 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000075112221032171010240 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby override_dh_clean: dh_clean rbcrack.h debian/copyright0000644000000000000000000000227612144147031011125 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ruby-password Source: http://www.caliban.org/ruby/ruby-password.shtml Files: * Copyright: © 2004-2006 Ian Caliban License: GPL-2+ Files: debian/* Copyright: 2008-2011 Micah Anderson , Gunnar Wolf License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/ruby-password.docs0000644000000000000000000000000712111135601012645 0ustar README debian/ruby-password.examples0000644000000000000000000000001212111135601013527 0ustar example/* debian/control0000644000000000000000000000232012221034232010555 0ustar Source: ruby-password Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Micah Anderson , Gunnar Wolf , Ryan Niebur Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.5~), cracklib-runtime, libcrack2-dev, wamerican | wordlist, ruby-termios (>= 1.0.0~) Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-password.git Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/ruby-password.git;a=summary Homepage: http://www.caliban.org/ruby/ruby-password.shtml XS-Ruby-Versions: all Package: ruby-password Architecture: any XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | interpreter, ruby-termios Description: Ruby library for handling passwords This package is a suite of password handling methods. Specifically, it handles manual entry of passwords from the keyboard in both buffered and unbuffered modes, password strength checking, random password generation, phonemic password generation, and encryption of passwords. . The common CrackLib library is used to perform password strength checking. debian/changelog0000644000000000000000000000352412221034300011027 0ustar ruby-password (0.5.3-4) unstable; urgency=low * Team upload * debian/control: + use canonical URI in Vcs-* fields + build for ruby1.9.1 and ruby2.0 + replace ruby1.8 by ruby | ruby-interpreter in Depends field + add versioned build-dependencies on gem2deb and ruby-termios to ensure Ruby 2.0 support + drop transitional packages + bump Standards-Version to 3.9.4 (no changes needed) * debian/copyright: use DEP5 copyright-format/1.0 official URL for Format field * debian/patches: + add newer-ruby.patch to port the library to newer Ruby versions + add password_crack.patch to rename the C extension to password_crack.so -- Cédric Boutillier Thu, 26 Sep 2013 15:25:20 +0200 ruby-password (0.5.3-3) unstable; urgency=low * Repackaged under the new pkg-ruby-extras gem2deb-derived style -- Gunnar Wolf Mon, 14 Nov 2011 11:08:06 -0600 libpassword-ruby (0.5.3-2) unstable; urgency=low * Team upload. * Bump Standards-Version to 3.9.1 (no change). * Use libcrack2-dev instead of cracklib2-dev (Closes: #598178). -- Laurent Arnoud Tue, 05 Oct 2010 00:12:43 +0200 libpassword-ruby (0.5.3-1) unstable; urgency=low [ Micah Anderson ] * Initial Release. (Closes: #490146) [ Ryan Niebur ] * Add myself and the team to Uploaders * fix changelog to close ITP and only have one entry * add debian/watch * run "make extra-clean" in debian/rules * convert Richard's direct changes to a quilt patch - add README.source * add examples * remove ./debian/breakpoint_client.1, which seems irrelevant.. * add ruby1.8-dev to build deps * add Homepage * install README as a doc * install rdoc documentation - build dep on graphviz * fix debian/copyright -- Micah Anderson Fri, 01 May 2009 21:34:16 +0000 debian/patches/0000755000000000000000000000000012221032516010607 5ustar debian/patches/series0000644000000000000000000000010012221014664012017 0ustar improvements-from-richard password_crack.patch newer-ruby.patch debian/patches/improvements-from-richard0000644000000000000000000000375412221001372015642 0ustar http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=490146#10 --- a/lib/password.rb +++ b/lib/password.rb @@ -19,11 +19,6 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -require 'crack' -require 'termios' - - # Ruby/Password is a collection of password handling routines for Ruby, # including an interface to CrackLib for the purposes of testing password # strength. @@ -164,6 +159,8 @@ # normal operations. # def Password.echo(on=true, masked=false) + require 'termios' + term = Termios::getattr( $stdin ) if on @@ -183,6 +180,8 @@ # connected to a tty, no prompt will be displayed. # def Password.get(message="Password: ") + require 'termios' + begin if $stdin.tty? Password.echo false @@ -206,6 +205,8 @@ # _mask_ to the terminal. There is no need to hit [Enter] at the end. # def Password.getc(message="Password: ", mask='*') + require 'termios' + # Save current buffering mode buffering = $stdout.sync @@ -401,6 +402,20 @@ # def crypt(type=DES, salt='') + # Compatibility with String's crypt method. + # Really, salt should be the first argument here. + if (type.kind_of?(String) && salt == '') + salt = type + type = (type =~ /^\$1\$/ ? MD5 : DES) + end + + # Compatibility with String's crypt method. + # Really, salt should be the first argument here. + if (type.kind_of?(String) && salt == '') + salt = type + type = (salt =~ /^\$1\$/ ? MD5 : DES) + end + unless ( salt.split( // ) - SALT_CHARS.split( // ) ).empty? raise CryptError, 'bad salt' end @@ -422,8 +437,14 @@ crypt end -end + # :stopdoc: + def check(dict=nil) + # Load the crack module (which injects a check method into this class, + # overriding this one) and try again. + self.send("check") if require 'crack' + end +end # Display a phonemic password, if run directly. # debian/patches/newer-ruby.patch0000644000000000000000000000260612221032363013733 0ustar Description: port to newer versions of Ruby replace STR2CTR by StringValuePtr and change the way ASCII code of a character is computed. Author: Cédric Boutillier Forwarded: no Last-Update: 2013-09-26 --- a/rbcrack.c +++ b/rbcrack.c @@ -59,12 +59,12 @@ /* pop the one and only argument we may have been passed */ dict = rb_ary_pop(args); - if (dict == Qnil || strcmp(STR2CSTR(dict), "") == 0) { + if (dict == Qnil || strcmp(StringValuePtr(dict), "") == 0) { /* no argument passed, so use default location from rbcrack.h */ dict = rb_str_new2(CRACK_DICT); } else { - buffer = malloc(strlen(STR2CSTR(dict)) + 8); - strcpy(buffer, STR2CSTR(dict)); + buffer = malloc(strlen(StringValuePtr(dict)) + 8); + strcpy(buffer, StringValuePtr(dict)); strcat(buffer, ".pwd"); if (access(buffer, R_OK) != 0) { @@ -77,7 +77,7 @@ } /* perform check on password */ - objection = FascistCheck(STR2CSTR(self), STR2CSTR(dict)); + objection = FascistCheck(StringValuePtr(self), StringValuePtr(dict)); /* return true on success; raise an exception otherwise */ if (objection) { --- a/lib/password.rb +++ b/lib/password.rb @@ -327,7 +327,7 @@ if feature_flags.include? ONE_DIGIT if ! first and rand( 10 ) < 3 - pw << ( rand( 10 ) + ?0 ).chr + pw << ( rand( 10 ) + '0'.ord ).chr feature_flags.delete ONE_DIGIT first = true debian/patches/password_crack.patch0000644000000000000000000000212512221032516014635 0ustar Description: change the name of the C extension from crack to password_crack This is to avoid conflict with crack.rb shipped by the ruby-crack package Author: Cédric Boutillier Forwarded: no Last-Update: 2013-09-26 --- a/extconf.rb +++ b/extconf.rb @@ -43,7 +43,7 @@ have_header('crack.h') && have_library('crack', 'FascistCheck') or exit 1 -create_makefile('crack') +create_makefile('password_crack') File.open('Makefile', 'a') do |f| f.print <