From a232b83601f4f8b2fe6964239a568acad3fa764a Mon Sep 17 00:00:00 2001
From: Christian Breunig <christian@breunig.cc>
Date: Mon, 1 Jan 2024 23:47:53 +0100
Subject: wireguard: T3642: use base64 validator

---
 interface-definitions/interfaces_wireguard.xml.in | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/interface-definitions/interfaces_wireguard.xml.in b/interface-definitions/interfaces_wireguard.xml.in
index f3fe0f1da..fba1064ef 100644
--- a/interface-definitions/interfaces_wireguard.xml.in
+++ b/interface-definitions/interfaces_wireguard.xml.in
@@ -44,9 +44,9 @@
             <properties>
               <help>Base64 encoded private key</help>
               <constraint>
-                <regex>[0-9a-zA-Z\+/]{43}=</regex>
+                <validator name="base64"/>
               </constraint>
-              <constraintErrorMessage>Key is not valid 44-character (32-bytes) base64</constraintErrorMessage>
+              <constraintErrorMessage>Key is not base64-encoded</constraintErrorMessage>
             </properties>
           </leafNode>
           <tagNode name="peer">
@@ -64,18 +64,18 @@
                 <properties>
                   <help>base64 encoded public key</help>
                   <constraint>
-                    <regex>[0-9a-zA-Z\+/]{43}=</regex>
+                    <validator name="base64"/>
                   </constraint>
-                  <constraintErrorMessage>Key is not valid 44-character (32-bytes) base64</constraintErrorMessage>
+                  <constraintErrorMessage>Key is not base64-encoded</constraintErrorMessage>
                 </properties>
               </leafNode>
               <leafNode name="preshared-key">
                 <properties>
                   <help>base64 encoded preshared key</help>
                   <constraint>
-                    <regex>[0-9a-zA-Z\+/]{43}=</regex>
+                    <validator name="base64"/>
                   </constraint>
-                  <constraintErrorMessage>Key is not valid 44-character (32-bytes) base64</constraintErrorMessage>
+                  <constraintErrorMessage>Key is not base64-encoded</constraintErrorMessage>
                 </properties>
               </leafNode>
               <leafNode name="allowed-ips">
-- 
cgit v1.2.3