aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-11-02 19:00:54 -0400
committerRob Austein <sra@hactrn.net>2016-11-02 19:00:54 -0400
commitf8bf9c9138b676ea4a8c6903415f12e85f4f026c (patch)
tree29a7ea85d6a79b2adb4caa43fbeff685c3c93aa9
parent130995be14d274b977e6540e8c428205c8d576aa (diff)
Get rid of libhal.Attribute (dict suffices).
-rw-r--r--libhal.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/libhal.py b/libhal.py
index 732e34f..06445f0 100644
--- a/libhal.py
+++ b/libhal.py
@@ -232,20 +232,6 @@ HAL_KEY_FLAG_USAGE_DATAENCIPHERMENT = (1 << 2)
HAL_KEY_FLAG_TOKEN = (1 << 3)
HAL_KEY_FLAG_PUBLIC = (1 << 4)
-class Attribute(object):
-
- def __init__(self, type, value):
- self.type = type
- self.value = value
-
- def __repr__(self):
- #return "<Attribute {} {}>".format(self.type, "".join("{:02x}".format(ord(v)) for v in self.value))
- return "<Attribute {} {}>".format(self.type, self.value)
-
- def xdr_packer(self, packer):
- packer.pack_uint(self.type)
- packer.pack_bytes(self.value)
-
class UUID(uuid.UUID):
@@ -676,7 +662,7 @@ class HSM(object):
def pkey_get_attribute(self, pkey, attr_type, value_max = 1024):
with self.rpc(RPC_FUNC_PKEY_GET_ATTRIBUTE, pkey, attr_type, value_max) as r:
- return Attribute(attr_type, r.unpack_bytes())
+ return r.unpack_bytes()
def pkey_delete_attribute(self, pkey, attr_type):
with self.rpc(RPC_FUNC_PKEY_DELETE_ATTRIBUTE, pkey, attr_type):