mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
Verify the files downloaded from CDNs and raise on sha256 mismatch
This commit is contained in:
@@ -3,7 +3,7 @@ import re
|
||||
|
||||
from .common import (
|
||||
ReadCancelledError, InvalidParameterError, TypeNotFoundError,
|
||||
InvalidChecksumError
|
||||
InvalidChecksumError, CdnFileTamperedError
|
||||
)
|
||||
|
||||
from .rpc_errors import (
|
||||
|
@@ -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.'
|
||||
)
|
||||
|
Reference in New Issue
Block a user