2012-04-07 Bob Halley <halley@dnspython.org>
+ * dns/rdtypes/ANY/SSHFP.py (SSHFP.from_text): Allow whitespace in
+ the text string. Thanks to Jan Andres for the report and the
+ patch.
+
* dns/message.py (from_wire): dns.message.from_wire() now takes
an 'ignore_trailing' parameter which defaults to False. If set
to True, then trailing junk will be ignored instead of causing
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
algorithm = tok.get_uint8()
fp_type = tok.get_uint8()
- fingerprint = bytes.fromhex(tok.get_string())
- tok.get_eol()
+ chunks = []
+ while 1:
+ t = tok.get().unescape()
+ if t.is_eol_or_eof():
+ break
+ if not t.is_identifier():
+ raise dns.exception.SyntaxError
+ chunks.append(t.value)
+ hex = ''.join(chunks)
+ fingerprint = bytes.fromhex(hex)
return cls(rdclass, rdtype, algorithm, fp_type, fingerprint)
from_text = classmethod(from_text)