Subject: Failure to understand source code in ssl_unix.c

From: Thomas Henlich <[email-masked]>
Date: Wed, 09 Feb 2005 13:44:40 +0100

Hi all,

I am currently investigating a failure in IMAP SSL client certificate
verification. More to the point, I am looking for a way to tell the IMAP
server NOT to request client certificates over SSL.

In src/osdep/unix/ssl_unix.c there are functions ssl_open and ssl_start.
I do not understand why the 3rd argument to ssl_start is called "port"
when ssl_start is called from ssl_open. (It should be "flags"?)

Any help is appreciated.

Regards,
 Thomas.

>From ssl_unix.c:
...
/* SSL open
 * Accepts: host name
 *          contact service name
 *          contact port number
 * Returns: SSL stream if success else NIL
 */

SSLSTREAM *ssl_open (char *host,char *service,unsigned long port)
{
  TCPSTREAM *stream = tcp_open (host,service,port);
  return stream ? ssl_start (stream,host,port) : NIL;
}

...

/* Start SSL/TLS negotiations
 * Accepts: open TCP stream of session
 *          user's host name
 *          flags
 * Returns: SSL stream if success else NIL
 */

static SSLSTREAM *ssl_start (TCPSTREAM *tstream,char *host,unsigned long
flags)
{
...

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Wed, 9 Feb 2005 08:31:47 -0800 (PST)

> when ssl_start is called from ssl_open. (It should be "flags"?)

The SSL layer is implemented as a NETDRIVER, and as such the methods that 
implement the netdriver.

The third argument to ssl_open() is a long that has a port in the low 32 
bits and flags in the upper 32 bits.  That actually isn't any different 
from tcp_open() which has the same thing, and takes the same flags (which 
are the NET_??? names in mail.h).

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.