Verify the files downloaded from CDNs and raise on sha256 mismatch

This commit is contained in:
Lonami Exo
2017-08-28 14:17:31 +02:00
parent 00b5b5021b
commit b504ce14bc
6 changed files with 65 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ import re
from .common import (
ReadCancelledError, InvalidParameterError, TypeNotFoundError,
InvalidChecksumError
InvalidChecksumError, CdnFileTamperedError
)
from .rpc_errors import (

View File

@@ -35,3 +35,11 @@ class InvalidChecksumError(Exception):
self.checksum = checksum
self.valid_checksum = valid_checksum
class CdnFileTamperedError(Exception):
def __init__(self):
super().__init__(
self,
'The CDN file has been altered and its download cancelled.'
)