diff options
author | Rob Austein <sra@hactrn.net> | 2009-04-28 04:30:04 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-04-28 04:30:04 +0000 |
commit | 1ca7907abe51fb31257c52f8a99628ffd7450284 (patch) | |
tree | 0ad2f0fa5811b5a63491845d53e2eecd6112d143 | |
parent | b316de014e8f49c05969d848718037feb900e54e (diff) |
Cleanup
svn path=/rpkid/rpki/exceptions.py; revision=2366
-rw-r--r-- | rpkid/rpki/exceptions.py | 5 | ||||
-rw-r--r-- | rpkid/rpki/https.py | 13 |
2 files changed, 11 insertions, 7 deletions
diff --git a/rpkid/rpki/exceptions.py b/rpkid/rpki/exceptions.py index 393700e6..70608f5f 100644 --- a/rpkid/rpki/exceptions.py +++ b/rpkid/rpki/exceptions.py @@ -48,7 +48,7 @@ class NotACertificateChain(RPKI_Exception): """Certificates don't form a proper chain.""" class BadContactURL(RPKI_Exception): - """Error trying to parse up-down protocol contact URL.""" + """Error trying to parse contact URL.""" class BadClassNameSyntax(RPKI_Exception): """Illegal syntax for a class_name.""" @@ -133,3 +133,6 @@ class ServerShuttingDown(RPKI_Exception): class NoActiveCA(RPKI_Exception): """No active ca_detail for specified class.""" + +class BadClientURL(RPKI_Exception): + """URL given to HTTPS client does not match profile.""" diff --git a/rpkid/rpki/https.py b/rpkid/rpki/https.py index dd664170..7f805377 100644 --- a/rpkid/rpki/https.py +++ b/rpkid/rpki/https.py @@ -167,12 +167,13 @@ def client(msg, client_key, client_cert, server_ta, url, timeout = 300, callback u = urlparse.urlparse(url) - assert u.scheme in ("", "https") and \ - u.username is None and \ - u.password is None and \ - u.params == "" and \ - u.query == "" and \ - u.fragment == "" + if (u.scheme not in ("", "https") or + u.username is not None or + u.password is not None or + u.params != "" or + u.query != "" or + u.fragment != ""): + raise rpki.exceptions.BadClientURL, "Unusable URL %s" % url rpki.log.debug("Contacting %s" % url) |