summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-08-10 04:19:51 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-08-10 04:19:51 (GMT)
commit0ac500aef722ac5674cfd053889e1c0101c88f97 (patch) (side-by-side diff)
treeb81723b45461f65a38ccf70227694f0b0592e3cb
parent93970a7554512add3e9192a8eeabd0abbedcc5c0 (diff)
downloadmailutils-master.tar.gz
mailutils-master.tar.bz2
Fix compilation without TLSHEADmaster
* testsuite/mockmta.c: Fix preprocessor conditionals regarding TLS.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--testsuite/mockmta.c49
1 files changed, 34 insertions, 15 deletions
diff --git a/testsuite/mockmta.c b/testsuite/mockmta.c
index 969f99e..517df4b 100644
--- a/testsuite/mockmta.c
+++ b/testsuite/mockmta.c
@@ -571,2 +571,4 @@ enum
+static void disable_starttls (void);
+
#ifdef WITH_TLS
@@ -580,2 +582,25 @@ char *tls_cafile;
static inline int
+set_tls_opt (int c)
+{
+ switch (c)
+ {
+ case 'c':
+ tls_cert = optarg;
+ break;
+
+ case 'k':
+ tls_key = optarg;
+ break;
+
+ case 'f':
+ tls_cafile = optarg;
+ break;
+
+ default:
+ return 1;
+ }
+ return 0;
+}
+
+static inline int
enable_tls (void)
@@ -669,4 +694,2 @@ generate_dh_params (void)
-static void disable_starttls (void);
-
static int
@@ -768,2 +791,7 @@ iotls_create (int in, int out)
#else
+static inline int set_tls_opt (int c) {
+ terror ("option -%c not supported: program compiled without support for TLS",
+ c);
+ return 1;
+}
static inline int enable_tls(void) { return 0; }
@@ -1302,3 +1330,5 @@ disable_starttls (void)
{
+#ifdef WITH_TLS
tls_cert = tls_key = tls_cafile = NULL;
+#endif
smtp_transition_table[STATE_EHLO][KW_STARTTLS].new_state = STATE_ERR;
@@ -1476,16 +1506,5 @@ main (int argc, char **argv)
- case 'c':
- tls_cert = optarg;
- break;
-
- case 'k':
- tls_key = optarg;
- break;
-
- case 'f':
- tls_cafile = optarg;
- break;
-
default:
- exit (EX_USAGE);
+ if (set_tls_opt (c))
+ exit (EX_USAGE);
}

Return to:

Send suggestions and report system problems to the System administrator.