argon2id 0.4.1-x86-mingw32 → 0.5.0-x86-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
2
  SHA256:
3
- metadata.gz: 61703f0c45ba1772eb200e750ad983c393303980976db0ba2e7fe098379bbaf4
4
- data.tar.gz: 1131d5fe677ce3a9672be25c81456ec64fa34d04189b5b4dc094e7533b67e606
3
+ metadata.gz: 628a0772937fdcfd9ee6392daa47568746591a8fbbc0ed7e83242f455c34a734
4
+ data.tar.gz: d87608622be72ba935c69d2f27ddaa1d6fb0c2973705217088ee9624ed2a579b
5
5
  SHA512:
6
- metadata.gz: cd637bb369673f60b112e70c1f7066abed01a0ead5b0eaf6a99dbb3156e9a15574de22cf88b1f444e948e1348a66d46177a1e25f42731a9c5fc918bbc0e13053
7
- data.tar.gz: 45962e75ce7b1989ff702e846ec40a2486a63e7eed783550ffce56ad5312c00a79c036f8d413fcb20014587819f6bbb88d3e8128137411da166789926a6a12b4
6
+ metadata.gz: 460f0d74f5b2c573c0a0df4bb26d5dd2027adfd2838c3587cd324196c31580b51552091ccaa6ee457d59663db251dda030421ba2afa74460a4cf581601844675
7
+ data.tar.gz: 53f8487e39cd55e21f4de4dcef5a7d0dc55da4d67ae07dd0eab74f657df4e50f0554bd6dbafae487530e454e5f777a61b030c873a003cb493151425095955143
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.5.0] - 2024-11-02
9
+
10
+ ### Removed
11
+
12
+ - No longer expose the `type` of an encoded hash as it must always be an
13
+ Argon2id hash
14
+
8
15
  ## [0.4.1] - 2024-11-02
9
16
 
10
17
  ### Changed
@@ -86,6 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
86
93
  reference C implementation of Argon2, the password-hashing function that won
87
94
  the Password Hashing Competition.
88
95
 
96
+ [0.5.0]: https://github.com/mudge/argon2id/releases/tag/v0.5.0
89
97
  [0.4.1]: https://github.com/mudge/argon2id/releases/tag/v0.4.1
90
98
  [0.4.0]: https://github.com/mudge/argon2id/releases/tag/v0.4.0
91
99
  [0.3.0]: https://github.com/mudge/argon2id/releases/tag/v0.3.0
data/README.md CHANGED
@@ -5,7 +5,7 @@ Ruby bindings to [Argon2][], the password-hashing function that won the 2015
5
5
 
