/* For interface, see auths/README */
int
-auth_plaintext_server(auth_instance *ablock, uschar *data)
+auth_plaintext_server(auth_instance * ablock, uschar * data)
{
-auth_plaintext_options_block *ob =
+auth_plaintext_options_block * ob =
(auth_plaintext_options_block *)(ablock->options_block);
-const uschar *prompts = ob->server_prompts;
-uschar *clear, *end, *s;
+const uschar * prompts = ob->server_prompts;
+uschar * s;
int number = 1;
-int len, rc;
+int rc;
int sep = 0;
/* Expand a non-empty list of prompt strings */
(auth_plaintext_options_block *)(ablock->options_block);
const uschar * text = ob->client_send;
const uschar * s;
-BOOL first = TRUE;
int sep = 0;
int auth_var_idx = 0, rc;
int flags = AUTH_ITEM_FIRST;
#ifdef SUPPORT_TLS
# undef vaguely_random_number
#endif
- static pid_t pid = 0;
- pid_t p2;
-#if defined(HAVE_SRANDOM) && !defined(HAVE_SRANDOMDEV)
- struct timeval tv;
-#endif
+static pid_t pid = 0;
+pid_t p2;
- p2 = getpid();
- if (p2 != pid)
+if ((p2 = getpid()) != pid)
+ {
+ if (pid != 0)
{
- if (pid != 0)
- {
#ifdef HAVE_ARC4RANDOM
- /* cryptographically strong randomness, common on *BSD platforms, not
- so much elsewhere. Alas. */
-#ifndef NOT_HAVE_ARC4RANDOM_STIR
- arc4random_stir();
-#endif
+ /* cryptographically strong randomness, common on *BSD platforms, not
+ so much elsewhere. Alas. */
+# ifndef NOT_HAVE_ARC4RANDOM_STIR
+ arc4random_stir();
+# endif
#elif defined(HAVE_SRANDOM) || defined(HAVE_SRANDOMDEV)
-#ifdef HAVE_SRANDOMDEV
- /* uses random(4) for seeding */
- srandomdev();
-#else
- gettimeofday(&tv, NULL);
- srandom(tv.tv_sec | tv.tv_usec | getpid());
-#endif
+# ifdef HAVE_SRANDOMDEV
+ /* uses random(4) for seeding */
+ srandomdev();
+# else
+ {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ srandom(tv.tv_sec | tv.tv_usec | getpid());
+ }
+# endif
#else
- /* Poor randomness and no seeding here */
+ /* Poor randomness and no seeding here */
#endif
- }
- pid = p2;
}
+ pid = p2;
+ }
#ifdef HAVE_ARC4RANDOM
- return arc4random() % max;
+return arc4random() % max;
#elif defined(HAVE_SRANDOM) || defined(HAVE_SRANDOMDEV)
- return random() % max;
+return random() % max;
#else
- /* This one returns a 16-bit number, definitely not crypto-strong */
- return random_number(max);
+/* This one returns a 16-bit number, definitely not crypto-strong */
+return random_number(max);
#endif
}
client_conn_ctx cctx;
int timeout = 5;
int save_ptr = yield->ptr;
- FILE * fp;
+ FILE * fp = NULL;
uschar * arg;
uschar * sub_arg[4];
uschar * server_name = NULL;
header_add_backend(BOOL after, uschar *name, BOOL topnot, int type,
const char *format, va_list ap)
{
-header_line *h, *new;
+header_line *h, *new = NULL;
header_line **hptr;
uschar *p, *q;
/* Find where to insert this header */
if (!name)
- {
if (after)
{
- hptr = &(header_last->next);
+ hptr = &header_last->next;
h = NULL;
}
else
hptr = &header_list->next;
h = *hptr;
}
- }
else
{
for (;;)
{
if (!h->next || !header_testname(h, name, len, FALSE)) break;
- hptr = &(h->next);
+ hptr = &h->next;
h = h->next;
}
}
point, we have hptr pointing to the link field that will point to the new
header, and h containing the following header, or NULL. */
-for (p = q = buffer; *p != 0; )
+for (p = q = buffer; *p; p = q)
{
for (;;)
{
new->next = h;
*hptr = new;
- hptr = &(new->next);
+ hptr = &new->next;
if (!h) header_last = new;
- p = q;
}
return new;
}
header_add_at_position(BOOL after, uschar *name, BOOL topnot, int type,
const char *format, ...)
{
-header_line * h;
va_list ap;
va_start(ap, format);
(void) header_add_backend(after, name, topnot, type, format, ap);
else
#endif /*TCP_FASTOPEN*/
{
+#if defined(TCP_FASTOPEN) && defined(MSG_FASTOPEN)
legacy_connect:
+#endif
+
DEBUG(D_transport|D_v) if (fastopen_blob)
debug_printf("non-TFO mode connection attempt to %s, %lu data\n",
address, (unsigned long)fastopen_blob->len);
{
smtp_context * sx = sx0;
uschar * ptr = buffer;
-int count = 0, rc;
+int count = 0;
errno = 0; /* Ensure errno starts out zero */
#ifdef EXPERIMENTAL_PIPE_CONNECT
if (sx->pending_BANNER || sx->pending_EHLO)
+ {
+ int rc;
if ((rc = smtp_reap_early_pipe(sx, &count)) != OK)
{
DEBUG(D_transport) debug_printf("failed reaping pipelined cmd responsess\n");
if (rc == DEFER) errno = ERRNO_TLSFAILURE;
return FALSE;
}
+ }
#endif
/* This is a loop to read and concatenate the lines that make up a multi-line
# ifndef EXIM_HAVE_OPENSSL_CIPHER_GET_ID
# define SSL_CIPHER_get_id(c) (c->id)
# endif
-# include "tls-cipher-stdname.c"
+# ifndef MACRO_PREDEF
+# include "tls-cipher-stdname.c"
+# endif
#endif
/*************************************************
address_item * addr = sx->sync_addr;
smtp_transport_options_block * ob = sx->conn_args.ob;
int yield = 0;
-int rc;
#ifdef EXPERIMENTAL_PIPE_CONNECT
+int rc;
if ((rc = smtp_reap_early_pipe(sx, &count)) != OK)
return rc == FAIL ? -4 : -5;
#endif
if ( require_auth == OK
|| verify_check_given_host(CUSS &ob->hosts_try_auth, host) == OK)
{
- auth_instance * au;
-
DEBUG(D_transport) debug_printf("scanning authentication mechanisms\n");
fail_reason = US"no common mechanisms were found";
client function. We are limited to supporting up to 16 authenticator
public-names by the number of bits in a short. */
+ auth_instance * au;
uschar bitnum;
int rc;
/* TLS negotiation failed; give an error. From outside, this function may
be called again to try in clear on a new connection, if the options permit
it for this host. */
-GNUTLS_CONN_FAILED:
+#ifdef USE_GNUTLS
+ GNUTLS_CONN_FAILED:
+#endif
DEBUG(D_tls) debug_printf("TLS session fail: %s\n", tls_errstr);
# ifdef SUPPORT_DANE