00001 """Exception definitions for RPKI modules. 00002 00003 $Id: exceptions.py 1873 2008-06-12 02:49:41Z sra $ 00004 00005 Copyright (C) 2007--2008 American Registry for Internet Numbers ("ARIN") 00006 00007 Permission to use, copy, modify, and distribute this software for any 00008 purpose with or without fee is hereby granted, provided that the above 00009 copyright notice and this permission notice appear in all copies. 00010 00011 THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH 00012 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 00013 AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT, 00014 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00015 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00016 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00017 PERFORMANCE OF THIS SOFTWARE. 00018 """ 00019 00020 class RPKI_Exception(Exception): 00021 """Base class for RPKI exceptions.""" 00022 00023 class NotInDatabase(RPKI_Exception): 00024 """Lookup failed for an object expected to be in the database.""" 00025 00026 class BadURISyntax(RPKI_Exception): 00027 """Illegal syntax for a URI.""" 00028 00029 class BadStatusCode(RPKI_Exception): 00030 """Unrecognized protocol status code.""" 00031 00032 class BadQuery(RPKI_Exception): 00033 """Unexpected protocol query.""" 00034 00035 class DBConsistancyError(RPKI_Exception): 00036 """Found multiple matches for a database query that shouldn't ever return that.""" 00037 00038 class CMSVerificationFailed(RPKI_Exception): 00039 """Verification of a CMS message failed.""" 00040 00041 class HTTPRequestFailed(RPKI_Exception): 00042 """HTTP request failed.""" 00043 00044 class DERObjectConversionError(RPKI_Exception): 00045 """Error trying to convert a DER-based object from one representation to another.""" 00046 00047 class NotACertificateChain(RPKI_Exception): 00048 """Certificates don't form a proper chain.""" 00049 00050 class BadContactURL(RPKI_Exception): 00051 """Error trying to parse up-down protocol contact URL.""" 00052 00053 class BadClassNameSyntax(RPKI_Exception): 00054 """Illegal syntax for a class_name.""" 00055 00056 class BadIssueResponse(RPKI_Exception): 00057 """issue_response PDU with wrong number of classes or certificates.""" 00058 00059 class NotImplementedYet(RPKI_Exception): 00060 """Internal error -- not implemented yet.""" 00061 00062 class BadPKCS10(RPKI_Exception): 00063 """Bad PKCS #10 object.""" 00064 00065 class UpstreamError(RPKI_Exception): 00066 """Received an error from upstream.""" 00067 00068 class ChildNotFound(RPKI_Exception): 00069 """Could not find specified child in database.""" 00070 00071 class BSCNotFound(RPKI_Exception): 00072 """Could not find specified BSC in database.""" 00073 00074 class BadSender(RPKI_Exception): 00075 """Unexpected XML sender value.""" 00076 00077 class ClassNameMismatch(RPKI_Exception): 00078 """class_name does not match child context.""" 00079 00080 class SKIMismatch(RPKI_Exception): 00081 """SKI value in response does not match request.""" 00082 00083 class SubprocessError(RPKI_Exception): 00084 """Subprocess returned unexpected error.""" 00085 00086 class BadIRDBReply(RPKI_Exception): 00087 """Unexpected reply to IRDB query.""" 00088 00089 class NotFound(RPKI_Exception): 00090 """Object not found in database.""" 00091 00092 class MustBePrefix(RPKI_Exception): 00093 """Resource range cannot be expressed as a prefix.""" 00094 00095 class TLSValidationError(RPKI_Exception): 00096 """TLS certificate validation error.""" 00097 00098 class MultipleTLSEECert(TLSValidationError): 00099 """Received more than one TLS EE certificate.""" 00100 00101 class ReceivedTLSCACert(TLSValidationError): 00102 """Received CA certificate via TLS.""" 00103 00104 class WrongEContentType(RPKI_Exception): 00105 """Received wrong CMS eContentType.""" 00106 00107 class EmptyPEM(RPKI_Exception): 00108 """Couldn't find PEM block to convert.""" 00109 00110 class UnexpectedCMSCerts(RPKI_Exception): 00111 """Received CMS certs when not expecting any.""" 00112 00113 class UnexpectedCMSCRLs(RPKI_Exception): 00114 """Received CMS CRLs when not expecting any.""" 00115 00116 class MissingCMSEEcert(RPKI_Exception): 00117 """Didn't receive CMS EE cert when expecting one.""" 00118 00119 class MissingCMSCRL(RPKI_Exception): 00120 """Didn't receive CMS CRL when expecting one.""" 00121 00122 class UnparsableCMSDER(RPKI_Exception): 00123 """Alleged CMS DER wasn't parsable.""" 00124 00125 class CMSCRLNotSet(RPKI_Exception): 00126 """CMS CRL has not been configured.""" 00127 00128 class ServerShuttingDown(RPKI_Exception): 00129 """Server is shutting down."""