bcrypt-ruby 3.1.2.rc1-java → 3.1.3-java
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -1
- data/README.md +6 -7
- data/lib/bcrypt.rb +6 -19
- data/lib/bcrypt_ext.jar +0 -0
- metadata +111 -127
- data/.gitignore +0 -10
- data/.rspec +0 -3
- data/.travis.yml +0 -11
- data/Gemfile +0 -2
- data/Gemfile.lock +0 -35
- data/Rakefile +0 -74
- data/bcrypt-ruby.gemspec +0 -30
- data/ext/jruby/bcrypt_jruby/BCrypt.java +0 -752
- data/ext/mri/bcrypt_ext.c +0 -64
- data/ext/mri/crypt.c +0 -57
- data/ext/mri/crypt.h +0 -13
- data/ext/mri/crypt_blowfish.c +0 -786
- data/ext/mri/crypt_gensalt.c +0 -111
- data/ext/mri/ow-crypt.h +0 -35
- data/ext/mri/wrapper.c +0 -262
- data/lib/bcrypt/engine.rb +0 -120
- data/lib/bcrypt/error.rb +0 -22
- data/lib/bcrypt/password.rb +0 -87
- data/spec/TestBCrypt.java +0 -194
- data/spec/bcrypt/engine_spec.rb +0 -82
- data/spec/bcrypt/error_spec.rb +0 -37
- data/spec/bcrypt/password_spec.rb +0 -123
- data/spec/spec_helper.rb +0 -2
data/CHANGELOG
CHANGED
@@ -54,6 +54,10 @@
|
|
54
54
|
3.1.1 Jul 10 2013
|
55
55
|
- Remove support for Ruby 1.8 in compiled win32 binaries
|
56
56
|
|
57
|
-
3.1.2 Aug
|
57
|
+
3.1.2 Aug 26 2013
|
58
58
|
- Add support for Ruby 1.8 and 2.0 (in addition to 1.9) in compiled Windows binaries
|
59
59
|
- Add support for 64-bit Windows
|
60
|
+
|
61
|
+
3.1.3 Feb 21 2014
|
62
|
+
- Add support for Ruby 2.1 in compiled Windows binaries
|
63
|
+
- Rename gem from "bcrypt-ruby" to just "bcrypt". [GH #86 by @sferik]
|
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
An easy way to keep your users' passwords secure.
|
4
4
|
|
5
|
-
* http://bcrypt-ruby.rubyforge.org/
|
6
5
|
* http://github.com/codahale/bcrypt-ruby/tree/master
|
7
6
|
|
8
7
|
[![Build Status](https://travis-ci.org/codahale/bcrypt-ruby.png?branch=master)](https://travis-ci.org/codahale/bcrypt-ruby)
|
@@ -18,21 +17,21 @@ security experts is not a professional response to risk.
|
|
18
17
|
|
19
18
|
`bcrypt()` allows you to easily harden your application against these kinds of attacks.
|
20
19
|
|
21
|
-
*Note*: JRuby versions of bcrypt
|
20
|
+
*Note*: JRuby versions of the bcrypt gem `<= 2.1.3` had a [security
|
22
21
|
vulnerability](http://www.mindrot.org/files/jBCrypt/internat.adv) that
|
23
22
|
was fixed in `>= 2.1.4`. If you used a vulnerable version to hash
|
24
23
|
passwords with international characters in them, you will need to
|
25
|
-
re-hash those passwords. This
|
24
|
+
re-hash those passwords. This vulnerability only affected the JRuby gem.
|
26
25
|
|
27
26
|
## How to install bcrypt
|
28
27
|
|
29
|
-
gem install bcrypt
|
28
|
+
gem install bcrypt
|
30
29
|
|
31
|
-
The bcrypt
|
30
|
+
The bcrypt gem is available on the following ruby platforms:
|
32
31
|
|
33
32
|
* JRuby
|
34
|
-
* RubyInstaller 1.8, 1.9, and 2.
|
35
|
-
* Any 1.8, 1.9, or 2.
|
33
|
+
* RubyInstaller 1.8, 1.9, 2.0, and 2.1 builds on win32
|
34
|
+
* Any 1.8, 1.9, 2.0, or 2.1 ruby on a BSD/OSX/Linux system with a compiler
|
36
35
|
|
37
36
|
## How to use `bcrypt()` in your Rails application
|
38
37
|
|
data/lib/bcrypt.rb
CHANGED
@@ -1,21 +1,8 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# :stopdoc:
|
2
|
+
# This dummy class is to keep RDoc and YARD from complaining about an empty
|
3
|
+
# lib directory.
|
3
4
|
module BCrypt
|
5
|
+
class Dummy
|
6
|
+
end
|
4
7
|
end
|
5
|
-
|
6
|
-
if RUBY_PLATFORM == "java"
|
7
|
-
require 'java'
|
8
|
-
else
|
9
|
-
require "openssl"
|
10
|
-
end
|
11
|
-
|
12
|
-
begin
|
13
|
-
RUBY_VERSION =~ /(\d+.\d+)/
|
14
|
-
require "#{$1}/bcrypt_ext"
|
15
|
-
rescue LoadError
|
16
|
-
require "bcrypt_ext"
|
17
|
-
end
|
18
|
-
|
19
|
-
require 'bcrypt/error'
|
20
|
-
require 'bcrypt/engine'
|
21
|
-
require 'bcrypt/password'
|
8
|
+
# :startdoc:
|
data/lib/bcrypt_ext.jar
ADDED
Binary file
|
metadata
CHANGED
@@ -1,141 +1,125 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcrypt-ruby
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 3.1.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 3.1.3
|
6
6
|
platform: java
|
7
|
-
authors:
|
8
|
-
- Coda Hale
|
9
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- Coda Hale
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
prerelease: false
|
61
|
-
type: :development
|
62
|
-
description: |2
|
63
|
-
bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project
|
64
|
-
for hashing passwords. bcrypt-ruby provides a simple, humane wrapper for safely handling
|
65
|
-
passwords.
|
12
|
+
|
13
|
+
date: 2014-02-21 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake-compiler
|
17
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.9.2
|
23
|
+
requirement: *id001
|
24
|
+
prerelease: false
|
25
|
+
type: :development
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
requirement: *id002
|
35
|
+
prerelease: false
|
36
|
+
type: :development
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rdoc
|
39
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "3.12"
|
45
|
+
requirement: *id003
|
46
|
+
prerelease: false
|
47
|
+
type: :development
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: bcrypt
|
50
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 3.1.3
|
56
|
+
requirement: *id004
|
57
|
+
prerelease: false
|
58
|
+
type: :runtime
|
59
|
+
description: " bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project\n for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling\n passwords.\n"
|
66
60
|
email: coda.hale@gmail.com
|
67
61
|
executables: []
|
62
|
+
|
68
63
|
extensions: []
|
69
|
-
|
70
|
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
- lib/bcrypt
|
75
|
-
|
76
|
-
- lib/bcrypt
|
77
|
-
|
78
|
-
- .
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
|
84
|
-
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
-
|
90
|
-
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
|
103
|
-
-
|
104
|
-
|
105
|
-
- spec/spec_helper.rb
|
106
|
-
- lib/bcrypt_ext.jar
|
107
|
-
homepage: http://bcrypt-ruby.rubyforge.org
|
108
|
-
licenses:
|
109
|
-
- MIT
|
110
|
-
post_install_message:
|
111
|
-
rdoc_options:
|
112
|
-
- --title
|
113
|
-
- bcrypt-ruby
|
114
|
-
- --line-numbers
|
115
|
-
- --inline-source
|
116
|
-
- --main
|
117
|
-
- README.md
|
118
|
-
require_paths:
|
119
|
-
- lib
|
120
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - '>='
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
segments:
|
125
|
-
- 0
|
126
|
-
hash: 2
|
127
|
-
version: '0'
|
64
|
+
|
65
|
+
extra_rdoc_files:
|
66
|
+
- README.md
|
67
|
+
- COPYING
|
68
|
+
- CHANGELOG
|
69
|
+
- lib/bcrypt.rb
|
70
|
+
files:
|
71
|
+
- lib/bcrypt.rb
|
72
|
+
- ext/mri/extconf.rb
|
73
|
+
- README.md
|
74
|
+
- COPYING
|
75
|
+
- CHANGELOG
|
76
|
+
- lib/bcrypt_ext.jar
|
77
|
+
homepage: https://github.com/codahale/bcrypt-ruby
|
78
|
+
licenses:
|
79
|
+
- MIT
|
80
|
+
post_install_message: |+
|
81
|
+
|
82
|
+
#######################################################
|
83
|
+
|
84
|
+
The bcrypt-ruby gem has changed it's name to just bcrypt. Instead of
|
85
|
+
installing `bcrypt-ruby`, you should install `bcrypt`. Please update your
|
86
|
+
dependencies accordingly.
|
87
|
+
|
88
|
+
#######################################################
|
89
|
+
|
90
|
+
rdoc_options:
|
91
|
+
- --title
|
92
|
+
- bcrypt-ruby
|
93
|
+
- --line-numbers
|
94
|
+
- --inline-source
|
95
|
+
- --main
|
96
|
+
- README.md
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
128
100
|
none: false
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 2
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
109
|
none: false
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
hash: 2
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
version: "0"
|
135
117
|
requirements: []
|
136
|
-
|
118
|
+
|
119
|
+
rubyforge_project:
|
137
120
|
rubygems_version: 1.8.25
|
138
|
-
signing_key:
|
121
|
+
signing_key:
|
139
122
|
specification_version: 3
|
140
123
|
summary: OpenBSD's bcrypt() password hashing algorithm.
|
141
124
|
test_files: []
|
125
|
+
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
bcrypt-ruby (3.1.2.rc1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.2.4)
|
10
|
-
json (1.7.3)
|
11
|
-
json (1.7.3-java)
|
12
|
-
rake (10.1.0)
|
13
|
-
rake-compiler (0.9.1)
|
14
|
-
rake
|
15
|
-
rdoc (3.12)
|
16
|
-
json (~> 1.4)
|
17
|
-
rspec (2.13.0)
|
18
|
-
rspec-core (~> 2.13.0)
|
19
|
-
rspec-expectations (~> 2.13.0)
|
20
|
-
rspec-mocks (~> 2.13.0)
|
21
|
-
rspec-core (2.13.1)
|
22
|
-
rspec-expectations (2.13.0)
|
23
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
24
|
-
rspec-mocks (2.13.1)
|
25
|
-
|
26
|
-
PLATFORMS
|
27
|
-
java
|
28
|
-
ruby
|
29
|
-
x86-mingw32
|
30
|
-
|
31
|
-
DEPENDENCIES
|
32
|
-
bcrypt-ruby!
|
33
|
-
rake-compiler (~> 0.9.0)
|
34
|
-
rdoc
|
35
|
-
rspec
|
data/Rakefile
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
require 'rspec/core/rake_task'
|
2
|
-
require 'rubygems/package_task'
|
3
|
-
require 'rake/extensiontask'
|
4
|
-
require 'rake/javaextensiontask'
|
5
|
-
require 'rake/contrib/rubyforgepublisher'
|
6
|
-
require 'rake/clean'
|
7
|
-
require 'rdoc/task'
|
8
|
-
require 'benchmark'
|
9
|
-
|
10
|
-
CLEAN.include(
|
11
|
-
"ext/mri/*.o",
|
12
|
-
"ext/mri/*.bundle",
|
13
|
-
"ext/mri/*.so",
|
14
|
-
"ext/jruby/bcrypt_jruby/*.class"
|
15
|
-
)
|
16
|
-
CLOBBER.include(
|
17
|
-
"ext/mri/Makefile",
|
18
|
-
"doc/coverage",
|
19
|
-
"pkg"
|
20
|
-
)
|
21
|
-
GEMSPEC = eval(File.read(File.expand_path("../bcrypt-ruby.gemspec", __FILE__)))
|
22
|
-
|
23
|
-
task :default => [:compile, :spec]
|
24
|
-
|
25
|
-
desc "Run all specs"
|
26
|
-
RSpec::Core::RakeTask.new do |t|
|
27
|
-
t.pattern = 'spec/**/*_spec.rb'
|
28
|
-
t.ruby_opts = '-w'
|
29
|
-
end
|
30
|
-
|
31
|
-
desc "Run all specs, with coverage testing"
|
32
|
-
RSpec::Core::RakeTask.new(:rcov) do |t|
|
33
|
-
t.pattern = 'spec/**/*_spec.rb'
|
34
|
-
t.rcov = true
|
35
|
-
t.rcov_path = 'doc/coverage'
|
36
|
-
t.rcov_opts = ['--exclude', 'rspec,diff-lcs,rcov,_spec,_helper']
|
37
|
-
end
|
38
|
-
|
39
|
-
desc 'Generate RDoc'
|
40
|
-
RDoc::Task.new do |rdoc|
|
41
|
-
rdoc.rdoc_dir = 'doc/rdoc'
|
42
|
-
rdoc.options += GEMSPEC.rdoc_options
|
43
|
-
rdoc.template = ENV['TEMPLATE'] if ENV['TEMPLATE']
|
44
|
-
rdoc.rdoc_files.include(*GEMSPEC.extra_rdoc_files)
|
45
|
-
end
|
46
|
-
|
47
|
-
Gem::PackageTask.new(GEMSPEC) do |pkg|
|
48
|
-
pkg.need_zip = true
|
49
|
-
pkg.need_tar = true
|
50
|
-
end
|
51
|
-
|
52
|
-
if RUBY_PLATFORM =~ /java/
|
53
|
-
Rake::JavaExtensionTask.new('bcrypt_ext', GEMSPEC) do |ext|
|
54
|
-
ext.ext_dir = 'ext/jruby'
|
55
|
-
end
|
56
|
-
else
|
57
|
-
Rake::ExtensionTask.new("bcrypt_ext", GEMSPEC) do |ext|
|
58
|
-
ext.ext_dir = 'ext/mri'
|
59
|
-
ext.cross_compile = true
|
60
|
-
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60', 'x64-mingw32']
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
desc "Run a set of benchmarks on the compiled extension."
|
65
|
-
task :benchmark do
|
66
|
-
TESTS = 100
|
67
|
-
TEST_PWD = "this is a test"
|
68
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "lib", "bcrypt"))
|
69
|
-
Benchmark.bmbm do |results|
|
70
|
-
4.upto(10) do |n|
|
71
|
-
results.report("cost #{n}:") { TESTS.times { BCrypt::Password.create(TEST_PWD, :cost => n) } }
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|