server/func/posts: explicity specify MD5 for post security hash

This commit is contained in:
Shyam Sunder 2020-01-12 12:54:28 -05:00
parent dce7136f15
commit 0ff9f9d5a2

View file

@ -88,7 +88,8 @@ FLAG_MAP = {
def get_post_security_hash(id: int) -> str: def get_post_security_hash(id: int) -> str:
return hmac.new( return hmac.new(
config.config['secret'].encode('utf8'), config.config['secret'].encode('utf8'),
str(id).encode('utf-8')).hexdigest()[0:16] msg=str(id).encode('utf-8'),
digestmod='md5').hexdigest()[0:16]
def get_post_content_url(post: model.Post) -> str: def get_post_content_url(post: model.Post) -> str: