Commit d5c02a1f authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Romain Bignon

weboob.browser.nss: fix certificate_db_filename nss version parsing

Sometimes, nss_get_version will return "3.21.3 Extended ECC" which
can't be parsed. Trim junk to be able to parse it.
parent eddcfa2c
...@@ -31,6 +31,7 @@ from __future__ import absolute_import ...@@ -31,6 +31,7 @@ from __future__ import absolute_import
from functools import wraps from functools import wraps
from io import RawIOBase, BufferedRWPair from io import RawIOBase, BufferedRWPair
import os import os
import re
import socket import socket
import ssl as basessl import ssl as basessl
import subprocess import subprocess
...@@ -56,7 +57,9 @@ LOGGER = getLogger('weboob.browser.nss') ...@@ -56,7 +57,9 @@ LOGGER = getLogger('weboob.browser.nss')
def certificate_db_filename(): def certificate_db_filename():
version = tuple(int(x) for x in nss.nss.nss_get_version().split('.')) version_str = nss.nss.nss_get_version()
version_str = re.match(r'\d+\.\d+', version_str).group(0) # can be "3.21.3 Extended ECC"
version = tuple(int(x) for x in version_str.split('.'))
# see https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.35_release_notes # see https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.35_release_notes
if version < (3, 35): if version < (3, 35):
return 'cert8.db' return 'cert8.db'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment