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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0b57505bd496a5217b20bd7f7b869bb9253591fc
4
- data.tar.gz: f19d53707b3f8d055227ae93215a19c1f31b1217
2
+ SHA256:
3
+ metadata.gz: e540fac541e2db1ea7205dd5ea692c79f548287578e61a7ccaa19a08d1b4af9e
4
+ data.tar.gz: d622b4067dcde8fc4ea463a6a1a263e230a5f7f9a127f0b47c7d62264f0c77b6
5
5
  SHA512:
6
- metadata.gz: a073176b163c9bfd17d29eb2c29d695a1eb5ec7785d353f5e649754ace51826153062a1e7dfc7db0b81858911c8502e926e0d470ddbf59963105d472d37c3e24
7
- data.tar.gz: 20823d9a7bbbf1666141a6f04c5c97337a7c65242ed3c7d74f3c2fb4c7bfaf86f7f79083703dc46359b8acce180265a69cd873888e3046b18614d6c1c644083e
6
+ metadata.gz: b78d5adcdcb69bb46880875b781e9c81ccfbfaac67a8c921b0e203cede9cfeb62bff714b038e0a716ad813ca6d4cf4e2fbb4d7f52975306786e5308e635d8482
7
+ data.tar.gz: 60777f05a32dfde3d0cb0110b35e88061aa5fd6db2b86ac38464e063a17e95184488a884292befe0d45a93c7fffb55019418df1a8e3e1ac5772fd9668fa6fa25
@@ -1,8 +1,11 @@
1
1
  language: ruby
2
+ arch:
3
+ - amd64
4
+ - ppc64le
2
5
  rvm:
3
- - 2.0.0
4
- - 2.1.0
5
- - 2.2.0
6
6
  - 2.3.0
7
- - rbx-2
7
+ - 2.4.0
8
+ - 2.5.0
9
+ - 2.6.0
10
+ - 2.7.0
8
11
  script: bundle exec rake
@@ -1,3 +1,3 @@
1
1
  # 1.0.0.apha1
2
2
 
3
- inital version
3
+ initial version
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # bcrypt_pdkfd-ruby
1
+ # bcrypt_pbkdf-ruby
2
2
 
3
- bcrypt_pdkfd is a ruby gem implementing bcrypt_pdkfd from OpenBSD. This is currently used by net-ssh to read password encrypted Ed25519 keys.
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
- RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6:2.0.0"
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"
@@ -1,21 +1,20 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'bcrypt_pbkdf'
3
- s.version = '1.0.0'
3
+ s.version = '1.1.0'
4
4
 
5
- s.summary = "OpenBSD's bcrypt_pdkfd (a variant of PBKDF2 with bcrypt-based PRF)"
5
+ s.summary = "OpenBSD's bcrypt_pbkdf (a variant of PBKDF2 with bcrypt-based PRF)"
6
6
  s.description = <<-EOF
7
- This gem implements bcrypt_pdkfd (a variant of PBKDF2 with bcrypt-based PRF)
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', '~> 0.9.7'
13
+ s.add_development_dependency 'rake-compiler', '~> 1.1.0'
14
14
  s.add_development_dependency 'minitest', '>= 5'
15
- s.add_development_dependency 'rbnacl', '~> 3.3'
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.5.3'
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']
@@ -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(keylen);
11
+ u_int8_t* okey = xmalloc(okeylen);
12
12
  VALUE out;
13
13
 
14
14
  int ret = bcrypt_pbkdf(
@@ -6,7 +6,7 @@
6
6
  #include <stdlib.h>
7
7
  #include <strings.h>
8
8
 
9
- #if defined(_WIN32)
9
+ #if defined(_WIN32) || (defined(__sun) && defined(__SVR4))
10
10
 
11
11
  typedef uint8_t u_int8_t;
12
12
  typedef uint16_t u_int16_t;
@@ -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
 
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 using libsodium
5
- require 'rbnacl/libsodium'
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 = RbNaCl::Hash.sha512(password)
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 = RbNaCl::Hash.sha512(countsalt)
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 = RbNaCl::Hash.sha512(tmpout)
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.0.0
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: 2016-11-25 00:00:00.000000000 Z
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: 0.9.7
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: 0.9.7
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: rbnacl
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: 1.0.8
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: 1.0.8
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.5.3
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.5.3
97
- description: " This gem implements bcrypt_pdkfd (a variant of PBKDF2 with bcrypt-based
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
- rubyforge_project:
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 bcrypt_pdkfd (a variant of PBKDF2 with bcrypt-based PRF)
154
+ summary: OpenBSD's bcrypt_pbkdf (a variant of PBKDF2 with bcrypt-based PRF)
166
155
  test_files: []
@@ -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
Binary file
Binary file