diff options
author | Christian Breunig <christian@breunig.cc> | 2024-06-10 13:44:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-10 13:44:39 +0200 |
commit | 4a974f7eb221ec93432eae546269b5308263a898 (patch) | |
tree | 7267eb5b47875083e25107662f4cc354283c6895 /python | |
parent | cff3c4dce69f2b28450403cffe9232d30f685650 (diff) | |
parent | 92bea910f6ff89c57bff382d7dc44c9118dbdce1 (diff) | |
download | vyos-1x-4a974f7eb221ec93432eae546269b5308263a898.tar.gz vyos-1x-4a974f7eb221ec93432eae546269b5308263a898.zip |
Merge pull request #3619 from vyos/mergify/bp/sagitta/pr-3610
op-mode: T6424: ipsec: honor certificate CN and CA chain during profile generation (backport #3610)
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/template.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index cdcbdc6c3..a4fff649c 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -523,10 +523,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', |