argon2 2.1.1 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 933cdf134b0ac4110cda1cd9a8108a75c0dc6d80e6d2cb68446d93b1898f298a
4
- data.tar.gz: bcb1c0d25d2a074c59ad5002e2078d0aa344480022f9a658eb297dcbd16b1eb6
3
+ metadata.gz: 117208813bd32c3221d1553b236a99c1bdff7bb67b2043df81f3d6da452c0673
4
+ data.tar.gz: cd12a36287b85e5406bbdeaa9e92a69051c6f1877560063ac38acedcaf1aaa6d
5
5
  SHA512:
6
- metadata.gz: d17d3f5c0a9162dca09db8ab7a9926becc50ace4527d2ad705db80d44ffdc528d3110853885ee5c042b5142c5cd619fd8c93d6a7dec75fc70d41fbb40661f259
7
- data.tar.gz: 91fb841e70a470bf760871690c216ae4f305442a063b4c5a5c861fe97510c226db5f8db92cc65e8a93ea459fd42ac735bd216e2dfb333fc334f1e3f21cba3bbf
6
+ metadata.gz: adc5da0bf66689aa8d601521b0aebaf2a25c467d5c9e8d1d81fbb1efa6882f75d7330f25221b21b789dd6a34359a1af08aa4a49d188718aada38c4acec3b1690
7
+ data.tar.gz: 57484f607bca24b01fb63e4892037333fc089a0fd253e1771d2cf0b0f06aa18339108fd8d796bbca8201bca2e48e5729551803f92d74601449fd1082a002a7a5
@@ -0,0 +1,74 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "master" ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ "master" ]
20
+ schedule:
21
+ - cron: '34 3 * * 3'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+
52
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53
+ # queries: security-extended,security-and-quality
54
+
55
+
56
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
57
+ # If this step fails, then you should remove it and run the build manually (see below)
58
+ - name: Autobuild
59
+ uses: github/codeql-action/autobuild@v2
60
+
61
+ # ℹ️ Command-line programs to run using the OS shell.
62
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63
+
64
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
65
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66
+
67
+ # - run: |
68
+ # echo "Run, Build Application using script"
69
+ # ./location_of_script_within_repo/buildscript.sh
70
+
71
+ - name: Perform CodeQL Analysis
72
+ uses: github/codeql-action/analyze@v2
73
+ with:
74
+ category: "/language:${{matrix.language}}"
@@ -13,10 +13,9 @@ jobs:
13
13
  - ubuntu
14
14
  - macos
15
15
  ruby:
16
- - 2.6
17
16
  - 2.7
18
- - 3.0
19
- - head
17
+ - 3.1
18
+ - 3.2
20
19
 
21
20
  runs-on: ${{ matrix.os }}-latest
22
21
 
data/.rubocop.yml CHANGED
@@ -210,8 +210,6 @@ Style/RedundantArgument: # (new in 1.4)
210
210
  Enabled: true
211
211
  Style/SwapValues: # (new in 1.1)
212
212
  Enabled: true
213
- Gemspec/DateAssignment: # (new in 1.10)
214
- Enabled: true
215
213
  Lint/DeprecatedConstants: # (new in 1.8)
216
214
  Enabled: true
217
215
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
@@ -234,3 +232,83 @@ Style/IfWithBooleanLiteralBranches: # (new in 1.9)
234
232
  Enabled: true
235
233
  Style/StringChars: # (new in 1.12)
236
234
  Enabled: true
