From 1be69159f3c6635ee4fb0333c5bc6563830cf156 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Wed, 23 Oct 2013 18:29:29 +0100 Subject: tests: Added POP3 DIGEST-MD5 authentication test --- lib/curl_sasl.c | 2 ++ tests/data/Makefile.am | 2 +- tests/data/test869 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/data/test869 diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 9a0bc0fa8..f097fca25 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -324,9 +324,11 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, if(strcmp(alg, "md5-sess") != 0) return CURLE_LOGIN_DENIED; +#ifndef DEBUGBUILD /* Generate 64 bits of random data */ for(i = 0; i < 8; i++) cnonce[i] = table16[Curl_rand(data)%16]; +#endif /* So far so good, now calculate A1 and H(A1) according to RFC 2831 */ ctxt = Curl_MD5_init(Curl_DIGEST_MD5); diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 934f0865c..0aa47297d 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -68,7 +68,7 @@ test809 test810 test811 test812 test813 test814 \ \ test850 test851 test852 test853 test854 test855 test856 test857 test858 \ test859 test860 test861 test862 test863 test864 test865 test866 test867 \ -test868 \ +test868 test869 \ \ test900 test901 test902 test903 test904 test905 test906 test907 test908 \ test909 test910 test911 test912 test913 test914 test915 test916 test917 \ diff --git a/tests/data/test869 b/tests/data/test869 new file mode 100644 index 000000000..71e52342c --- /dev/null +++ b/tests/data/test869 @@ -0,0 +1,60 @@ + + + +POP3 +POP3 AUTH DIGEST-MD5 +RFC1734 +RFC2831 +RFC5034 + + + +# +# Server-side + + +AUTH DIGEST-MD5 +REPLY AUTH + cmVhbG09ImN1cmwiLG5vbmNlPSI1MzAwZDE3YTFkNjk1YmQ0MTFlNGNkZjk2Zjk1NDhjMjNjZWQ2MTc1IixhbGdvcml0aG09bWQ1LXNlc3MscW9wPSJhdXRoIg== +REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvY3VybCIscmVzcG9uc2U9YTA2OTE1YTA1ODA3ZDc0MTg0YTkxYjM2NjE2ZTZiOGM= +OK Login successful + + +From: me@somewhere +To: fake@nowhere + +body + +-- + yours sincerely + + + +# +# Client-side + + +pop3 + + +debug +crypto + + +POP3 DIGEST-MD5 authentication + + +pop3://%HOSTIP:%POP3PORT/869 -u user:secret + + + +# +# Verify data after the test has been "shot" + + +CAPA +AUTH DIGEST-MD5 +dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvY3VybCIscmVzcG9uc2U9YTA2OTE1YTA1ODA3ZDc0MTg0YTkxYjM2NjE2ZTZiOGM= +RETR 869 +QUIT + + + -- cgit v1.2.3