Merge pull request #1013 from kuba/bugs/1012

Use PEM for Account.id generation.
This commit is contained in:
Peter Eckersley 2015-10-21 12:05:36 -07:00
commit f9bbb0bf17
2 changed files with 4 additions and 4 deletions

View file

@ -56,7 +56,7 @@ class Account(object): # pylint: disable=too-few-public-methods
self.id = hashlib.md5(
self.key.key.public_key().public_bytes(
encoding=serialization.Encoding.DER,
encoding=serialization.Encoding.PEM,
format=serialization.PublicFormat.SubjectPublicKeyInfo)
).hexdigest()
# Implementation note: Email? Multiple accounts can have the

View file

@ -45,16 +45,16 @@ class AccountTest(unittest.TestCase):
def test_id(self):
self.assertEqual(
self.acc.id, "2ba35a3bdf380ed76a5ac9e740568395")
self.acc.id, "bca5889f66457d5b62fbba7b25f9ab6f")
def test_slug(self):
self.assertEqual(
self.acc.slug, "test.letsencrypt.org@2015-07-04T14:04:10Z (2ba3)")
self.acc.slug, "test.letsencrypt.org@2015-07-04T14:04:10Z (bca5)")
def test_repr(self):
self.assertEqual(
repr(self.acc),
"<Account(2ba35a3bdf380ed76a5ac9e740568395)>")
"<Account(bca5889f66457d5b62fbba7b25f9ab6f)>")
class ReportNewAccountTest(unittest.TestCase):