diff options
-rw-r--r-- | rpkid/rpki/ghostbuster.py | 26 | ||||
-rw-r--r-- | rpkid/rpki/x509.py | 17 |
2 files changed, 42 insertions, 1 deletions
diff --git a/rpkid/rpki/ghostbuster.py b/rpkid/rpki/ghostbuster.py new file mode 100644 index 00000000..151a7cd0 --- /dev/null +++ b/rpkid/rpki/ghostbuster.py @@ -0,0 +1,26 @@ +# $Id$ +""" +Copyright (C) 2011 SPARTA, Inc. dba Cobham Analytic Solutions + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND SPARTA DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL SPARTA BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + + +ASN.1 encoder/decoder for the Ghostbuster record, specified in +draft-ietf-sidr-ghostbusters. +""" + +from rpki.POW._der import * + +class Ghostbuster(OctetString): + pass diff --git a/rpkid/rpki/x509.py b/rpkid/rpki/x509.py index 0fbcf073..9444ae53 100644 --- a/rpkid/rpki/x509.py +++ b/rpkid/rpki/x509.py @@ -46,7 +46,7 @@ PERFORMANCE OF THIS SOFTWARE. import rpki.POW, rpki.POW.pkix, base64, lxml.etree, os, subprocess, sys import email.mime.application, email.utils, mailbox, time import rpki.exceptions, rpki.resource_set, rpki.oids, rpki.sundial -import rpki.manifest, rpki.roa, rpki.log, rpki.async +import rpki.manifest, rpki.roa, rpki.log, rpki.async, rpki.ghostbuster def base64_with_linebreaks(der): """ @@ -1118,6 +1118,21 @@ class ROA(DER_CMS_object): rpki.log.debug("ROA inner content: %r" % (r.get(),)) raise +class Ghostbuster(DER_CMS_object): + """ + Class to hold a signed Ghostbuster record. + """ + + content_class = rpki.ghostbuster.Ghostbuster + + @classmethod + def build(cls, vcard, keypair, certs): + self = cls() + gbr = content_class(vcard) + self.set_content(gbr) + self.sign(keypair, certs) + return self + class DeadDrop(object): """ Dead-drop utility for storing copies of CMS messages for debugging or |