-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode OIDs from ASN.1 BER for display #2
Conversation
Shouldn't we show the OID in the canonical form used everywhere which uses dots ? |
Yeah, I have just changed it to use that form: >>> MechType.kerberos
<OID 1.2.840.113554.1.2.2> I feel that we should make it possible to construct an OID from a dot-separated string, too. I'd propose changing the |
On Sun, 30 Nov 2014 09:15:17 -0800
Makes sense. |
Can you incorporate #3 (tests for this functionality), please? As for constructing an OID from not-BER-encoded-form, I would create a separate I would leave the |
If we're going to do a lot of ASN.1 parsing, we might want to switch to a dedicated ASN.1 module, but I think given the (relatively) small of what we need to parse, that'd be overkill for now. I think this is good to have for clarity reasons; please be sure this gets merged when #3 does. |
LGTM |
Before merging these changes I wanted to run the tests and check that they actually passed. I'm working on Mac OS X, so I thought I'd use Vagrant to start a Linux VM to run the tests in. What Linux distro is best to use for testing? I was going to use Debian but I see there's no Debian package for Python 3.3, only Python 3.4. Related to this, would a Vagrantfile be a useful addition to the repository? The Vagrantfile would contain scripts for provisioning a VM with Vagrant for working on the project. If so, I can add one when I've got my VM set up. |
This commit causes `repr` for OIDs to display the OID in dotted form instead of as the raw ASN.1 BER-encoded bytes. Also-Authored-By: Simo Sorce <simo@redhat.com>
This commit introduces support for constructing OIDs using integers (instead of having to pass the BER-encoded bytes to the constructor).
e189a0d
to
9892d4d
Compare
The bytes in the gss_OID_desc structure are the ASN.1 BER encoded form of the OID. When displaying the OID we should show the human-readable form of the OID. In my python-gssapi library I added a dependency on pyasn1 just for decoding OIDs, but in the interest of keeping dependencies simple, I wrote a basic decoder for the BER encoded OID data. This makes the
repr()
of OID objects match the human-readable form:before:
after: