mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
cleanup
This commit is contained in:
@@ -4,9 +4,6 @@ from urllib.parse import urlparse
|
||||
|
||||
import requests
|
||||
import six
|
||||
|
||||
# import oscrypto.asymmetric
|
||||
# import oscrypto.errors
|
||||
from cryptography import x509
|
||||
from cryptography.exceptions import InvalidSignature
|
||||
from cryptography.hazmat.primitives import hashes
|
||||
@@ -125,13 +122,6 @@ def validate_sns_cert(sns_payload):
|
||||
public_key.verify(
|
||||
signature, string_to_sign, padding.PKCS1v15(), hashes.SHA256() # or SHA1?
|
||||
)
|
||||
# oscrypto.asymmetric.rsa_pkcs1v15_verify(
|
||||
# oscrypto.asymmetric.load_certificate(certificate),
|
||||
# signature,
|
||||
# string_to_sign,
|
||||
# "sha1",
|
||||
# )
|
||||
return True
|
||||
# except oscrypto.errors.SignatureError:
|
||||
except InvalidSignature:
|
||||
raise ValidationError("Invalid signature")
|
||||
|
||||
Reference in New Issue
Block a user