summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-06-10 10:27:49 +0200
committerGitHub <noreply@github.com>2024-06-10 10:27:49 +0200
commit82607438d6df5291c581d802c7a2a98eabe084ff (patch)
tree3d70559d26469951d4a5b3674d8567be337f6f09 /python
parent7ade4fa71b535289577978a73746c1fc1d993803 (diff)
parent4e51569013b3f78abea9c18e5a6ecb9ff5ae4687 (diff)
downloadvyos-1x-82607438d6df5291c581d802c7a2a98eabe084ff.tar.gz
vyos-1x-82607438d6df5291c581d802c7a2a98eabe084ff.zip
Merge pull request #3610 from c-po/ipsec-profile-T6424
op-mode: T6424: ipsec: honor certificate CN and CA chain during profile generation
Diffstat (limited to 'python')
-rw-r--r--python/vyos/template.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index fbc5f1456..e8d7ba669 100644
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -525,10 +525,17 @@ def get_esp_ike_cipher(group_config, ike_group=None):
return ciphers
@register_filter('get_uuid')
-def get_uuid(interface):
+def get_uuid(seed):
""" Get interface IP addresses"""
- from uuid import uuid1
- return uuid1()
+ if seed:
+ from hashlib import md5
+ from uuid import UUID
+ tmp = md5()
+ tmp.update(seed.encode('utf-8'))
+ return str(UUID(tmp.hexdigest()))
+ else:
+ from uuid import uuid1
+ return uuid1()
openvpn_translate = {
'des': 'des-cbc',