mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
fix for incomplete https://github.com/Kozea/Radicale/pull/1425 and test
This commit is contained in:
parent
caefa489f9
commit
36285143ce
2 changed files with 10 additions and 0 deletions
|
@ -74,6 +74,10 @@ class Auth(auth.BaseAuth):
|
||||||
self._verify = self._plain
|
self._verify = self._plain
|
||||||
elif encryption == "md5":
|
elif encryption == "md5":
|
||||||
self._verify = self._md5apr1
|
self._verify = self._md5apr1
|
||||||
|
elif encryption == "sha256":
|
||||||
|
self._verify = self._sha256
|
||||||
|
elif encryption == "sha512":
|
||||||
|
self._verify = self._sha512
|
||||||
elif encryption == "bcrypt" or encryption == "autodetect":
|
elif encryption == "bcrypt" or encryption == "autodetect":
|
||||||
try:
|
try:
|
||||||
import bcrypt
|
import bcrypt
|
||||||
|
|
|
@ -82,6 +82,12 @@ class TestBaseAuthRequests(BaseTest):
|
||||||
self._test_htpasswd(
|
self._test_htpasswd(
|
||||||
"md5", "😀:$apr1$w4ev89r1$29xO8EvJmS2HEAadQ5qy11", "unicode")
|
"md5", "😀:$apr1$w4ev89r1$29xO8EvJmS2HEAadQ5qy11", "unicode")
|
||||||
|
|
||||||
|
def test_htpasswd_sha256(self) -> None:
|
||||||
|
self._test_htpasswd("sha256", "tmp:$5$i4Ni4TQq6L5FKss5$ilpTjkmnxkwZeV35GB9cYSsDXTALBn6KtWRJAzNlCL/")
|
||||||
|
|
||||||
|
def test_htpasswd_sha512(self) -> None:
|
||||||
|
self._test_htpasswd("sha512", "tmp:$6$3Qhl8r6FLagYdHYa$UCH9yXCed4A.J9FQsFPYAOXImzZUMfvLa0lwcWOxWYLOF5sE/lF99auQ4jKvHY2vijxmefl7G6kMqZ8JPdhIJ/")
|
||||||
|
|
||||||
def test_htpasswd_bcrypt(self) -> None:
|
def test_htpasswd_bcrypt(self) -> None:
|
||||||
self._test_htpasswd("bcrypt", "tmp:$2y$05$oD7hbiQFQlvCM7zoalo/T.MssV3V"
|
self._test_htpasswd("bcrypt", "tmp:$2y$05$oD7hbiQFQlvCM7zoalo/T.MssV3V"
|
||||||
"NTRI3w5KDnj8NTUKJNWfVpvRq")
|
"NTRI3w5KDnj8NTUKJNWfVpvRq")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue