* Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.6 2004-04-30 19:10:35 adam Exp $
+ * $Id: tcpip.c,v 1.10 2004-09-21 14:59:01 adam Exp $
*/
#include <stdio.h>
p->type = ssl_type;
sp = (tcpip_state *) p->cprivate;
- sp->ctx = vp; /* may be NULL */
+ sp->ctx = (SSL_CTX *) vp; /* may be NULL */
/* note: we don't handle already opened socket in SSL mode - yet */
return p;
#endif
}
else if (!res)
- return 0;
+ return hasread;
hasread += res;
}
TRC (fprintf (stderr, " Out of read loop with hasread=%d, berlen=%d\n",
sp = (struct tcpip_state *) cs->cprivate;
if (sp->ctx_alloc)
return 0;
- sp->ctx = ctx;
+ sp->ctx = (SSL_CTX *) ctx;
return 1;
}
return sp->ssl;
}
-int cs_set_ssl_certf(COMSTACK cs, const char *fname)
+int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname)
{
struct tcpip_state *sp;
if (!cs || cs->type != ssl_type)
int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len)
{
- SSL *ssl = cs_get_ssl(cs);
+ SSL *ssl = (SSL *) cs_get_ssl(cs);
if (ssl)
{
X509 *server_cert = SSL_get_peer_certificate (ssl);
/* get PEM buffer in memory */
PEM_write_bio_X509(bio, server_cert);
*len = BIO_get_mem_data(bio, &pem_buf);
- *buf = xmalloc(*len);
+ *buf = (char *) xmalloc(*len);
memcpy(*buf, pem_buf, *len);
BIO_free(bio);
return 1;
return 0;
}
-int cs_set_ssl_certf(COMSTACK cs, const char *fname)
+int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname)
{
return 0;
}