Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
6f9868d5
Commit
6f9868d5
authored
6 years ago
by
Phy
Browse files
Options
Downloads
Patches
Plain Diff
fix sha512 failing test, and add test to crypt-style sha512 hash
parent
d4424692
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_test/tests/inc/auth_password.test.php
+11
-0
11 additions, 0 deletions
_test/tests/inc/auth_password.test.php
inc/PassHash.class.php
+1
-1
1 addition, 1 deletion
inc/PassHash.class.php
with
12 additions
and
1 deletion
_test/tests/inc/auth_password.test.php
+
11
−
0
View file @
6f9868d5
...
...
@@ -110,4 +110,15 @@ class auth_password_test extends DokuWikiTest {
$this
->
assertTrue
(
$except
);
}
/**
* issue #2629, support PHP's crypt() format (with rounds=0 parameter)
*/
function
test_verifyPassword_sha512_crypt
()
{
if
(
defined
(
'CRYPT_SHA512'
)
&&
CRYPT_SHA512
==
1
)
{
$this
->
assertTrue
(
auth_verifyPassword
(
'Qwerty123'
,
'$6$rounds=3000$9in6UciYPFG6ydsJ$YBjypQ7XoRqvJoX1a2.spSysSVHcdreVXi1Xh5SyOxo2yNSxDjlUCun2YXrwk9.YP6vmRvCWrhp0fbPgSOT7..'
));
}
else
{
$this
->
markTestSkipped
(
'SHA512 not available in this PHP environment'
);
}
}
}
This diff is collapsed.
Click to expand it.
inc/PassHash.class.php
+
1
−
1
View file @
6f9868d5
...
...
@@ -562,7 +562,7 @@ class PassHash {
throw
new
Exception
(
'This PHP installation has no SHA512 support'
);
}
$this
->
init_salt
(
$salt
,
8
,
false
);
if
(
is_null
(
$magic
))
{
if
(
empty
(
$magic
))
{
return
crypt
(
$clear
,
'$6$'
.
$salt
.
'$'
);
}
else
{
return
crypt
(
$clear
,
'$6$'
.
$magic
.
'$'
.
$salt
.
'$'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment