bcrypt 3.1.20-java → 3.1.21-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18e51a94af441c07a71cba0f9d5c8e813ed65b0206e6d143784215d43404be78
4
- data.tar.gz: 0f593432119c2166fb96c65786b3bf119d42ecc35d7de1322b7700c81679e3b5
3
+ metadata.gz: 5a53cbea41295650164328d69013dd030f184e4405221806291465a05ab0e250
4
+ data.tar.gz: 94e5c47352fef85517b35effc11b2f41a69849af60bda5338a62e15e0b49a68d
5
5
  SHA512:
6
- metadata.gz: 92e7ac49940ed3c1ac8929da228dc90e48ef9ec12819fe9a83102211f7695c47ad9dd6e7aeb333b6499308556995405c9b7a7fd1b70eb0b12231d070f111f2d3
7
- data.tar.gz: bdbfa55d1c5e8c111b31f3c2bd0d90f4408799af5afcca5d53f2c47604033f991238948905f95f91f16a2f08d315283ceda37ea770cbe612d98170771da24394
6
+ metadata.gz: b43eec31e06923a755e3b133db2c556694b9f084520c600ceffc18f9d406ed250c809d544af5ea396f18a9c3c97d2a6183850cdce19d324bbed8e572cb1b7273
7
+ data.tar.gz: f3ea42a4fd1de528f4d465ff66db582ac20bfbf2841d71c49de2e379bed89bd919e4c70d0298db04638c58f024be48b978dc33c74a5b8c1fe6398eccd0bd4f85
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 3.1.21 Dec 31 2025
2
+ - Use constant time comparisons
3
+ - Mark as Ractor safe
4
+
1
5
  3.1.20 Nov 17 2023
2
6
  - Limit packaged files -- decrease gem filesize by ~28% [GH #272 by @pusewicz]
3
7
 
data/README.md CHANGED
@@ -30,8 +30,8 @@ re-hash those passwords. This vulnerability only affected the JRuby gem.
30
30
  The bcrypt gem is available on the following Ruby platforms:
31
31
 
32
32
  * JRuby
33
- * RubyInstaller 2.0 – 3.0 builds on Windows with the DevKit
34
- * Any 2.0 – 3.0 Ruby on a BSD/OS X/Linux system with a compiler
33
+ * RubyInstaller builds on Windows with the DevKit
34
+ * Any modern Ruby on a BSD/OS X/Linux system with a compiler
35
35
 
36
36
  ## How to use `bcrypt()` in your Rails application
37
37
 
data/ext/mri/bcrypt_ext.c CHANGED
@@ -111,6 +111,10 @@ static VALUE bc_crypt(VALUE self, VALUE key, VALUE setting) {
111
111
 
112
112
  /* Create the BCrypt and BCrypt::Engine modules, and populate them with methods. */
113
113
  void Init_bcrypt_ext(){
114
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
115
+ rb_ext_ractor_safe(true);
116
+ #endif
117
+
114
118
  mBCrypt = rb_define_module("BCrypt");
115
119
  cBCryptEngine = rb_define_class_under(mBCrypt, "Engine", rb_cObject);
116
120
 
@@ -73,8 +73,17 @@ module BCrypt
73
73
  # @password == @password.to_s # => False
74
74
  # @password.to_s == @password # => True
75
75
  # @password.to_s == @password.to_s # => True
76
+ #
77
+ # secret == @password # => probably False, because the secret is not a BCrypt::Password instance.
76
78
  def ==(secret)
77
- super(BCrypt::Engine.hash_secret(secret, @salt))
79
+ hash = BCrypt::Engine.hash_secret(secret, @salt)
80
+
81
+ return false if hash.strip.empty? || strip.empty? || hash.bytesize != bytesize
82
+
83
+ # Constant time comparison so they can't tell the length.
84
+ res = 0
85
+ bytesize.times { |i| res |= getbyte(i) ^ hash.getbyte(i) }
86
+ res == 0
78
87
  end
79
88
  alias_method :is_password?, :==
80
89
 
data/lib/bcrypt_ext.jar CHANGED
Binary file
metadata CHANGED
@@ -1,22 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcrypt
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.20
4
+ version: 3.1.21
5
5
  platform: java
6
6
  authors:
7
7
  - Coda Hale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-17 00:00:00.000000000 Z
11
+ date: 2025-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: rake-compiler
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - "~>"
17
18
  - !ruby/object:Gem::Version
18
19
  version: 1.2.0
19
- name: rake-compiler
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,12 +25,12 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
+ name: rspec
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '3'
33
- name: rspec
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rdoc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 7.0.3
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 7.0.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: benchmark
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 0.5.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.5.0
41
69
  description: |2
42
70
  bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project
43
71
  for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling
@@ -77,7 +105,8 @@ files:
77
105
  homepage: https://github.com/bcrypt-ruby/bcrypt-ruby
78
106
  licenses:
79
107
  - MIT
80
- metadata: {}
108
+ metadata:
109
+ changelog_uri: https://github.com/bcrypt-ruby/bcrypt-ruby/blob/master/CHANGELOG
81
110
  post_install_message:
82
111
  rdoc_options:
83
112
  - "--title"