Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Timothy Frew
Sympl
Commits
a072f979
Commit
a072f979
authored
Jun 17, 2015
by
Patrick J Cherry
Browse files
email: Fixed xkcd password test to make sure password is not automatically crypted.
parent
061ae1b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
email/symbiosis/test.d/tc_checkpassword.rb
View file @
a072f979
...
...
@@ -59,7 +59,7 @@ class TestCheckpassword < Test::Unit::TestCase
assert_equal
(
1
,
status
,
"Authentication succeeded for a bad password"
)
# Test for a malicious name.
assert_nothing_raised
{
msg
,
status
=
do_checkpassword_test
(
"../"
+
mailbox
.
username
,
pw
)
}
assert_nothing_raised
{
msg
,
status
=
do_checkpassword_test
(
"../
mailboxes/
"
+
mailbox
.
username
,
pw
)
}
assert_equal
(
1
,
status
,
"Authentication succeeded for a malicious username"
)
# Test for crypted passwords
...
...
@@ -76,6 +76,7 @@ class TestCheckpassword < Test::Unit::TestCase
msg
=
nil
status
=
nil
mailbox
=
@domain
.
create_mailbox
(
"test"
)
mailbox
.
encrypt_password
=
false
mailbox
.
password
=
""
assert_nothing_raised
{
msg
,
status
=
do_checkpassword_test
(
mailbox
.
username
,
""
)
}
...
...
@@ -101,17 +102,18 @@ class TestCheckpassword < Test::Unit::TestCase
status
=
nil
xkcd_password
=
"correct horse battery staple"
mailbox
=
@domain
.
create_mailbox
(
"test"
)
mailbox
.
encrypt_password
=
false
mailbox
.
password
=
xkcd_password
assert_nothing_raised
{
msg
,
status
=
do_checkpassword_test
(
mailbox
.
username
,
xkcd_password
)
}
assert_equal
(
0
,
status
,
msg
)
assert_equal
(
0
,
status
,
"Check password failed for the uncrypted xkcd password"
)
mailbox
.
encrypt_password
=
true
mailbox
.
password
=
xkcd_password
assert_nothing_raised
{
msg
,
status
=
do_checkpassword_test
(
mailbox
.
username
,
xkcd_password
)
}
assert_equal
(
0
,
status
,
msg
)
assert_equal
(
0
,
status
,
"Check password failed for the crypted xkcd password"
)
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment