aboutsummaryrefslogtreecommitdiff
path: root/libhal.py
AgeCommit message (Collapse)Author
2016-10-24Flesh out key object access control.Rob Austein
This is more complicated than I'd have liked, because the PKCS #11 semantics are (much) more complicated than just "are you logged in?" New code passes basic testing with libhal.py and the PKCS #11 unit tests, but there are still unexplored corner cases to be checked. Private token objects remain simple. Code which does not need PKCS HAL_KEY_FLAG_TOKEN and avoid HAL_KEY_FLAG_PUBLIC.
2016-10-24Make previous_uuid an input-only argument to hal_rpc_pkey_match().Rob Austein
In retrospect it's obvious that this never needed to be an input/output argument, as its value will always be the same as the last value in the returned array. Doh. So simplify the RPC and call sequence slightly by removing the unnecessary output value.
2016-10-21Tweak enum handling to handle more of the C enum definition syntax.Rob Austein
Intent is to make it easier just to paste C enum definitions into Python code and have the right thing happen, to simplify keeping C and Python definitions in sync.
2016-10-21Better enum handling, more readable RPC methods.Rob Austein
Using a context manager allows us to write the individual RPC methods fairly legibly, while still enforcing xdrlib.Unpacker.done() logic. Python doesn't really have enums in the sense that C does, and many people have put entirely too much skull sweat into trying to invent the Most Pythonic reimplementation of the enum concept, but an int subclass with a few extra methods is close enough for our purposes.
2016-10-20Fix HAL_KEY_TYPE_* symbols, add Attribute class.Rob Austein
2016-10-19Add handle objects to make API a bit more Pythonic.Rob Austein
2016-10-19First cut at Python interface to native libhal RPC.Rob Austein