From 3608abb01a535c35740d82ce37b9ebdef3076886 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Wed, 2 Oct 2019 14:44:25 -0700 Subject: [PATCH 1/2] Remove unnecessary account ID match check. (#7416) * Remove unnecessary account ID match check. Right now the Account object calculates an ID using md5. This is unnecessary and causes problems on FIPS systems that forbid md5. It's just as good to pick a random series of bytes for the ID, since the ID gets read out of renewal/foo.conf. However, if we switched the algorithm right now, we could wind up breaking forward compatibility / downgradeability, since older versions would run into this check. Removing this check now lays the ground to change the ID-calculation algorithm in the future. Related to #1948 and https://github.com/certbot/certbot/pull/1013#issuecomment-149983479. * Remove test. * Remove unused import. --- certbot/account.py | 7 +------ certbot/tests/account_test.py | 8 -------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/certbot/account.py b/certbot/account.py index 7a1e2de7a..992d63d38 100644 --- a/certbot/account.py +++ b/certbot/account.py @@ -231,12 +231,7 @@ class AccountFileStorage(interfaces.AccountStorage): except IOError as error: raise errors.AccountStorageError(error) - acc = Account(regr, key, meta) - if acc.id != account_id: - raise errors.AccountStorageError( - "Account ids mismatch (expected: {0}, found: {1}".format( - account_id, acc.id)) - return acc + return Account(regr, key, meta) def load(self, account_id): return self._load_for_server_path(account_id, self.config.server_path) diff --git a/certbot/tests/account_test.py b/certbot/tests/account_test.py index c14500798..cad103052 100644 --- a/certbot/tests/account_test.py +++ b/certbot/tests/account_test.py @@ -1,7 +1,6 @@ """Tests for certbot.account.""" import datetime import json -import shutil import unittest import josepy as jose @@ -170,13 +169,6 @@ class AccountFileStorageTest(test_util.ConfigTestCase): def test_load_non_existent_raises_error(self): self.assertRaises(errors.AccountNotFound, self.storage.load, "missing") - def test_load_id_mismatch_raises_error(self): - self.storage.save(self.acc, self.mock_client) - shutil.move(os.path.join(self.config.accounts_dir, self.acc.id), - os.path.join(self.config.accounts_dir, "x" + self.acc.id)) - self.assertRaises(errors.AccountStorageError, self.storage.load, - "x" + self.acc.id) - def _set_server(self, server): self.config.server = server from certbot.account import AccountFileStorage From 0cfedbc5f5443e94c6e802d1f8fb46cbc44b776c Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Thu, 3 Oct 2019 15:08:24 -0700 Subject: [PATCH 2/2] Add test farm tests for Debian 10 (#7421) Fixes #7225. I got the AMI ID from https://wiki.debian.org/Cloud/AmazonEC2Image/Buster. You can see all test farm tests including test_tests.sh passing with these changes at https://travis-ci.com/certbot/certbot/builds/130318446. --- tests/letstest/apache2_targets.yaml | 5 +++++ tests/letstest/targets.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/letstest/apache2_targets.yaml b/tests/letstest/apache2_targets.yaml index 490f0eca9..1450a8578 100644 --- a/tests/letstest/apache2_targets.yaml +++ b/tests/letstest/apache2_targets.yaml @@ -18,6 +18,11 @@ targets: user: ubuntu #----------------------------------------------------------------------------- # Debian + - ami: ami-01db78123b2b99496 + name: debian10 + type: ubuntu + virt: hvm + user: admin - ami: ami-003f19e0e687de1cd name: debian9 type: ubuntu diff --git a/tests/letstest/targets.yaml b/tests/letstest/targets.yaml index 8821cbf3b..188be8e24 100644 --- a/tests/letstest/targets.yaml +++ b/tests/letstest/targets.yaml @@ -18,6 +18,11 @@ targets: user: ubuntu #----------------------------------------------------------------------------- # Debian + - ami: ami-01db78123b2b99496 + name: debian10 + type: ubuntu + virt: hvm + user: admin - ami: ami-003f19e0e687de1cd name: debian9 type: ubuntu