diff options
author | Rob Austein <sra@hactrn.net> | 2007-11-08 05:41:17 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-11-08 05:41:17 +0000 |
commit | 7fd473696517bb7b2d0cfbd984b279bc5745ba2a (patch) | |
tree | 40affa36f53c8e5f1af138ba1881a1f3193d0c23 /scripts/rpki/up_down.py | |
parent | 72a9e65ad586cf45f653b5a5025210d039ecd35a (diff) |
Consolidate mapping between strings and OIDs
svn path=/scripts/rpki/up_down.py; revision=1271
Diffstat (limited to 'scripts/rpki/up_down.py')
-rw-r--r-- | scripts/rpki/up_down.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/scripts/rpki/up_down.py b/scripts/rpki/up_down.py index a7015396..50a1b271 100644 --- a/scripts/rpki/up_down.py +++ b/scripts/rpki/up_down.py @@ -9,21 +9,6 @@ xmlns="http://www.apnic.net/specs/rescerts/up-down/" nsmap = { None : xmlns } -oid2name = { - (1, 2, 840, 113549, 1, 1, 11) : "sha256WithRSAEncryption", - (1, 2, 840, 113549, 1, 1, 12) : "sha384WithRSAEncryption", - (1, 2, 840, 113549, 1, 1, 13) : "sha512WithRSAEncryption", - (2, 5, 29, 19) : "basicConstraints", - (2, 5, 29, 15) : "keyUsage", - (1, 3, 6, 1, 5, 5, 7, 1, 11) : "subjectInfoAccess", - (1, 3, 6, 1, 5, 5, 7, 48, 2) : "caIssuers", - (1, 3, 6, 1, 5, 5, 7, 48, 5) : "caRepository", - (1, 3, 6, 1, 5, 5, 7, 48, 9) : "signedObjectRepository", - (1, 3, 6, 1, 5, 5, 7, 48, 10) : "rpkiManifest", -} - -name2oid = dict((v,k) for k,v in oid2name.items()) - class base_elt(object): """Generic PDU object. @@ -303,8 +288,8 @@ class issue_pdu(base_elt): def query(cls, gctx, parent, ca, ca_detail): """Send an "issue" request to parent associated with ca.""" assert ca_detail is not None and ca_detail.state != "deprecated" - sia = (((1, 3, 6, 1, 5, 5, 7, 48, 5), ("uri", ca.sia_uri)), - ((1, 3, 6, 1, 5, 5, 7, 48, 10), ("uri", ca.sia_uri + ca_detail.public_key.gSKI() + ".mnf"))) + sia = ((rpki.x509.name2oid["caRepository"], ("uri", ca.sia_uri)), + (rpki.x509.name2oid["rpkiManifest"], ("uri", ca.sia_uri + ca_detail.public_key.gSKI() + ".mnf"))) self = cls() self.class_name = ca.parent_resource_class self.pkcs10 = rpki.x509.PKCS10.create_ca(ca_detail.private_key_id, sia) |