From 622bed116935fcb9740b3c3551eb7fadfe05776f Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 18 Sep 2017 21:29:01 +0200 Subject: [PATCH] [mod] introduce regex for SHA512 --- src/yunohost/dyndns.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/yunohost/dyndns.py b/src/yunohost/dyndns.py index 7bbf5e568..842fdb841 100644 --- a/src/yunohost/dyndns.py +++ b/src/yunohost/dyndns.py @@ -63,11 +63,17 @@ class IPRouteLine(object): for k, v in self.m.groupdict().items(): setattr(self, k, v) -RE_DYNDNS_PRIVATE_KEY = re.compile( + +RE_DYNDNS_PRIVATE_KEY_MD5 = re.compile( r'.*/K(?P[^\s\+]+)\.\+157.+\.private$' ) +RE_DYNDNS_PRIVATE_KEY_SHA512 = re.compile( + r'.*/K(?P[^\s\+]+)\.\+163.+\.private$' +) + + def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None): """ Subscribe to a DynDNS service @@ -176,7 +182,7 @@ def dyndns_update(dyn_host="dyndns.yunohost.org", domain=None, key=None, if domain is None: # Retrieve the first registered domain for path in glob.iglob('/etc/yunohost/dyndns/K*.private'): - match = RE_DYNDNS_PRIVATE_KEY.match(path) + match = RE_DYNDNS_PRIVATE_KEY_MD5.match(path) if not match: continue _domain = match.group('domain')