diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-10-23 22:05:22 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-10-23 22:05:22 +0100 |
commit | ca5c5be3e43ebc0206c1b3f8c51babae8bb1cd49 (patch) | |
tree | b0812d2e20c703e22eb31ca9e01ffd5dde545f80 | |
parent | 9bd37a6d270d9379579cb3f843bc70f133b86f1f (diff) |
tests: Added empty response support to custom replies
...and fixed up test869 as DIGEST-MD transcript is as follows:
S: Challenge
C: Authentication String
S: Continue Response
C: Empty String
-rw-r--r-- | tests/data/test869 | 4 | ||||
-rwxr-xr-x | tests/ftpserver.pl | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/data/test869 b/tests/data/test869 index 71e52342c..61dbc206c 100644 --- a/tests/data/test869 +++ b/tests/data/test869 @@ -15,7 +15,8 @@ RFC5034 <servercmd> AUTH DIGEST-MD5 REPLY AUTH + cmVhbG09ImN1cmwiLG5vbmNlPSI1MzAwZDE3YTFkNjk1YmQ0MTFlNGNkZjk2Zjk1NDhjMjNjZWQ2MTc1IixhbGdvcml0aG09bWQ1LXNlc3MscW9wPSJhdXRoIg== -REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvY3VybCIscmVzcG9uc2U9YTA2OTE1YTA1ODA3ZDc0MTg0YTkxYjM2NjE2ZTZiOGM= +OK Login successful +REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvY3VybCIscmVzcG9uc2U9YTA2OTE1YTA1ODA3ZDc0MTg0YTkxYjM2NjE2ZTZiOGM= + +REPLY +OK Login successful </servercmd> <data> From: me@somewhere
@@ -53,6 +54,7 @@ pop3://%HOSTIP:%POP3PORT/869 -u user:secret CAPA
AUTH DIGEST-MD5
dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvY3VybCIscmVzcG9uc2U9YTA2OTE1YTA1ODA3ZDc0MTg0YTkxYjM2NjE2ZTZiOGM=
+
RETR 869
QUIT
</protocol> diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 7e61c2049..803273db6 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -2729,9 +2729,14 @@ sub customize { logmsg "FTPD: Getting commands from log/ftpserver.cmd\n"; while(<CUSTOM>) { - if($_ =~ /REPLY ([A-Za-z0-9+\/=]+) (.*)/) { + if($_ =~ /REPLY ([A-Za-z0-9+\/=]*) (.*)/) { $customreply{$1}=eval "qq{$2}"; - logmsg "FTPD: set custom reply for $1\n"; + if($1 eq "") { + logmsg "FTPD: set custom reply for empty response\n"; + } + else { + logmsg "FTPD: set custom reply for $1\n"; + } } elsif($_ =~ /COUNT ([A-Z]+) (.*)/) { # we blank the customreply for this command when having |