- Support signature verification with SubjectPublicKeyInfo formatted keys
since, although rare, they are RFC 6376 specified (LP: #1851862)
This commit is contained in:
@@ -3,6 +3,8 @@ Version 1.0.0
|
||||
- Add new timeout parameter to enable DNS lookup timeouts to be adjusted
|
||||
- Add new DKIM.present function to allow applications to test if a DKIM
|
||||
signature is present without doing validation (LP: #1851141)
|
||||
- Support signature verification with SubjectPublicKeyInfo formatted keys
|
||||
since, although rare, they are RFC 6376 specified (LP: #1851862)
|
||||
- Drop usage of pymilter Milter.dns in dnsplug since it doesn't support
|
||||
havine a timeout passed to it
|
||||
|
||||
|
||||
+5
-2
@@ -118,8 +118,11 @@ def parse_public_key(data):
|
||||
# Not sure why the [1:] is necessary to skip a byte.
|
||||
x = asn1_parse(ASN1_Object, data)
|
||||
pkd = asn1_parse(ASN1_RSAPublicKey, x[0][1][1:])
|
||||
except ASN1FormatError as e:
|
||||
raise UnparsableKeyError('Unparsable public key: ' + str(e))
|
||||
except ASN1FormatError as e_spki:
|
||||
try:
|
||||
pkd = asn1_parse(ASN1_RSAPublicKey, data)
|
||||
except ASN1FormatError as e_rsa:
|
||||
raise UnparsableKeyError('Unparsable public key; SubjectPublicKeyInfo: ' + str(e_spki) + '; RSAPublicKey: ' + str(e_rsa))
|
||||
pk = {
|
||||
'modulus': pkd[0][0],
|
||||
'publicExponent': pkd[0][1],
|
||||
|
||||
Reference in New Issue
Block a user