bcrypt-ruby 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bcrypt-ruby might be problematic. Click here for more details.
- data/CHANGELOG +5 -1
- data/README +3 -3
- data/Rakefile +3 -1
- data/ext/bcrypt_ext.c +1 -0
- data/ext/blf.h +9 -0
- data/spec/bcrypt/password_spec.rb +1 -1
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -9,4 +9,8 @@
|
|
9
9
|
|
10
10
|
2.0.1 Mar 09 2007
|
11
11
|
- Fixed load path issues
|
12
|
-
- Fixed crashes when hashing weird values (e.g., false, etc.)
|
12
|
+
- Fixed crashes when hashing weird values (e.g., false, etc.)
|
13
|
+
|
14
|
+
2.0.2 Jun 06 2007
|
15
|
+
- Fixed example code in the README [Winson]
|
16
|
+
- Fixed Solaris compatibility [Jeremy LaTrasse, Twitter crew]
|
data/README
CHANGED
@@ -26,16 +26,16 @@ You'll need a working compiler. (Win32 folks should use Cygwin or um, something
|
|
26
26
|
require 'bcrypt'
|
27
27
|
|
28
28
|
class User < ActiveRecord::Base
|
29
|
-
# users.
|
29
|
+
# users.password_hash in the database is a :string
|
30
30
|
include BCrypt
|
31
31
|
|
32
32
|
def password
|
33
|
-
@password ||= Password.new(
|
33
|
+
@password ||= Password.new(password_hash)
|
34
34
|
end
|
35
35
|
|
36
36
|
def password=(new_password)
|
37
37
|
@password = Password.create(new_password)
|
38
|
-
self.
|
38
|
+
self.password_hash = @password
|
39
39
|
end
|
40
40
|
|
41
41
|
end
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'rake/rdoctask'
|
|
7
7
|
require "benchmark"
|
8
8
|
|
9
9
|
PKG_NAME = "bcrypt-ruby"
|
10
|
-
PKG_VERSION = "2.0.
|
10
|
+
PKG_VERSION = "2.0.2"
|
11
11
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
12
|
PKG_FILES = FileList[
|
13
13
|
'[A-Z]*',
|
@@ -84,12 +84,14 @@ Rake::GemPackageTask.new(spec) do |pkg|
|
|
84
84
|
pkg.need_tar = true
|
85
85
|
end
|
86
86
|
|
87
|
+
desc "Clean, then compile the extension."
|
87
88
|
task :compile => [:clean] do
|
88
89
|
Dir.chdir('./ext')
|
89
90
|
system "ruby extconf.rb"
|
90
91
|
system "make"
|
91
92
|
end
|
92
93
|
|
94
|
+
desc "Run a set of benchmarks on the compiled extension."
|
93
95
|
task :benchmark do
|
94
96
|
TESTS = 100
|
95
97
|
TEST_PWD = "this is a test"
|
data/ext/bcrypt_ext.c
CHANGED
data/ext/blf.h
CHANGED
@@ -31,6 +31,15 @@
|
|
31
31
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
32
|
*/
|
33
33
|
|
34
|
+
/* Add this type so we'll compile nicely on Solaris.
|
35
|
+
Thanks to Jeremy LaTrasse and the Twitter crew. */
|
36
|
+
#ifdef __sun
|
37
|
+
#define u_int8_t uint8_t
|
38
|
+
#define u_int16_t uint16_t
|
39
|
+
#define u_int32_t uint32_t
|
40
|
+
#define u_int64_t uint64_t
|
41
|
+
#endif
|
42
|
+
|
34
43
|
#ifndef _BLF_H_
|
35
44
|
#define _BLF_H_
|
36
45
|
|
@@ -33,7 +33,7 @@ context "Reading a hashed password" do
|
|
33
33
|
password.version.should eql("2a")
|
34
34
|
password.cost.should equal(5)
|
35
35
|
password.salt.should eql("$2a$05$CCCCCCCCCCCCCCCCCCCCC.")
|
36
|
-
password.to_s.
|
36
|
+
password.to_s.should eql(@hash)
|
37
37
|
end
|
38
38
|
|
39
39
|
specify "should raise an InvalidHashError when given an invalid hash" do
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: bcrypt-ruby
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 2.0.
|
7
|
-
date: 2007-
|
6
|
+
version: 2.0.2
|
7
|
+
date: 2007-06-07 00:00:00 -07:00
|
8
8
|
summary: OpenBSD's bcrypt() password hashing algorithm.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -34,9 +34,9 @@ files:
|
|
34
34
|
- Rakefile
|
35
35
|
- README
|
36
36
|
- lib/bcrypt.rb
|
37
|
-
- spec/spec_helper.rb
|
38
37
|
- spec/bcrypt/engine_spec.rb
|
39
38
|
- spec/bcrypt/password_spec.rb
|
39
|
+
- spec/spec_helper.rb
|
40
40
|
- ext/bcrypt.c
|
41
41
|
- ext/bcrypt_ext.c
|
42
42
|
- ext/blowfish.c
|