#include <memory.h>
#endif /* HAVE_MEMORY_H */
#include <sys/types.h>
+#include <sys/stat.h>
#ifndef HAVE_NET_SOCKET_H
#include <sys/socket.h>
#else
#endif /* ndef h_errno */
-extern int mailserver_socket_temp; /* Socket to close if connect timeout */
-
-#if NET_SECURITY
+#ifdef NET_SECURITY
#include <net/security.h>
#endif /* NET_SECURITY */
#ifdef HAVE_SOCKETPAIR
-char *const *parse_plugin(const char *plugin, const char *host, const char *service)
+static char *const *parse_plugin(const char *plugin, const char *host, const char *service)
{ const char **argvec;
const char *c, *p;
char *cp, *plugin_copy;
/* error */
report(stderr, GT_("fetchmail: fork failed\n"));
return -1;
- break;
case 0: /* child */
/* fds[1] is the parent's end; close it for proper EOF
** detection */
#endif /* HAVE_SOCKETPAIR */
#ifdef __UNUSED__
-#include <sys/time.h>
int SockCheckOpen(int fd)
/* poll given socket; is it selectable? */
return sock;
}
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
int SockOpen(const char *host, const char *service, const char *options,
const char *plugin)
{
struct addrinfo *ai, *ai0, req;
int i;
-#if NET_SECURITY
+#ifdef NET_SECURITY
void *request = NULL;
int requestlen;
#endif /* NET_SECURITY */
}
#ifdef SSL_ENABLE
-#include "openssl/ssl.h"
-#include "openssl/err.h"
-#include "openssl/pem.h"
-#include "openssl/x509.h"
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/pem.h>
+#include <openssl/x509.h>
+#include <openssl/rand.h>
static SSL_CTX *_ctx = NULL;
static SSL *_ssl_context[FD_SETSIZE];
}
-int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict )
+static int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict )
{
char buf[257];
X509 *x509_cert;
int err, depth;
unsigned char digest[EVP_MAX_MD_SIZE];
char text[EVP_MAX_MD_SIZE * 3 + 1], *tp, *te;
- EVP_MD *digest_tp;
+ const EVP_MD *digest_tp;
unsigned int dsz, i, esz;
X509_NAME *subj, *issuer;
return (ok_return);
}
-int SSL_nock_verify_callback( int ok_return, X509_STORE_CTX *ctx )
+static int SSL_nock_verify_callback( int ok_return, X509_STORE_CTX *ctx )
{
return SSL_verify_callback(ok_return, ctx, 0);
}
-int SSL_ck_verify_callback( int ok_return, X509_STORE_CTX *ctx )
+static int SSL_ck_verify_callback( int ok_return, X509_STORE_CTX *ctx )
{
return SSL_verify_callback(ok_return, ctx, 1);
}