235
+ Gemspec/DeprecatedAttributeAssignment: # new in 1.30
236
+ Enabled: true
237
+ Gemspec/RequireMFA: # new in 1.23
238
+ Enabled: true
239
+ Layout/LineContinuationLeadingSpace: # new in 1.31
240
+ Enabled: true
241
+ Layout/LineContinuationSpacing: # new in 1.31
242
+ Enabled: true
243
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
244
+ Enabled: true
245
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
246
+ Enabled: true
247
+ Lint/AmbiguousRange: # new in 1.19
248
+ Enabled: true
249
+ Lint/ConstantOverwrittenInRescue: # new in 1.31
250
+ Enabled: true
251
+ Lint/DuplicateMagicComment: # new in 1.37
252
+ Enabled: true
253
+ Lint/EmptyInPattern: # new in 1.16
254
+ Enabled: true
255
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
256
+ Enabled: true
257
+ Lint/NonAtomicFileOperation: # new in 1.31
258
+ Enabled: true
259
+ Lint/RefinementImportMethods: # new in 1.27
260
+ Enabled: true
261
+ Lint/RequireRangeParentheses: # new in 1.32
262
+ Enabled: true
263
+ Lint/RequireRelativeSelfPath: # new in 1.22
264
+ Enabled: true
265
+ Lint/UselessRuby2Keywords: # new in 1.23
266
+ Enabled: true
267
+ Naming/BlockForwarding: # new in 1.24
268
+ Enabled: true
269
+ Security/CompoundHash: # new in 1.28
270
+ Enabled: true
271
+ Security/IoMethods: # new in 1.22
272
+ Enabled: true
273
+ Style/EmptyHeredoc: # new in 1.32
274
+ Enabled: true
275
+ Style/EnvHome: # new in 1.29
276
+ Enabled: true
277
+ Style/FetchEnvVar: # new in 1.28
278
+ Enabled: true
279
+ Style/FileRead: # new in 1.24
280
+ Enabled: true
281
+ Style/FileWrite: # new in 1.24
282
+ Enabled: true
283
+ Style/InPatternThen: # new in 1.16
284
+ Enabled: true
285
+ Style/MagicCommentFormat: # new in 1.35
286
+ Enabled: true
287
+ Style/MapCompactWithConditionalBlock: # new in 1.30
288
+ Enabled: true
289
+ Style/MapToHash: # new in 1.24
290
+ Enabled: true
291
+ Style/MultilineInPatternThen: # new in 1.16
292
+ Enabled: true
293
+ Style/NestedFileDirname: # new in 1.26
294
+ Enabled: true
295
+ Style/NumberedParameters: # new in 1.22
296
+ Enabled: true
297
+ Style/NumberedParametersLimit: # new in 1.22
298
+ Enabled: true
299
+ Style/ObjectThen: # new in 1.28
300
+ Enabled: true
301
+ Style/OpenStructUse: # new in 1.23
302
+ Enabled: true
303
+ Style/OperatorMethodCall: # new in 1.37
304
+ Enabled: true
305
+ Style/QuotedSymbols: # new in 1.16
306
+ Enabled: true
307
+ Style/RedundantInitialize: # new in 1.27
308
+ Enabled: true
309
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
310
+ Enabled: true
311
+ Style/RedundantStringEscape: # new in 1.37
312
+ Enabled: true
313
+ Style/SelectByRegexp: # new in 1.22
314
+ Enabled: true
data/README.md CHANGED
@@ -13,7 +13,7 @@ This project has several key tenets to its design:
13
13
  * The reference Argon2 implementation is to be used "unaltered". To ensure compliance with this goal, and encourage regular updates from upstream, the upstream library is implemented as a git submodule, and is intended to stay that way.
14
14
  * The FFI interface is kept as slim as possible, with wrapper classes preferred to implementing context structs in FFI
15
15
  * Security and maintainability take top priority. This can have an impact on platform support. A PR that contains platform specific code paths is unlikely to be accepted.
16
- * Tested platforms are MRI Ruby 2.2, 2.3 and JRuby 9000. No assertions are made on other platforms.
16
+ * Tested platforms are MRI Ruby 2.7 and 3.0. No assertions are made on other platforms.
17
17
  * Errors from the C interface are raised as Exceptions. There are a lot of exception classes, but they tend to relate to things like very broken input, and code bugs. Calls to this library should generally not require a rescue.
18
18
  * Test suites should aim for 100% code coverage.
19
19
  * Default work values should not be considered constants. I will increase them from time to time.
data/argon2.gemspec CHANGED
@@ -17,14 +17,17 @@ Gem::Specification.new do |spec|
17
17
  spec.description = 'Argon2 FFI binding'
18
18
  spec.homepage = 'https://github.com/technion/ruby-argon2'
19
19
  spec.license = 'MIT'
20
+ spec.metadata = {
21
+ 'rubygems_mfa_required' => 'true'
22
+ }
20
23
 
21
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
25
  spec.files << `find ext`.split
23
26
 
24
27
  spec.bindir = "exe"
25
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
29
  spec.require_paths = ["lib"]
27
- spec.add_dependency 'ffi', '~> 1.14'
30
+ spec.add_dependency 'ffi', '~> 1.15'
28
31
  spec.add_dependency 'ffi-compiler', '~> 1.0'
29
32
 
30
33
  spec.add_development_dependency "bundler", '~> 2.0'
@@ -33,6 +36,6 @@ Gem::Specification.new do |spec|
33
36
  spec.add_development_dependency "rubocop", '~> 1.7'
34
37
  spec.add_development_dependency "simplecov", '~> 0.20'
35
38
  spec.add_development_dependency "simplecov-lcov", '~> 0.8'
36
- spec.add_development_dependency "steep", "~> 0.43.1"
39
+ spec.add_development_dependency "steep", "~> 1.2.1"
37
40
  spec.extensions << 'ext/argon2_wrap/extconf.rb'
38
41
  end
Binary file
@@ -83,7 +83,7 @@ ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),DragonFly FreeBSD NetBSD OpenBSD))
83
83
  endif
