diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-08-10 07:19:51 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-08-10 07:19:51 +0300 |
commit | 0ac500aef722ac5674cfd053889e1c0101c88f97 (patch) | |
tree | b81723b45461f65a38ccf70227694f0b0592e3cb | |
parent | 93970a7554512add3e9192a8eeabd0abbedcc5c0 (diff) | |
download | mailutils-0ac500aef722ac5674cfd053889e1c0101c88f97.tar.gz mailutils-0ac500aef722ac5674cfd053889e1c0101c88f97.tar.bz2 |
Fix compilation without TLS
* testsuite/mockmta.c: Fix preprocessor conditionals regarding TLS.
-rw-r--r-- | testsuite/mockmta.c | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/testsuite/mockmta.c b/testsuite/mockmta.c index 969f99e49..517df4b4c 100644 --- a/testsuite/mockmta.c +++ b/testsuite/mockmta.c | |||
@@ -571,2 +571,4 @@ enum | |||
571 | 571 | ||
572 | static void disable_starttls (void); | ||
573 | |||
572 | #ifdef WITH_TLS | 574 | #ifdef WITH_TLS |
@@ -580,2 +582,25 @@ char *tls_cafile; | |||
580 | static inline int | 582 | static inline int |
583 | set_tls_opt (int c) | ||
584 | { | ||
585 | switch (c) | ||
586 | { | ||
587 | case 'c': | ||
588 | tls_cert = optarg; | ||
589 | break; | ||
590 | |||
591 | case 'k': | ||
592 | tls_key = optarg; | ||
593 | break; | ||
594 | |||
595 | case 'f': | ||
596 | tls_cafile = optarg; | ||
597 | break; | ||
598 | |||
599 | default: | ||
600 | return 1; | ||
601 | } | ||
602 | return 0; | ||
603 | } | ||
604 | |||
605 | static inline int | ||
581 | enable_tls (void) | 606 | enable_tls (void) |
@@ -669,4 +694,2 @@ generate_dh_params (void) | |||
669 | 694 | ||
670 | static void disable_starttls (void); | ||
671 | |||
672 | static int | 695 | static int |
@@ -768,2 +791,7 @@ iotls_create (int in, int out) | |||
768 | #else | 791 | #else |
792 | static inline int set_tls_opt (int c) { | ||
793 | terror ("option -%c not supported: program compiled without support for TLS", | ||
794 | c); | ||
795 | return 1; | ||
796 | } | ||
769 | static inline int enable_tls(void) { return 0; } | 797 | static inline int enable_tls(void) { return 0; } |
@@ -1302,3 +1330,5 @@ disable_starttls (void) | |||
1302 | { | 1330 | { |
1331 | #ifdef WITH_TLS | ||
1303 | tls_cert = tls_key = tls_cafile = NULL; | 1332 | tls_cert = tls_key = tls_cafile = NULL; |
1333 | #endif | ||
1304 | smtp_transition_table[STATE_EHLO][KW_STARTTLS].new_state = STATE_ERR; | 1334 | smtp_transition_table[STATE_EHLO][KW_STARTTLS].new_state = STATE_ERR; |
@@ -1476,16 +1506,5 @@ main (int argc, char **argv) | |||
1476 | 1506 | ||
1477 | case 'c': | ||
1478 | tls_cert = optarg; | ||
1479 | break; | ||
1480 | |||
1481 | case 'k': | ||
1482 | tls_key = optarg; | ||
1483 | break; | ||
1484 | |||
1485 | case 'f': | ||
1486 | tls_cafile = optarg; | ||
1487 | break; | ||
1488 | |||
1489 | default: | 1507 | default: |
1490 | exit (EX_USAGE); | 1508 | if (set_tls_opt (c)) |
1509 | exit (EX_USAGE); | ||
1491 | } | 1510 | } |