summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-03-21 15:52:43 -0400
committerKali Kaneko <kali@leap.se>2016-03-22 12:49:33 -0400
commit21a0e07ffccbee57fa02f20525441f96516132dc (patch)
tree3f827ffa0019f1b437aff48606db0e8172ecc43e
parent3d2df02b549a32c15b2bb369a33789abadb60c92 (diff)
[bug] re-download smtp certificate if needed.
the should_redownload function was only called if the pemfile was not present of the fs. - Resolves: #7869
-rw-r--r--changes/next-changelog.rst4
-rw-r--r--src/leap/bitmask/services/mail/smtpbootstrapper.py9
2 files changed, 8 insertions, 5 deletions
diff --git a/changes/next-changelog.rst b/changes/next-changelog.rst
index 64774d30..d07273ec 100644
--- a/changes/next-changelog.rst
+++ b/changes/next-changelog.rst
@@ -24,8 +24,10 @@ Bugfixes
- `#7583 <https://leap.se/code/issues/7583>`_: Fix set_soledad_auth_token event callback signature.
- `#7585 <https://leap.se/code/issues/7585>`_: Open email help link on browser.
- `#7598 <https://leap.se/code/issues/7598>`_: Fix errback on InvalidAuthToken.
-- `#1235 <https://leap.se/code/issues/1235>`_: Description for the fixed stuff corresponding with issue #1235.
+- `#7869 <https://leap.se/code/issues/7869>`_: Redownload smtp certificate if needed.
- Do not translate 'https' text on QLabel.
+
+- `#1235 <https://leap.se/code/issues/1235>`_: Description for the fixed stuff corresponding with issue #1235.
- Bugfix without related issue number.
Misc
diff --git a/src/leap/bitmask/services/mail/smtpbootstrapper.py b/src/leap/bitmask/services/mail/smtpbootstrapper.py
index dadf59dd..f73687a7 100644
--- a/src/leap/bitmask/services/mail/smtpbootstrapper.py
+++ b/src/leap/bitmask/services/mail/smtpbootstrapper.py
@@ -29,7 +29,6 @@ from leap.bitmask.logs.utils import get_logger
from leap.bitmask.services import download_service_config
from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper
from leap.bitmask.services.mail.smtpconfig import SMTPConfig
-from leap.bitmask.util import is_file
from leap.common import certs as leap_certs
from leap.common.check import leap_assert
@@ -93,11 +92,13 @@ class SMTPBootstrapper(AbstractBootstrapper):
client_cert_path = self._smtp_config.get_client_cert_path(
self._userid, self._provider_config, about_to_download=True)
- if not is_file(client_cert_path):
+ needs_download = leap_certs.should_redownload(client_cert_path)
+
+ if needs_download:
# For re-download if something is wrong with the cert
+ # FIXME this doesn't read well. should reword the logic here.
self._download_if_needed = (
- self._download_if_needed and
- not leap_certs.should_redownload(client_cert_path))
+ self._download_if_needed and not needs_download)
if self._download_if_needed and os.path.isfile(client_cert_path):
check_and_fix_urw_only(client_cert_path)