Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
0.2.0 implement libsodium crypto_pwhash_str
Fix #23 Add tests, improve docs
- Loading branch information
1 parent
2e2b114
commit 15fd068
Showing
6 changed files
with
57 additions
and
73 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
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
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 +1 @@ | ||
| -d:ssl | ||
| -d:ssl --hints:off |
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,22 @@ | ||
|
|
||
| ## Nim HTTP Authentication and Authorization | ||
| ## Functional tests. HTTP headers are mocked | ||
| ## Copyright 2019 Federico Ceratto <federico.ceratto@gmail.com> | ||
| ## Released under LGPLv3 License, see LICENSE file | ||
|
|
||
| import unittest, | ||
| strutils | ||
|
|
||
| from libsodium/sodium import crypto_pwhash_str_verify | ||
|
|
||
| import httpauthpkg/base | ||
|
|
||
| import httpauth | ||
|
|
||
| suite "hashing": | ||
| test "password_pwhash_str": | ||
| const pwd = "Correct Horse Battery Staple" | ||
| let h = password_pwhash_str(pwd) | ||
| check crypto_pwhash_str_verify(h, pwd) == true | ||
| check crypto_pwhash_str_verify(h, pwd & "!") == false | ||
| check password_needs_rehashing(h) == false |