84
84
  ifeq ($(KERNEL_NAME), Darwin)
85
85
  LIB_EXT := $(ABI_VERSION).dylib
86
- LIB_CFLAGS := -dynamiclib -install_name @rpath/lib$(LIB_NAME).$(LIB_EXT)
86
+ LIB_CFLAGS = -dynamiclib -install_name $(PREFIX)/$(LIBRARY_REL)/lib$(LIB_NAME).$(LIB_EXT)
87
87
  LINKED_LIB_EXT := dylib
88
88
  PC_EXTRA_LIBS ?=
89
89
  endif
@@ -0,0 +1,46 @@
1
+ // swift-tools-version:5.3
2
+
3
+ import PackageDescription
4
+
5
+ let package = Package(
6
+ name: "argon2",
7
+ products: [
8
+ .library(
9
+ name: "argon2",
10
+ targets: ["argon2"]),
11
+ ],
12
+ targets: [
13
+ .target(
14
+ name: "argon2",
15
+ path: ".",
16
+ exclude: [
17
+ "kats",
18
+ "vs2015",
19
+ "latex",
20
+ "libargon2.pc.in",
21
+ "export.sh",
22
+ "appveyor.yml",
23
+ "Argon2.sln",
24
+ "argon2-specs.pdf",
25
+ "CHANGELOG.md",
26
+ "LICENSE",
27
+ "Makefile",
28
+ "man",
29
+ "README.md",
30
+ "src/bench.c",
31
+ "src/genkat.c",
32
+ "src/opt.c",
33
+ "src/run.c",
34
+ "src/test.c",
35
+ ],
36
+ sources: [
37
+ "src/blake2/blake2b.c",
38
+ "src/argon2.c",
39
+ "src/core.c",
40
+ "src/encoding.c",
41
+ "src/ref.c",
42
+ "src/thread.c"
43
+ ]
44
+ )
45
+ ]
46
+ )
@@ -44,9 +44,11 @@ Please report bugs as issues on this repository.
44
44
  ## Usage
45
45
 
46
46
  `make` builds the executable `argon2`, the static library `libargon2.a`,
47
- and the shared library `libargon2.so` (or `libargon2.dylib` on OSX).
48
- Make sure to run `make test` to verify that your build produces valid
49
- results. `make install PREFIX=/usr` installs it to your system.
47
+ and the shared library `libargon2.so` (or on macOS, the dynamic library
48
+ `libargon2.dylib` -- make sure to specify the installation prefix when
49
+ you compile: `make PREFIX=/usr`). Make sure to run `make test` to verify
50
+ that your build produces valid results. `sudo make install PREFIX=/usr`
51
+ installs it to your system.
50
52
 
51
53
  ### Command-line utility
52
54
 
@@ -148,7 +150,7 @@ int main(void)
148
150
  uint8_t *pwd = (uint8_t *)strdup(PWD);
149
151
  uint32_t pwdlen = strlen((char *)pwd);
150
152
 
151
- uint32_t t_cost = 2; // 1-pass computation
153
+ uint32_t t_cost = 2; // 2-pass computation
152
154
  uint32_t m_cost = (1<<16); // 64 mebibytes memory usage
153
155
  uint32_t parallelism = 1; // number of threads and lanes
154
156
 
@@ -244,6 +246,7 @@ Bindings are available for the following languages (make sure to read
244
246
  their documentation):
245
247
 
