summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2018-06-01 20:31:34 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2018-06-01 20:31:34 +0000
commite85f9b29198e60d1a08ac4866e32ee49e91b9b49 (patch)
tree58c445752c79451fccb310bb1b844c818b7120c4 /usr.sbin/smtpd
parent472f05c2b61b55620b617d142c58e30ac70f60b0 (diff)
reorder pki grammar, no functional change
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/parse.y118
1 files changed, 59 insertions, 59 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y
index b96186eb961..957aaba1d22 100644
--- a/usr.sbin/smtpd/parse.y
+++ b/usr.sbin/smtpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.209 2018/06/01 19:42:24 gilles Exp $ */
+/* $OpenBSD: parse.y,v 1.210 2018/06/01 20:31:33 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -367,6 +367,59 @@ MTA MAX_DEFERRED NUMBER {
;
+pki:
+PKI STRING {
+ char buf[HOST_NAME_MAX+1];
+
+ /* if not catchall, check that it is a valid domain */
+ if (strcmp($2, "*") != 0) {
+ if (!res_hnok($2)) {
+ yyerror("not a valid domain name: %s", $2);
+ free($2);
+ YYERROR;
+ }
+ }
+ xlowercase(buf, $2, sizeof(buf));
+ free($2);
+ pki = dict_get(conf->sc_pki_dict, buf);
+ if (pki == NULL) {
+ pki = xcalloc(1, sizeof *pki);
+ (void)strlcpy(pki->pki_name, buf, sizeof(pki->pki_name));
+ dict_set(conf->sc_pki_dict, pki->pki_name, pki);
+ }
+} pki_params
+;
+
+pki_params_opt:
+CERT STRING {
+ pki->pki_cert_file = $2;
+}
+| KEY STRING {
+ pki->pki_key_file = $2;
+}
+| DHE STRING {
+ if (strcasecmp($2, "none") == 0)
+ pki->pki_dhe = 0;
+ else if (strcasecmp($2, "auto") == 0)
+ pki->pki_dhe = 1;
+ else if (strcasecmp($2, "legacy") == 0)
+ pki->pki_dhe = 2;
+ else {
+ yyerror("invalid DHE keyword: %s", $2);
+ free($2);
+ YYERROR;
+ }
+ free($2);
+}
+;
+
+
+pki_params:
+pki_params_opt pki_params
+| /* empty */
+;
+
+
queue:
QUEUE COMPRESSION {
conf->sc_queue_flags |= QUEUE_COMPRESSION;
@@ -395,6 +448,11 @@ QUEUE COMPRESSION {
;
+scheduler:
+SCHEDULER LIMIT limits_scheduler
+;
+
+
smtp:
SMTP LIMIT limits_smtp
| SMTP CIPHERS STRING {
@@ -419,11 +477,6 @@ SMTP LIMIT limits_smtp
;
-scheduler:
-SCHEDULER LIMIT limits_scheduler
-;
-
-
dispatcher_local_option:
USER STRING {
if (dispatcher->u.local.requires_root) {
@@ -1404,59 +1457,6 @@ if_listen : opt_if_listen if_listen
;
-pki:
-PKI STRING {
- char buf[HOST_NAME_MAX+1];
-
- /* if not catchall, check that it is a valid domain */
- if (strcmp($2, "*") != 0) {
- if (!res_hnok($2)) {
- yyerror("not a valid domain name: %s", $2);
- free($2);
- YYERROR;
- }
- }
- xlowercase(buf, $2, sizeof(buf));
- free($2);
- pki = dict_get(conf->sc_pki_dict, buf);
- if (pki == NULL) {
- pki = xcalloc(1, sizeof *pki);
- (void)strlcpy(pki->pki_name, buf, sizeof(pki->pki_name));
- dict_set(conf->sc_pki_dict, pki->pki_name, pki);
- }
-} pki_params
-;
-
-pki_params_opt:
-CERT STRING {
- pki->pki_cert_file = $2;
-}
-| KEY STRING {
- pki->pki_key_file = $2;
-}
-| DHE STRING {
- if (strcasecmp($2, "none") == 0)
- pki->pki_dhe = 0;
- else if (strcasecmp($2, "auto") == 0)
- pki->pki_dhe = 1;
- else if (strcasecmp($2, "legacy") == 0)
- pki->pki_dhe = 2;
- else {
- yyerror("invalid DHE keyword: %s", $2);
- free($2);
- YYERROR;
- }
- free($2);
-}
-;
-
-
-pki_params:
-pki_params_opt pki_params
-| /* empty */
-;
-
-
listen : LISTEN {
memset(&listen_opts, 0, sizeof listen_opts);
listen_opts.family = AF_UNSPEC;