bcrypt-ruby 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/CHANGELOG +4 -0
- data/README.md +6 -7
- data/lib/bcrypt.rb +6 -19
- metadata +96 -110
- 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
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Y2QyNjA0YzdlZjE2MWY0NjEzOWFiZDhhOGExZjRmZTVmZmEyZGIxNg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MGQ3YmJlNTgyYzYwYjZhYzk4N2M0YmNhMDhkOWVkZDU5MTVhYWQ3NQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MWYwOTU1YzdjNGIwN2M0MDQzYTc2MmRhMDUyYTg5NGQxMmIyM2ExNzJmMTMy
|
10
|
+
MzUxMDUzMjQ1NGUxZTEyNjA1OTMzMjM5OTEzZjVkZjY2NDUyNGMzMDFiOGQ0
|
11
|
+
NWE0OGE2N2IzOWY5ZDQ2MmM1NmE5ZDZkZGQ5ODgzNTdkNzkyODc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YzhmNzYyODUyMGFmYzBmN2E2NDU0YjAzMWNkZjc3OTI0ZmJhM2U4MTBkYjFk
|
14
|
+
Yzg4Yjg5YzJlNDM3NGY0NDRmOTc2YWE2YjcwYjM5MzUxNjk2NDAxOWVmMWMy
|
15
|
+
NDcyMDZhMWM4ZjQ5ZjA0NTAwODAxMzYxYWIxNzkyYjgxOGUyY2I=
|
data/CHANGELOG
CHANGED
@@ -57,3 +57,7 @@
|
|
57
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
|
[](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:
|
metadata
CHANGED
@@ -1,146 +1,132 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcrypt-ruby
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 3.1.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.1.3
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Coda Hale
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
|
-
requirements:
|
24
|
-
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 59
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
- 9
|
30
|
-
- 0
|
31
|
-
version: 0.9.0
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
32
14
|
name: rake-compiler
|
33
|
-
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.9.2
|
34
20
|
type: :development
|
35
|
-
requirement: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 3
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
46
|
-
name: rspec
|
47
21
|
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
48
34
|
type: :development
|
49
|
-
requirement: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
|
-
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
hash: 3
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
version: "0"
|
60
|
-
name: rdoc
|
61
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rdoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.12'
|
62
48
|
type: :development
|
63
|
-
|
64
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bcrypt
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.1.3
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.1.3
|
69
|
+
description: ! " bcrypt() is a sophisticated and secure hash algorithm designed
|
70
|
+
by The OpenBSD project\n for hashing passwords. The bcrypt Ruby gem provides
|
71
|
+
a simple wrapper for safely handling\n passwords.\n"
|
65
72
|
email: coda.hale@gmail.com
|
66
73
|
executables: []
|
67
|
-
|
68
|
-
extensions:
|
74
|
+
extensions:
|
69
75
|
- ext/mri/extconf.rb
|
70
|
-
extra_rdoc_files:
|
76
|
+
extra_rdoc_files:
|
71
77
|
- README.md
|
72
78
|
- COPYING
|
73
79
|
- CHANGELOG
|
74
|
-
- lib/bcrypt/engine.rb
|
75
|
-
- lib/bcrypt/error.rb
|
76
|
-
- lib/bcrypt/password.rb
|
77
80
|
- lib/bcrypt.rb
|
78
|
-
files:
|
79
|
-
- .gitignore
|
80
|
-
- .rspec
|
81
|
-
- .travis.yml
|
81
|
+
files:
|
82
82
|
- CHANGELOG
|
83
83
|
- COPYING
|
84
|
-
- Gemfile
|
85
|
-
- Gemfile.lock
|
86
84
|
- README.md
|
87
|
-
- Rakefile
|
88
|
-
- bcrypt-ruby.gemspec
|
89
|
-
- ext/jruby/bcrypt_jruby/BCrypt.java
|
90
|
-
- ext/mri/bcrypt_ext.c
|
91
|
-
- ext/mri/crypt.c
|
92
|
-
- ext/mri/crypt.h
|
93
|
-
- ext/mri/crypt_blowfish.c
|
94
|
-
- ext/mri/crypt_gensalt.c
|
95
85
|
- ext/mri/extconf.rb
|
96
|
-
- ext/mri/ow-crypt.h
|
97
|
-
- ext/mri/wrapper.c
|
98
86
|
- lib/bcrypt.rb
|
99
|
-
|
100
|
-
|
101
|
-
- lib/bcrypt/password.rb
|
102
|
-
- spec/TestBCrypt.java
|
103
|
-
- spec/bcrypt/engine_spec.rb
|
104
|
-
- spec/bcrypt/error_spec.rb
|
105
|
-
- spec/bcrypt/password_spec.rb
|
106
|
-
- spec/spec_helper.rb
|
107
|
-
homepage: http://bcrypt-ruby.rubyforge.org
|
108
|
-
licenses:
|
87
|
+
homepage: https://github.com/codahale/bcrypt-ruby
|
88
|
+
licenses:
|
109
89
|
- MIT
|
110
|
-
|
111
|
-
|
90
|
+
metadata: {}
|
91
|
+
post_install_message: ! '
|
92
|
+
|
93
|
+
#######################################################
|
94
|
+
|
95
|
+
|
96
|
+
The bcrypt-ruby gem has changed it''s name to just bcrypt. Instead of
|
97
|
+
|
98
|
+
installing `bcrypt-ruby`, you should install `bcrypt`. Please update your
|
99
|
+
|
100
|
+
dependencies accordingly.
|
101
|
+
|
102
|
+
|
103
|
+
#######################################################
|
104
|
+
|
105
|
+
|
106
|
+
'
|
107
|
+
rdoc_options:
|
112
108
|
- --title
|
113
109
|
- bcrypt-ruby
|
114
110
|
- --line-numbers
|
115
111
|
- --inline-source
|
116
112
|
- --main
|
117
113
|
- README.md
|
118
|
-
require_paths:
|
114
|
+
require_paths:
|
119
115
|
- lib
|
120
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
none: false
|
131
|
-
requirements:
|
132
|
-
- - ">="
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
hash: 3
|
135
|
-
segments:
|
136
|
-
- 0
|
137
|
-
version: "0"
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
138
126
|
requirements: []
|
139
|
-
|
140
|
-
|
141
|
-
rubygems_version: 1.8.25
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 2.2.2
|
142
129
|
signing_key:
|
143
|
-
specification_version:
|
130
|
+
specification_version: 4
|
144
131
|
summary: OpenBSD's bcrypt() password hashing algorithm.
|
145
132
|
test_files: []
|
146
|
-
|
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)
|
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
|