This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
forked from technion/ruby-argon2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync with latest upstream changes (technion/ruby-argon2
v2.2.0
)
- Loading branch information
Showing
9 changed files
with
198 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "master" ] | ||
schedule: | ||
- cron: '34 3 * * 3' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'ruby' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# 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 | ||
# queries: security-extended,security-and-quality | ||
|
||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | ||
|
||
# If the Autobuild fails above, remove it and uncomment the following three lines. | ||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | ||
|
||
# - run: | | ||
# echo "Run, Build Application using script" | ||
# ./location_of_script_within_repo/buildscript.sh | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ improvements. Want to know more about why `argon2` was forked? | |
Wish to upgrade an existing application to use the improved API? | ||
[Migration guide](#migrating-from-argon2-to-sorcery-argon2) | ||
|
||
This fork is kept up-to-date with `argon2`, latest sync: `argon2 - v2.1.0` | ||
This fork is kept up-to-date with `argon2`, latest sync: `argon2 - v2.2.0` | ||
|
||
## Table of Contents | ||
|
||
|
@@ -108,7 +108,7 @@ ruby wrapper (`argon2` - [technion/ruby-argon2](https://github.com/technion/ruby | |
had some questionable design decisions, and attempted to address them through a | ||
pull request. The sole maintainer of the gem rejected these changes summarily, | ||
without pointing out any specific concerns other than not understanding why the | ||
changes were necessary. This lead to me ([@athix](https://github.com/athix)) | ||
changes were necessary. This lead to me ([@joshbuker](https://github.com/joshbuker)) | ||
being directed to create a fork instead: | ||
[technion/ruby-argon2#44](https://github.com/technion/ruby-argon2/pull/44#issuecomment-816271661) | ||
|
||
|
@@ -123,7 +123,7 @@ through the sheer number of intelligent community members looking at the code. | |
That being said, the original library `argon2` also falls under the same | ||
category. Ultimately, it was also written by a single person and is not | ||
thoroughly vetted by the community at the time of writing. A community member | ||
([@athix](https://github.com/athix), in this case) finding flaws in the | ||
([@joshbuker](https://github.com/joshbuker), in this case) finding flaws in the | ||
implementation, and the fixes being rejected from upstream, is how this fork | ||
came into being. | ||
|
||
|
@@ -145,6 +145,7 @@ following: | |
instance = Argon2::Password.new(t_cost: 4, m_cost: 16) | ||
# Use this instance to generate the hash by calling create: | ||
instance.create(password) | ||
=> "$argon2i$v=19$m=65536,t=2,p=1$jL7lLEAjDN+pY2cG1N8D2g$iwj1ueduCvm6B9YVjBSnAHu+6mKzqGmDW745ALR38Uo" | ||
``` | ||
|
||
Not only is this abstraction step unnecessary, it opens up a new way for | ||
|
@@ -296,7 +297,7 @@ Feel free to ask questions using these contact details: | |
|
||
**Current Maintainers:** | ||
|
||
* Josh Buker ([@athix](https://github.com/athix)) | [Email](mailto:[email protected]?subject=Sorcery) | ||
* Josh Buker ([@joshbuker](https://github.com/joshbuker)) | [Email](mailto:[email protected]?subject=Sorcery) | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# frozen_string_literal: true | ||
#I must admit I have no understanding of why this empty file works. | ||
|
||
require 'mkmf' | ||
|
||
File.rename('Makefile.real', 'Makefile') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
class Argon2SaltReuseTest < Minitest::Test | ||
def test_salt_reuse | ||
assert pass1 = Argon2::Password.create('any password here 1') | ||
assert pass2 = Argon2::Password.create('any password here 2') | ||
|
||
refute_equal pass1, pass2 | ||
|
||
assert salt1 = pass1.salt | ||
assert salt2 = pass2.salt | ||
|
||
refute_equal salt1, salt2 | ||
end | ||
end |