summaryrefslogtreecommitdiff
path: root/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-08-27 16:07:52 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-08-27 17:40:39 +0200
commit8bd71350abe48fdcfc0125e48fa97abdf31e1270 (patch)
tree2873d7fc77f9ec1992e24886a9feae80b48ffaef /lib/dnspython/dns/rdtypes/ANY/SSHFP.py
parentbd01a8e79faa3d657f01529c063cd0e09d711880 (diff)
downloadsamba-8bd71350abe48fdcfc0125e48fa97abdf31e1270.tar.gz
samba-8bd71350abe48fdcfc0125e48fa97abdf31e1270.tar.bz2
samba-8bd71350abe48fdcfc0125e48fa97abdf31e1270.zip
dnspython: Update to latest upstream snapshot.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Aug 27 17:40:39 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/dnspython/dns/rdtypes/ANY/SSHFP.py')
-rw-r--r--lib/dnspython/dns/rdtypes/ANY/SSHFP.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/dnspython/dns/rdtypes/ANY/SSHFP.py b/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
index 162dda5c48..cec650a570 100644
--- a/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
+++ b/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2007, 2009, 2010 Nominum, Inc.
+# Copyright (C) 2005-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -30,7 +30,7 @@ class SSHFP(dns.rdata.Rdata):
@see: draft-ietf-secsh-dns-05.txt"""
__slots__ = ['algorithm', 'fp_type', 'fingerprint']
-
+
def __init__(self, rdclass, rdtype, algorithm, fp_type,
fingerprint):
super(SSHFP, self).__init__(rdclass, rdtype)
@@ -43,7 +43,7 @@ class SSHFP(dns.rdata.Rdata):
self.fp_type,
dns.rdata._hexify(self.fingerprint,
chunksize=128))
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
algorithm = tok.get_uint8()
fp_type = tok.get_uint8()
@@ -51,19 +51,19 @@ class SSHFP(dns.rdata.Rdata):
fingerprint = fingerprint.decode('hex_codec')
tok.get_eol()
return cls(rdclass, rdtype, algorithm, fp_type, fingerprint)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
header = struct.pack("!BB", self.algorithm, self.fp_type)
file.write(header)
file.write(self.fingerprint)
-
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
header = struct.unpack("!BB", wire[current : current + 2])
current += 2
rdlen -= 2
- fingerprint = wire[current : current + rdlen]
+ fingerprint = wire[current : current + rdlen].unwrap()
return cls(rdclass, rdtype, header[0], header[1], fingerprint)
from_wire = classmethod(from_wire)