log and handle misformed certificate claims from #1609

This commit is contained in:
Victor Shyba 2018-11-10 17:06:46 -03:00 committed by Lex Berezhny
parent 8394dcb663
commit b31379e51c

View file

@ -383,6 +383,9 @@ def validate_claim_signature_and_get_channel_name(claim, certificate_claim,
claim_address, decoded_certificate=None):
if not certificate_claim:
return False, None
if 'value' not in certificate_claim:
log.warning('Got an invalid claim while parsing certificates, please report: %s', certificate_claim)
return False, None
certificate = decoded_certificate or smart_decode(certificate_claim['value'])
if not isinstance(certificate, ClaimDict):
raise TypeError("Certificate is not a ClaimDict: %s" % str(type(certificate)))