mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 09:21:50 -05:00
tests: make the imap server not verify user+password
... as the test cases themselves do that and it makes it easier to add crazy test cases. Test 800 updated to use user name + password that need quoting. Test 856 updated to trigger an auth fail differently. Ref: #1902
This commit is contained in:
parent
b8e0fe19ec
commit
a4db3f7046
@ -31,7 +31,7 @@ imap
|
|||||||
IMAP FETCH message
|
IMAP FETCH message
|
||||||
</name>
|
</name>
|
||||||
<command>
|
<command>
|
||||||
'imap://%HOSTIP:%IMAPPORT/800/;UID=1' -u user:secret
|
'imap://%HOSTIP:%IMAPPORT/800/;UID=1' -u "user*:secret{"
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ IMAP FETCH message
|
|||||||
<verify>
|
<verify>
|
||||||
<protocol>
|
<protocol>
|
||||||
A001 CAPABILITY
|
A001 CAPABILITY
|
||||||
A002 LOGIN user secret
|
A002 LOGIN "user*" "secret{"
|
||||||
A003 SELECT 800
|
A003 SELECT 800
|
||||||
A004 FETCH 1 BODY[]
|
A004 FETCH 1 BODY[]
|
||||||
A005 LOGOUT
|
A005 LOGOUT
|
||||||
|
@ -10,6 +10,9 @@ FAILURE
|
|||||||
#
|
#
|
||||||
# Server-side
|
# Server-side
|
||||||
<reply>
|
<reply>
|
||||||
|
<servercmd>
|
||||||
|
REPLY PASS -ERR Login failure
|
||||||
|
</servercmd>
|
||||||
</reply>
|
</reply>
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# | (__| |_| | _ <| |___
|
# | (__| |_| | _ <| |___
|
||||||
# \___|\___/|_| \_\_____|
|
# \___|\___/|_| \_\_____|
|
||||||
#
|
#
|
||||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
# Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
#
|
#
|
||||||
# This software is licensed as described in the file COPYING, which
|
# This software is licensed as described in the file COPYING, which
|
||||||
# you should have received as part of this distribution. The terms
|
# you should have received as part of this distribution. The terms
|
||||||
@ -174,7 +174,6 @@ my $exit_signal; # first signal handled in exit_signal_handler
|
|||||||
#**********************************************************************
|
#**********************************************************************
|
||||||
# Mail related definitions
|
# Mail related definitions
|
||||||
#
|
#
|
||||||
my $TEXT_USERNAME = "user";
|
|
||||||
my $TEXT_PASSWORD = "secret";
|
my $TEXT_PASSWORD = "secret";
|
||||||
my $POP3_TIMESTAMP = "<1972.987654321\@curl>";
|
my $POP3_TIMESTAMP = "<1972.987654321\@curl>";
|
||||||
|
|
||||||
@ -1121,9 +1120,6 @@ sub LOGIN_imap {
|
|||||||
if ($user eq "") {
|
if ($user eq "") {
|
||||||
sendcontrol "$cmdid BAD Command Argument\r\n";
|
sendcontrol "$cmdid BAD Command Argument\r\n";
|
||||||
}
|
}
|
||||||
elsif (($user ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
|
|
||||||
sendcontrol "$cmdid NO LOGIN failed\r\n";
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
sendcontrol "$cmdid OK LOGIN completed\r\n";
|
sendcontrol "$cmdid OK LOGIN completed\r\n";
|
||||||
}
|
}
|
||||||
@ -1681,7 +1677,7 @@ sub APOP_pop3 {
|
|||||||
else {
|
else {
|
||||||
my $digest = Digest::MD5::md5_hex($POP3_TIMESTAMP, $TEXT_PASSWORD);
|
my $digest = Digest::MD5::md5_hex($POP3_TIMESTAMP, $TEXT_PASSWORD);
|
||||||
|
|
||||||
if (($user ne $TEXT_USERNAME) || ($secret ne $digest)) {
|
if ($secret ne $digest) {
|
||||||
sendcontrol "-ERR Login failure\r\n";
|
sendcontrol "-ERR Login failure\r\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1740,12 +1736,7 @@ sub PASS_pop3 {
|
|||||||
|
|
||||||
logmsg "PASS_pop3 got $password\n";
|
logmsg "PASS_pop3 got $password\n";
|
||||||
|
|
||||||
if (($username ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
|
sendcontrol "+OK Login successful\r\n";
|
||||||
sendcontrol "-ERR Login failure\r\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sendcontrol "+OK Login successful\r\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user