6
6
  [![Build Status](https://github.com/mudge/argon2id/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/mudge/argon2id/actions)
7
7
 
8
- **Current version:** 0.4.1
8
+ **Current version:** 0.5.0
9
9
  **Bundled Argon2 version:** libargon2.1 (20190702)
10
10
 
11
11
  ```ruby
@@ -135,6 +135,10 @@ password == "opensesame" #=> true
135
135
  password == "notopensesame" #=> false
136
136
  ```
137
137
 
138
+ > [!WARNING]
139
+ > `Argon2id::Password.new` does not support hashes generated from other Argon2
140
+ > variants such as Argon2i and Argon2d.
141
+
138
142
  For compatibility with [bcrypt-ruby][], `Argon2id::Password#==` is aliased to `Argon2id::Password.is_password?`:
139
143
 
140
144
  ```ruby
@@ -147,7 +151,6 @@ The various parts of the encoded hash can be retrieved:
147
151
 
148
152
  ```ruby
149
153
  password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
150
- password.type #=> "argon2id"
151
154
  password.version #=> 19
152
155
  password.m_cost #=> 256
153
156
  password.t_cost #=> 2
@@ -198,11 +201,11 @@ notes](https://github.com/mudge/argon2id/releases) for each version and can be
198
201
  checked with `sha256sum`, e.g.
199
202
 
200
203
  ```console
201
- $ gem fetch argon2id -v 0.4.0
202
- Fetching argon2id-0.4.0-arm64-darwin.gem
203
- Downloaded argon2id-0.4.0-arm64-darwin
204
- $ sha256sum argon2id-0.4.0-arm64-darwin.gem
205
- 2cecd6d5a1ecaf0a025e95714c0dee22dfc3d4585b649c57c06f432031b55a77 argon2id-0.4.0-arm64-darwin.gem
204
+ $ gem fetch argon2id -v 0.4.1
205
+ Fetching argon2id-0.4.1-arm64-darwin.gem
206
+ Downloaded argon2id-0.4.1-arm64-darwin
207
+ $ sha256sum argon2id-0.4.1-arm64-darwin.gem
208
+ c74c06c2c4ce70d6c3822f05d83bab4ea431dd16ec086c9c856da3c6e0d9bbe9 argon2id-0.4.1-arm64-darwin.gem
206
209
  ```
207
210
 
208
211
  [GPG](https://www.gnupg.org/) signatures are attached to each release (the
@@ -212,8 +215,8 @@ from a public keyserver, e.g. `gpg --keyserver keyserver.ubuntu.com --recv-key
212
215
  0x39AC3530070E0F75`):
213
216
 
214
217
  ```console
215
- $ gpg --verify argon2id-0.4.0-arm64-darwin.gem.sig argon2id-0.4.0-arm64-darwin.gem
216
- gpg: Signature made Sat 2 Nov 15:25:15 2024 GMT
218
+ $ gpg --verify argon2id-0.4.1-arm64-darwin.gem.sig argon2id-0.4.1-arm64-darwin.gem
219
+ gpg: Signature made Sat 2 Nov 20:50:54 2024 GMT
217
220
  gpg: using RSA key 702609D9C790F45B577D7BEC39AC3530070E0F75
218
221
  gpg: Good signature from "Paul Mucur <mudge@mudge.name>" [unknown]
219
222
  gpg: aka "Paul Mucur <paul@ghostcassette.com>" [unknown]
data/lib/2.6/argon2id.so CHANGED
Binary file
data/lib/2.7/argon2id.so CHANGED
Binary file
data/lib/3.0/argon2id.so CHANGED
Binary file
data/lib/3.1/argon2id.so CHANGED
Binary file
data/lib/3.2/argon2id.so CHANGED
Binary file
data/lib/3.3/argon2id.so CHANGED
Binary file
@@ -25,7 +25,6 @@ module Argon2id
25
25
  #
26
26
  # You can read various parameters out of a password hash:
27
27
  #
28
- # password.type #=> "argon2id"
29
28
  # password.version #=> 19
30
29
  # password.m_cost #=> 19456
31
30
  # password.t_cost #=> 2
@@ -36,7 +35,7 @@ module Argon2id
36
35
  PATTERN = %r{
37
36
  \A
38
37
  \$
39
- (argon2(?:id|i|d))
38
+ argon2id
40
39
  (?:\$v=(\d+))?
41
40
  \$m=(\d+)
42
41
  ,t=(\d+)
@@ -51,9 +50,6 @@ module Argon2id
51
50
  # The encoded password hash.
52
51
  attr_reader :encoded
53
52
 
54
- # The type of the hashing function.
55
- attr_reader :type
56
-
57
53
  # The version number of the hashing function.
58
54
  attr_reader :version
59
55
 
@@ -113,13 +109,12 @@ module Argon2id
113
109
  raise ArgumentError, "invalid hash" unless PATTERN =~ String(encoded)
114
110
 
115
111
  @encoded = $&
116
- @type = $1
117
- @version = Integer($2 || 0x10)
118
- @m_cost = Integer($3)
119
- @t_cost = Integer($4)
120
- @parallelism = Integer($5)
121
- @salt = $6.unpack1("m")
122
- @output = $7.unpack1("m")
112
+ @version = Integer($1 || 0x10)
113
+ @m_cost = Integer($2)
114
+ @t_cost = Integer($3)
115
+ @parallelism = Integer($4)
116
+ @salt = $5.unpack1("m")
117
+ @output = $6.unpack1("m")
123
118
  end
124
119
 
125
120
  # Return the encoded password hash.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Argon2id
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -98,6 +98,12 @@ class TestPassword < Minitest::Test
98
98
  end
99
99
  end
100
100
 
101
+ def test_raises_for_non_argon2id_hashes
102
+ assert_raises(ArgumentError) do
103
+ Argon2id::Password.new("$argon2i$v=19$m=256,t=2,p=1$c29tZXNhbHQ$iekCn0Y3spW+sCcFanM2xBT63UP2sghkUoHLIUpWRS8")
104
+ end
105
+ end
106
+
101
107
  def test_salt_supports_versionless_hashes
102
108
  password = Argon2id::Password.new("$argon2id$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
103
109
 
@@ -110,18 +116,6 @@ class TestPassword < Minitest::Test
110
116
  assert Argon2id::Password.new(password) == "password"
111
117
  end
112
118
 
113
- def test_extracting_type_from_hash
114
- password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
115
-
116
- assert_equal "argon2id", password.type
117
- end
118
-
119
- def test_extracting_type_from_argoni_hash
120
- password = Argon2id::Password.new("$argon2i$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
121
-
122
- assert_equal "argon2i", password.type
123
- end
124
-
125
119
  def test_extracting_version_from_hash
126
120
  password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
127
121
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argon2id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Paul Mucur