From 2aec3e61c9130e942cb766aa0e5f4acf900dc921 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 3 Jul 2021 19:08:18 +0200 Subject: ipsec: T2816: provide x509 certificate base auth building blocks --- data/templates/ipsec/swanctl/peer.tmpl | 2 +- .../include/ipsec/authentication-id.xml.i | 11 +++++++++++ .../include/ipsec/authentication-x509.xml.i | 11 +++++++++++ interface-definitions/vpn_ipsec.xml.in | 20 ++------------------ 4 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 interface-definitions/include/ipsec/authentication-id.xml.i create mode 100644 interface-definitions/include/ipsec/authentication-x509.xml.i diff --git a/data/templates/ipsec/swanctl/peer.tmpl b/data/templates/ipsec/swanctl/peer.tmpl index b35cd4b60..4ace06701 100644 --- a/data/templates/ipsec/swanctl/peer.tmpl +++ b/data/templates/ipsec/swanctl/peer.tmpl @@ -31,7 +31,7 @@ encap = yes {% endif %} local { -{% if peer_conf.authentication.id is defined and peer_conf.authentication.use_x509_id is not defined %} +{% if peer_conf.authentication is defined and peer_conf.authentication.id is defined and peer_conf.authentication.use_x509_id is not defined %} id = "{{ peer_conf.authentication.id }}" {% endif %} auth = {{ 'psk' if peer_conf.authentication.mode == 'pre-shared-secret' else 'pubkey' }} diff --git a/interface-definitions/include/ipsec/authentication-id.xml.i b/interface-definitions/include/ipsec/authentication-id.xml.i new file mode 100644 index 000000000..4967782ec --- /dev/null +++ b/interface-definitions/include/ipsec/authentication-id.xml.i @@ -0,0 +1,11 @@ + + + + ID for peer authentication + + txt + ID used for peer authentication + + + + diff --git a/interface-definitions/include/ipsec/authentication-x509.xml.i b/interface-definitions/include/ipsec/authentication-x509.xml.i new file mode 100644 index 000000000..db675c0bf --- /dev/null +++ b/interface-definitions/include/ipsec/authentication-x509.xml.i @@ -0,0 +1,11 @@ + + + + X.509 certificate + + + #include + #include + + + diff --git a/interface-definitions/vpn_ipsec.xml.in b/interface-definitions/vpn_ipsec.xml.in index c301703c3..ff60bb82f 100644 --- a/interface-definitions/vpn_ipsec.xml.in +++ b/interface-definitions/vpn_ipsec.xml.in @@ -737,15 +737,8 @@ Peer authentication [REQUIRED] - - - ID for peer authentication - - txt - ID used for peer authentication - - - + #include + #include Authentication mode @@ -798,15 +791,6 @@ - - - X.509 certificate - - - #include - #include - - -- cgit v1.2.3