bcrypt_pbkdf 1.0.0-x64-mingw32 → 1.1.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +7 -4
- data/CHANGELOG.md +1 -1
- data/README.md +19 -2
- data/Rakefile +18 -2
- data/bcrypt_pbkdf.gemspec +6 -7
- data/ext/mri/bcrypt_pbkdf_ext.c +1 -1
- data/ext/mri/includes.h +1 -1
- data/ext/mri/sha2.h +3 -3
- data/lib/2.2/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.3/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.4/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.5/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.6/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.7/bcrypt_pbkdf_ext.so +0 -0
- data/test/bcrypt_pnkdf/engine_test.rb +9 -11
- metadata +22 -33
- data/Gemfile.lock +0 -36
- data/lib/2.0/bcrypt_pbkdf_ext.so +0 -0
- data/lib/2.1/bcrypt_pbkdf_ext.so +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e540fac541e2db1ea7205dd5ea692c79f548287578e61a7ccaa19a08d1b4af9e
|
4
|
+
data.tar.gz: d622b4067dcde8fc4ea463a6a1a263e230a5f7f9a127f0b47c7d62264f0c77b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b78d5adcdcb69bb46880875b781e9c81ccfbfaac67a8c921b0e203cede9cfeb62bff714b038e0a716ad813ca6d4cf4e2fbb4d7f52975306786e5308e635d8482
|
7
|
+
data.tar.gz: 60777f05a32dfde3d0cb0110b35e88061aa5fd6db2b86ac38464e063a17e95184488a884292befe0d45a93c7fffb55019418df1a8e3e1ac5772fd9668fa6fa25
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# bcrypt_pbkdf-ruby
|
2
2
|
|
3
|
-
|
3
|
+
bcrypt_pbkdf is a ruby gem implementing bcrypt_pbkdf from OpenBSD. This is currently used by net-ssh to read password encrypted Ed25519 keys.
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/mfazekas/bcrypt_pbkdf-ruby.png?branch=master)](https://travis-ci.org/mfazekas/bcrypt_pbkdf-ruby)
|
6
6
|
|
@@ -13,3 +13,20 @@ bcrypt_pdkfd is a ruby gem implementing bcrypt_pdkfd from OpenBSD. This is curre
|
|
13
13
|
|
14
14
|
http://www.tedunangst.com/flak/post/bcrypt-pbkdf
|
15
15
|
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libutil/bcrypt_pbkdf.c?rev=1.13&content-type=text/x-cvsweb-markup
|
16
|
+
|
17
|
+
# Building
|
18
|
+
|
19
|
+
For windows cross build make sure you checked out the gem source under the home directory
|
20
|
+
|
21
|
+
```sh
|
22
|
+
gem install rake-compiler-dock
|
23
|
+
```
|
24
|
+
|
25
|
+
```sh
|
26
|
+
bundle exec rake compile
|
27
|
+
bundle exec rake test
|
28
|
+
bundle exec rake clean clobber
|
29
|
+
bundle exec rake gem:windows
|
30
|
+
bundle exec rake release
|
31
|
+
bundle exec rake gem:windows:release
|
32
|
+
```
|
data/Rakefile
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
require 'rake/testtask'
|
2
2
|
require 'rubygems/package_task'
|
3
|
+
require 'bundler/gem_tasks'
|
3
4
|
require 'rake/extensiontask'
|
4
5
|
require 'rake/clean'
|
5
6
|
require 'rdoc/task'
|
6
7
|
require 'benchmark'
|
7
8
|
|
9
|
+
|
8
10
|
CLEAN.include(
|
9
11
|
"tmp",
|
10
12
|
"lib/2.0",
|
11
13
|
"lib/2.1",
|
14
|
+
"lib/2.2",
|
15
|
+
"lib/2.3",
|
16
|
+
"lib/2.4",
|
17
|
+
"lib/2.5",
|
18
|
+
"lib/2.6",
|
19
|
+
"lib/2.7",
|
20
|
+
"lib/3.0",
|
12
21
|
"lib/bcrypt_pbkdf_ext.so"
|
13
22
|
)
|
14
23
|
CLOBBER.include(
|
@@ -18,7 +27,14 @@ CLOBBER.include(
|
|
18
27
|
|
19
28
|
task 'gem:windows' do
|
20
29
|
require 'rake_compiler_dock'
|
21
|
-
|
30
|
+
sh "bundle package" # Avoid repeated downloads of gems by using gem files from the host.
|
31
|
+
RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0"
|
32
|
+
end
|
33
|
+
|
34
|
+
task 'gem:windows:release' do
|
35
|
+
version = Gem::Specification::load("bcrypt_pbkdf.gemspec").version
|
36
|
+
sh "gem push pkg/bcrypt_pbkdf-#{version}-x86-mingw32.gem"
|
37
|
+
sh "gem push pkg/bcrypt_pbkdf-#{version}-x64-mingw32.gem"
|
22
38
|
end
|
23
39
|
|
24
40
|
GEMSPEC = Gem::Specification.load("bcrypt_pbkdf.gemspec")
|
@@ -27,7 +43,7 @@ task :default => [:compile, :spec]
|
|
27
43
|
|
28
44
|
desc "Run all tests"
|
29
45
|
Rake::TestTask.new do |t|
|
30
|
-
#t.pattern =
|
46
|
+
#t.pattern =
|
31
47
|
t.test_files = FileList['test/**/*_test.rb']
|
32
48
|
t.ruby_opts = ['-w']
|
33
49
|
t.libs << "test"
|
data/bcrypt_pbkdf.gemspec
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'bcrypt_pbkdf'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.1.0'
|
4
4
|
|
5
|
-
s.summary = "OpenBSD's
|
5
|
+
s.summary = "OpenBSD's bcrypt_pbkdf (a variant of PBKDF2 with bcrypt-based PRF)"
|
6
6
|
s.description = <<-EOF
|
7
|
-
This gem implements
|
7
|
+
This gem implements bcrypt_pbkdf (a variant of PBKDF2 with bcrypt-based PRF)
|
8
8
|
EOF
|
9
9
|
|
10
10
|
s.files = `git ls-files`.split("\n")
|
11
11
|
s.require_path = 'lib'
|
12
12
|
|
13
|
-
s.add_development_dependency 'rake-compiler', '~>
|
13
|
+
s.add_development_dependency 'rake-compiler', '~> 1.1.0'
|
14
14
|
s.add_development_dependency 'minitest', '>= 5'
|
15
|
-
s.add_development_dependency '
|
16
|
-
s.add_development_dependency 'rbnacl-libsodium', '~> 1.0.8'
|
15
|
+
s.add_development_dependency 'openssl'
|
17
16
|
s.add_development_dependency 'rdoc', '~> 3.12'
|
18
|
-
s.add_development_dependency 'rake-compiler-dock', '~> 0.
|
17
|
+
s.add_development_dependency 'rake-compiler-dock', '~> 1.0.1'
|
19
18
|
|
20
19
|
s.has_rdoc = true
|
21
20
|
s.rdoc_options += ['--title', 'bcrypt_pbkdf', '--line-numbers', '--inline-source', '--main', 'README.md']
|
data/ext/mri/bcrypt_pbkdf_ext.c
CHANGED
@@ -8,7 +8,7 @@ static VALUE cBCryptPbkdfEngine;
|
|
8
8
|
*/
|
9
9
|
static VALUE bc_crypt_pbkdf(VALUE self, VALUE pass, VALUE salt, VALUE keylen, VALUE rounds) {
|
10
10
|
size_t okeylen = NUM2ULONG(keylen);
|
11
|
-
u_int8_t* okey = xmalloc(
|
11
|
+
u_int8_t* okey = xmalloc(okeylen);
|
12
12
|
VALUE out;
|
13
13
|
|
14
14
|
int ret = bcrypt_pbkdf(
|
data/ext/mri/includes.h
CHANGED
data/ext/mri/sha2.h
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
#endif
|
8
8
|
#define SHA512_DIGEST_LENGTH crypto_hash_sha512_BYTES
|
9
9
|
|
10
|
-
inline void SHA512Init(SHA2_CTX* ctx) { crypto_hash_sha512_init(ctx); }
|
11
|
-
inline void SHA512Update(SHA2_CTX* ctx, const void *in, size_t inlen) { crypto_hash_sha512_update(ctx, in, inlen); }
|
12
|
-
inline void SHA512Final(uint8_t* out, SHA2_CTX* ctx) { crypto_hash_sha512_final(ctx, out); }
|
10
|
+
inline static void SHA512Init(SHA2_CTX* ctx) { crypto_hash_sha512_init(ctx); }
|
11
|
+
inline static void SHA512Update(SHA2_CTX* ctx, const void *in, size_t inlen) { crypto_hash_sha512_update(ctx, in, inlen); }
|
12
|
+
inline static void SHA512Final(uint8_t* out, SHA2_CTX* ctx) { crypto_hash_sha512_final(ctx, out); }
|
13
13
|
|
data/lib/2.2/bcrypt_pbkdf_ext.so
CHANGED
Binary file
|
data/lib/2.3/bcrypt_pbkdf_ext.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
require 'test_helper'
|
3
3
|
|
4
|
-
# bcrypt_pbkdf in ruby
|
5
|
-
require '
|
6
|
-
require 'rbnacl'
|
7
|
-
require 'rbnacl/hash'
|
4
|
+
# bcrypt_pbkdf in ruby
|
5
|
+
require 'openssl'
|
8
6
|
|
9
7
|
BCRYPT_BLOCKS = 8
|
10
8
|
BCRYPT_HASHSIZE = BCRYPT_BLOCKS * 4
|
@@ -13,7 +11,7 @@ def bcrypt_pbkdf(password, salt, keylen, rounds)
|
|
13
11
|
stride = (keylen + BCRYPT_HASHSIZE - 1) / BCRYPT_HASHSIZE
|
14
12
|
amt = (keylen + stride - 1) / stride
|
15
13
|
|
16
|
-
sha2pass =
|
14
|
+
sha2pass = OpenSSL::Digest::SHA512.new(password).digest
|
17
15
|
#puts "[RB] sha2pass:#{sha2pass.inspect} #{sha2pass.size}"
|
18
16
|
|
19
17
|
remlen = keylen
|
@@ -32,13 +30,13 @@ def bcrypt_pbkdf(password, salt, keylen, rounds)
|
|
32
30
|
countsalt[saltlen + 3] = (count & 0xff).chr
|
33
31
|
#puts "[RC] countsalt: #{countsalt.inspect} len:#{countsalt.size}"
|
34
32
|
|
35
|
-
sha2salt =
|
33
|
+
sha2salt = OpenSSL::Digest::SHA512.new(countsalt).digest
|
36
34
|
tmpout = BCryptPbkdf::Engine::__bc_crypt_hash(sha2pass, sha2salt)
|
37
35
|
out = tmpout.clone
|
38
36
|
|
39
37
|
#puts "[RB] out: #{out.inspect} keylen:#{remlen} count:#{count}"
|
40
38
|
(1...rounds).each do |i|
|
41
|
-
sha2salt =
|
39
|
+
sha2salt = OpenSSL::Digest::SHA512.new(tmpout).digest
|
42
40
|
tmpout = BCryptPbkdf::Engine::__bc_crypt_hash(sha2pass, sha2salt)
|
43
41
|
out.bytes.each_with_index {|o,j| out.setbyte(j,o ^ tmpout[j].ord) }
|
44
42
|
end
|
@@ -48,7 +46,7 @@ def bcrypt_pbkdf(password, salt, keylen, rounds)
|
|
48
46
|
dest = i * stride + (count -1)
|
49
47
|
key[dest] = out[i] if (dest < keylen)
|
50
48
|
end
|
51
|
-
|
49
|
+
|
52
50
|
remlen -= amt
|
53
51
|
count += 1
|
54
52
|
end
|
@@ -66,13 +64,13 @@ class TestExt < MiniTest::Unit::TestCase
|
|
66
64
|
assert_equal bcrypt_pbkdf(p,s,l,r), BCryptPbkdf::key(p,s,l,r)
|
67
65
|
end
|
68
66
|
end
|
69
|
-
|
67
|
+
|
70
68
|
|
71
69
|
def table
|
72
70
|
[
|
73
|
-
["pass2", "salt2", 12, 2, [214, 14, 48, 162, 131, 206, 121, 176, 50, 104, 231, 252]],
|
71
|
+
["pass2", "salt2", 12, 2, [214, 14, 48, 162, 131, 206, 121, 176, 50, 104, 231, 252]],
|
74
72
|
["\u0000\u0001foo", "\u0001\u0002fooo3", 14, 5, [46, 189, 32, 185, 94, 85, 232, 10, 84, 26, 44, 161, 49, 126]],
|
75
73
|
["doozoasd", "fooo$AS!", 14, 22, [57, 62, 50, 107, 70, 155, 65, 5, 129, 211, 189, 169, 188, 65]]
|
76
74
|
]
|
77
75
|
end
|
78
|
-
end
|
76
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcrypt_pbkdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Miklos Fazekas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.1.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,33 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: openssl
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.3'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.3'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rbnacl-libsodium
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
47
|
+
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rdoc
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,15 +72,15 @@ dependencies:
|
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
75
|
+
version: 1.0.1
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
97
|
-
description: " This gem implements
|
82
|
+
version: 1.0.1
|
83
|
+
description: " This gem implements bcrypt_pbkdf (a variant of PBKDF2 with bcrypt-based
|
98
84
|
PRF)\n"
|
99
85
|
email: mfazekas@szemafor.com
|
100
86
|
executables: []
|
@@ -109,7 +95,6 @@ files:
|
|
109
95
|
- CHANGELOG.md
|
110
96
|
- COPYING
|
111
97
|
- Gemfile
|
112
|
-
- Gemfile.lock
|
113
98
|
- README.md
|
114
99
|
- Rakefile
|
115
100
|
- bcrypt_pbkdf.gemspec
|
@@ -126,10 +111,12 @@ files:
|
|
126
111
|
- ext/mri/sha2.h
|
127
112
|
- ext/mri/util.h
|
128
113
|
- ext/mri/utils.h
|
129
|
-
- lib/2.0/bcrypt_pbkdf_ext.so
|
130
|
-
- lib/2.1/bcrypt_pbkdf_ext.so
|
131
114
|
- lib/2.2/bcrypt_pbkdf_ext.so
|
132
115
|
- lib/2.3/bcrypt_pbkdf_ext.so
|
116
|
+
- lib/2.4/bcrypt_pbkdf_ext.so
|
117
|
+
- lib/2.5/bcrypt_pbkdf_ext.so
|
118
|
+
- lib/2.6/bcrypt_pbkdf_ext.so
|
119
|
+
- lib/2.7/bcrypt_pbkdf_ext.so
|
133
120
|
- lib/bcrypt_pbkdf.rb
|
134
121
|
- test/bcrypt_pnkdf/engine_test.rb
|
135
122
|
- test/test_helper.rb
|
@@ -151,16 +138,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
138
|
requirements:
|
152
139
|
- - ">="
|
153
140
|
- !ruby/object:Gem::Version
|
154
|
-
version: '0'
|
141
|
+
version: '2.0'
|
142
|
+
- - "<"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 3.1.dev
|
155
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
146
|
requirements:
|
157
147
|
- - ">="
|
158
148
|
- !ruby/object:Gem::Version
|
159
149
|
version: '0'
|
160
150
|
requirements: []
|
161
|
-
|
162
|
-
rubygems_version: 2.5.1
|
151
|
+
rubygems_version: 3.1.2
|
163
152
|
signing_key:
|
164
153
|
specification_version: 4
|
165
|
-
summary: OpenBSD's
|
154
|
+
summary: OpenBSD's bcrypt_pbkdf (a variant of PBKDF2 with bcrypt-based PRF)
|
166
155
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
bcrypt_pbkdf (1.0.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
ffi (1.9.10)
|
10
|
-
json (1.8.3)
|
11
|
-
minitest (5.8.3)
|
12
|
-
rake (11.1.1)
|
13
|
-
rake-compiler (0.9.7)
|
14
|
-
rake
|
15
|
-
rake-compiler-dock (0.5.3)
|
16
|
-
rbnacl (3.3.0)
|
17
|
-
ffi
|
18
|
-
rbnacl-libsodium (1.0.8)
|
19
|
-
rbnacl (~> 3.0, >= 3.0.1)
|
20
|
-
rdoc (3.12.2)
|
21
|
-
json (~> 1.4)
|
22
|
-
|
23
|
-
PLATFORMS
|
24
|
-
ruby
|
25
|
-
|
26
|
-
DEPENDENCIES
|
27
|
-
bcrypt_pbkdf!
|
28
|
-
minitest (>= 5)
|
29
|
-
rake-compiler (~> 0.9.7)
|
30
|
-
rake-compiler-dock (~> 0.5.3)
|
31
|
-
rbnacl (~> 3.3)
|
32
|
-
rbnacl-libsodium (~> 1.0.8)
|
33
|
-
rdoc (~> 3.12)
|
34
|
-
|
35
|
-
BUNDLED WITH
|
36
|
-
1.13.6
|
data/lib/2.0/bcrypt_pbkdf_ext.so
DELETED
Binary file
|
data/lib/2.1/bcrypt_pbkdf_ext.so
DELETED
Binary file
|