mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-08 11:24:25 +00:00
a module for errors
This commit is contained in:
parent
58e0b27374
commit
5701bad548
@ -31,10 +31,9 @@ from cryptography.hazmat.primitives.serialization import (
|
||||
PublicFormat,
|
||||
)
|
||||
|
||||
from allmydata.crypto import (
|
||||
remove_prefix,
|
||||
BadSignature,
|
||||
)
|
||||
from allmydata.crypto.util import remove_prefix
|
||||
from allmydata.crypto.error import BadSignature
|
||||
|
||||
from allmydata.util.base32 import (
|
||||
a2b,
|
||||
b2a,
|
||||
|
15
src/allmydata/crypto/error.py
Normal file
15
src/allmydata/crypto/error.py
Normal file
@ -0,0 +1,15 @@
|
||||
"""
|
||||
Exceptions raise by allmydata.crypto.* modules
|
||||
"""
|
||||
|
||||
|
||||
class BadSignature(Exception):
|
||||
"""
|
||||
An alleged signature did not match
|
||||
"""
|
||||
|
||||
|
||||
class BadPrefixError(Exception):
|
||||
"""
|
||||
A key did not start with the required prefix
|
||||
"""
|
@ -5,7 +5,7 @@ from cryptography.hazmat.primitives.asymmetric import rsa, padding
|
||||
from cryptography.hazmat.primitives.serialization import load_der_private_key, load_der_public_key, \
|
||||
Encoding, PrivateFormat, PublicFormat, NoEncryption
|
||||
|
||||
from allmydata.crypto import BadSignature
|
||||
from allmydata.crypto.error import BadSignature
|
||||
|
||||
|
||||
"""
|
||||
|
@ -2,17 +2,7 @@
|
||||
Utilities used by allmydata.crypto modules
|
||||
"""
|
||||
|
||||
|
||||
class BadSignature(Exception):
|
||||
"""
|
||||
An alleged signature did not match
|
||||
"""
|
||||
|
||||
|
||||
class BadPrefixError(Exception):
|
||||
"""
|
||||
A key did not start with the required prefix
|
||||
"""
|
||||
from allmydata.crypto.error import BadPrefixError
|
||||
|
||||
|
||||
def remove_prefix(s_bytes, prefix):
|
||||
|
@ -9,7 +9,7 @@ from allmydata.introducer.common import sign_to_foolscap, unsign_from_foolscap,\
|
||||
get_tubid_string_from_ann
|
||||
from allmydata.util import log, yamlutil, connection_status
|
||||
from allmydata.util.rrefutil import add_version_to_remote_reference
|
||||
from allmydata.crypto import BadSignature
|
||||
from allmydata.crypto.error import BadSignature
|
||||
from allmydata.util.assertutil import precondition
|
||||
|
||||
class InvalidCacheError(Exception):
|
||||
|
@ -8,7 +8,7 @@ from twisted.internet import defer
|
||||
from twisted.python import failure
|
||||
from foolscap.api import DeadReferenceError, RemoteException, eventually, \
|
||||
fireEventually
|
||||
from allmydata.crypto import BadSignature
|
||||
from allmydata.crypto.error import BadSignature
|
||||
from allmydata.crypto import rsa
|
||||
from allmydata.util import base32, hashutil, log, deferredutil
|
||||
from allmydata.util.dictutil import DictOfSets
|
||||
|
Loading…
x
Reference in New Issue
Block a user