diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-02-10 12:16:27 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-02-10 12:16:27 +0000 |
commit | 2f66ca11c1aaa85343cedeccdfa9804614500b58 (patch) | |
tree | 0dca6bcd84e793562b22ce7e8fbe8cee27b26758 | |
parent | a1701eea289fe7ea80651f801cf992838a491dde (diff) |
pop3: Added support for the STLS capability (Part One)
Introduced detection of the STLS capability, in order to add support
for TLS upgrades without unconditionally sending the STLS command.
-rw-r--r-- | lib/pop3.c | 6 | ||||
-rw-r--r-- | lib/pop3.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/pop3.c b/lib/pop3.c index 8c2c9bb5a..dc66bcb19 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -260,8 +260,12 @@ static int pop3_endofresp(struct pingpong *pp, int *resp) return TRUE; } + /* Does the server support the STLS capability? */ + if(len >= 4 && !memcmp(line, "STLS", 4)) + pop3c->tls_supported = TRUE; + /* Does the server support clear text authentication? */ - if(len >= 4 && !memcmp(line, "USER", 4)) + else if(len >= 4 && !memcmp(line, "USER", 4)) pop3c->authtypes |= POP3_TYPE_CLEARTEXT; /* Does the server support APOP authentication? */ diff --git a/lib/pop3.h b/lib/pop3.h index b9d7bd4e6..c37b009dd 100644 --- a/lib/pop3.h +++ b/lib/pop3.h @@ -66,6 +66,7 @@ struct pop3_conn { char *apoptimestamp; /* APOP timestamp from the server greeting */ pop3state state; /* Always use pop3.c:state() to change state! */ bool ssldone; /* Is connect() over SSL done? */ + bool tls_supported; /* StartTLS capability supported by server */ }; extern const struct Curl_handler Curl_handler_pop3; |