246
248
  * [Android (Java/Kotlin)](https://github.com/lambdapioneer/argon2kt) by [@lambdapioneer](https://github.com/lambdapioneer)
249
+ * [Dart](https://github.com/tmthecoder/dargon2) by [@tmthecoder](https://github.com/tmthecoder)
247
250
  * [Elixir](https://github.com/riverrun/argon2_elixir) by [@riverrun](https://github.com/riverrun)
248
251
  * [Erlang](https://github.com/ergenius/eargon2) by [@ergenius](https://github.com/ergenius)
249
252
  * [Go](https://github.com/tvdburgt/go-argon2) by [@tvdburgt](https://github.com/tvdburgt)
@@ -269,6 +272,7 @@ their documentation):
269
272
  * [Perl](https://github.com/Leont/crypt-argon2) by [@leont](https://github.com/Leont)
270
273
  * [mruby](https://github.com/Asmod4n/mruby-argon2) by [@Asmod4n](https://github.com/Asmod4n)
271
274
  * [Swift](https://github.com/ImKcat/CatCrypto) by [@ImKcat](https://github.com/ImKcat)
275
+ * [Swift](https://github.com/tmthecoder/Argon2Swift) by [@tmthecoder](https://github.com/tmthecoder)
272
276
 
273
277
 
274
278
  ## Test suite
@@ -3,5 +3,5 @@
3
3
  # Standard Gem version constant.
4
4
 
5
5
  module Argon2
6
- VERSION = "2.1.1"
6
+ VERSION = "2.1.3"
7
7
  end
data/sig/argon2.rbs CHANGED
@@ -7,10 +7,15 @@ module Argon2
7
7
  @salt: nil | String
8
8
  @secret: nil | String
9
9
 
10
- def initialize: (?Hash[Symbol, Integer] options) -> (nil | String)
10
+ def initialize: (?::Hash[untyped, untyped] options) -> void
11
11
  def create: (String pass) -> untyped
12
12
  def self.create: (String pass) -> untyped
13
13
  def self.valid_hash?: (string hash) -> Integer?
14
14
  def self.verify_password: (untyped pass, untyped hash, ?nil secret) -> untyped
15
15
  end
16
+ class Engine
17
+ def self.saltgen: () -> String
18
+ end
19
+ class ArgonHashFail < StandardError
20
+ end
16
21
  end
data/sig/ffi.rbs ADDED
@@ -0,0 +1,18 @@
1
+ module Argon2
2
+ # Direct external bindings. Call these methods via the Engine class to ensure points are dealt with
3
+ module Ext
4
+ extend FFI::Library
5
+ end
6
+
7
+ # The engine class shields users from the FFI interface.
8
+ # It is generally not advised to directly use this class.
9
+ class Engine
10
+ def self.hash_argon2i: (untyped password, untyped salt, untyped t_cost, untyped m_cost, ?untyped? out_len) -> untyped
11
+
12
+ def self.hash_argon2id: (untyped password, untyped salt, untyped t_cost, untyped m_cost, untyped p_cost, ?untyped? out_len) -> untyped
13
+
14
+ def self.hash_argon2id_encode: (untyped password, untyped salt, untyped t_cost, untyped m_cost, untyped p_cost, untyped secret) -> untyped
15
+
16
+ def self.argon2_verify: (untyped pwd, untyped hash, untyped secret) -> (false | true)
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argon2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Technion
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2022-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: '1.15'
20
20
  type: :runtime
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: '1.14'
26
+ version: '1.15'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ffi-compiler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.43.1
131
+ version: 1.2.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.43.1
138
+ version: 1.2.1
139
139
  description: Argon2 FFI binding
140
140
  email:
141
141
  - technion@lolware.net
@@ -144,6 +144,7 @@ extensions:
144
144
  - ext/argon2_wrap/extconf.rb
145
145
  extra_rdoc_files: []
146
146
  files:
147
+ - ".github/workflows/codeql.yml"
147
148
  - ".github/workflows/ruby.yml"
148
149
  - ".gitignore"
149
150
  - ".gitmodules"
@@ -172,6 +173,7 @@ files:
172
173
  - ext/phc-winner-argon2/CHANGELOG.md
173
174
  - ext/phc-winner-argon2/LICENSE
174
175
  - ext/phc-winner-argon2/Makefile
176
+ - ext/phc-winner-argon2/Package.swift
175
177
  - ext/phc-winner-argon2/README.md
176
178
  - ext/phc-winner-argon2/appveyor.yml
177
179
  - ext/phc-winner-argon2/argon2-specs.pdf
@@ -203,7 +205,6 @@ files:
203
205
  - ext/phc-winner-argon2/latex/tradeoff.bib
204
206
  - ext/phc-winner-argon2/libargon2.pc.in
205
207
  - ext/phc-winner-argon2/man/argon2.1
206
- - ext/phc-winner-argon2/opt.o
207
208
  - ext/phc-winner-argon2/src/argon2.c
208
209
  - ext/phc-winner-argon2/src/bench.c
209
210
  - ext/phc-winner-argon2/src/blake2/blake2-impl.h
@@ -252,12 +253,14 @@ files:
252
253
  - lib/argon2/version.rb
253
254
  - sig/argon2.rbs
254
255
  - sig/constants.rbs
256
+ - sig/ffi.rbs
255
257
  - sig/version.rbs
256
258
  homepage: https://github.com/technion/ruby-argon2
257
259
  licenses:
258
260
  - MIT
259
- metadata: {}
260
- post_install_message:
261
+ metadata:
262
+ rubygems_mfa_required: 'true'
263
+ post_install_message:
261
264
  rdoc_options: []
262
265
  require_paths:
263
266
  - lib
@@ -272,8 +275,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
275
  - !ruby/object:Gem::Version
273
276
  version: '0'
274
277
  requirements: []
275
- rubygems_version: 3.2.21
276
- signing_key:
278
+ rubygems_version: 3.3.5
279
+ signing_key:
277
280
  specification_version: 4
278
281
  summary: Argon2 Password hashing binding
279
282
  test_files: []
Binary file