pop3: Added support for SASL based authentication mechanism detection
Added support for detecting the supported SASL authentication mechanisms via the AUTH command. There are two ways of detecting them, either by using the AUTH command, that will return -ERR if not supported or by using the CAPA command which will return SASL and the list of mechanisms if supported, not include SASL if SASL authentication is not supported or -ERR if the CAPA command is not supported. As such it seems simpler to use the AUTH command and fallback to normal clear text authentication if the the command is not supported. Additionally updated the test cases to return -ERR when the AUTH command is encountered. Additional test cases will be added when support for the individual authentication mechanisms is added.
This commit is contained in:
@@ -10,6 +10,7 @@ LIST
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
REPLY AUTH -ERR unsupported command
|
||||
REPLY LIST +OK 808 100
|
||||
</servercmd>
|
||||
</reply>
|
||||
@@ -32,6 +33,7 @@ pop3://%HOSTIP:%POP3PORT/808 -l -u user:secret
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
AUTH
|
||||
USER user
|
||||
PASS secret
|
||||
LIST 808
|
||||
|
||||
@@ -11,6 +11,7 @@ FAILURE
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
REPLY AUTH -ERR unsupported command
|
||||
REPLY LIST -ERR no such message
|
||||
</servercmd>
|
||||
</reply>
|
||||
@@ -36,6 +37,7 @@ pop3://%HOSTIP:%POP3PORT/809 -l -u user:secret
|
||||
56
|
||||
</errorcode>
|
||||
<protocol>
|
||||
AUTH
|
||||
USER user
|
||||
PASS secret
|
||||
LIST 809
|
||||
|
||||
@@ -13,6 +13,7 @@ LIST
|
||||
# packets
|
||||
<servercmd>
|
||||
SLOWDOWN
|
||||
REPLY AUTH -ERR unsupported command
|
||||
</servercmd>
|
||||
# When doing LIST, we get the default list output hard-coded in the test
|
||||
# POP3 server
|
||||
@@ -41,6 +42,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
AUTH
|
||||
USER user
|
||||
PASS secret
|
||||
LIST
|
||||
|
||||
@@ -10,6 +10,7 @@ LIST
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
REPLY AUTH -ERR unsupported command
|
||||
REPLY LIST +OK but no messages\r\n.
|
||||
</servercmd>
|
||||
<datacheck>
|
||||
@@ -34,6 +35,7 @@ pop3://%HOSTIP:%POP3PORT/ -u user:secret
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
AUTH
|
||||
USER user
|
||||
PASS secret
|
||||
LIST
|
||||
|
||||
@@ -11,6 +11,7 @@ FAILURE
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
REPLY AUTH -ERR unsupported command
|
||||
REPLY RETR -ERR no such message
|
||||
</servercmd>
|
||||
</reply>
|
||||
@@ -36,6 +37,7 @@ pop3://%HOSTIP:%POP3PORT/812 -u user:secret
|
||||
56
|
||||
</errorcode>
|
||||
<protocol>
|
||||
AUTH
|
||||
USER user
|
||||
PASS secret
|
||||
RETR 812
|
||||
|
||||
@@ -10,6 +10,7 @@ FAILURE
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
REPLY AUTH -ERR unsupported command
|
||||
REPLY PASS -ERR invalid login
|
||||
</servercmd>
|
||||
</reply>
|
||||
@@ -35,6 +36,7 @@ pop3://%HOSTIP:%POP3PORT/813 -u user:wrong
|
||||
67
|
||||
</errorcode>
|
||||
<protocol>
|
||||
AUTH
|
||||
USER user
|
||||
PASS wrong
|
||||
QUIT
|
||||
|
||||
@@ -9,6 +9,9 @@ RETR
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
REPLY AUTH -ERR unsupported command
|
||||
</servercmd>
|
||||
<data>
|
||||
From: me@somewhere
|
||||
To: fake@nowhere
|
||||
@@ -49,6 +52,7 @@ pop3://%HOSTIP:%POP3PORT/815 -u user:secret
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
AUTH
|
||||
USER user
|
||||
PASS secret
|
||||
RETR 815
|
||||
|
||||
Reference in New Issue
Block a user