Fix unhandled expcetion on invalid cert

This commit is contained in:
shortcutme 2017-04-12 00:31:37 +02:00
parent 1ee592f5b7
commit 4c7ff9bb53
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 9 additions and 4 deletions

View file

@ -658,9 +658,14 @@ class ContentManager(object):
if not cert_address: # Cert signer not allowed
self.log.warning("Invalid cert signer: %s" % domain)
return False
return CryptBitcoin.verify(
"%s#%s/%s" % (rules["user_address"], content["cert_auth_type"], name), cert_address, content["cert_sign"]
)
try:
cert_subject = "%s#%s/%s" % (rules["user_address"], content["cert_auth_type"], name)
result = CryptBitcoin.verify(cert_subject, cert_address, content["cert_sign"])
except Exception, err:
self.log.warning("Certificate verify error: %s" % err)
result = False
return result
# Checks if the content.json content is valid
# Return: True or False