1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-16 19:00:54 +00:00

Switch from md5 to sha256 for UIDs and tokens

This commit is contained in:
Unrud 2020-01-15 11:20:48 +01:00
parent 6697a6c8c4
commit c99a1f53df
5 changed files with 13 additions and 12 deletions

View file

@ -25,7 +25,7 @@ Take a look at the class ``BaseCollection`` if you want to implement your own.
import contextlib
import json
from hashlib import md5
from hashlib import sha256
import pkg_resources
import vobject
@ -79,7 +79,7 @@ class BaseCollection:
@property
def etag(self):
"""Encoded as quoted-string (see RFC 2616)."""
etag = md5()
etag = sha256()
for item in self.get_all():
etag.update((item.href + "/" + item.etag).encode("utf-8"))
etag.update(json.dumps(self.get_meta(), sort_keys=True).encode())