mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-10 22:43:52 +00:00
replaced referecnes to pycryptopp AES with own wrapper
This commit is contained in:
parent
1dff7f93bd
commit
008825b0fd
@ -6,6 +6,7 @@ from twisted.internet import defer
|
|||||||
from foolscap.api import fireEventually
|
from foolscap.api import fireEventually
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from allmydata.crypto.aes import AES
|
||||||
from allmydata.deep_stats import DeepStats
|
from allmydata.deep_stats import DeepStats
|
||||||
from allmydata.mutable.common import NotWriteableError
|
from allmydata.mutable.common import NotWriteableError
|
||||||
from allmydata.mutable.filenode import MutableFileNode
|
from allmydata.mutable.filenode import MutableFileNode
|
||||||
@ -22,7 +23,6 @@ from allmydata.util.assertutil import precondition
|
|||||||
from allmydata.util.netstring import netstring, split_netstring
|
from allmydata.util.netstring import netstring, split_netstring
|
||||||
from allmydata.util.consumer import download_to_data
|
from allmydata.util.consumer import download_to_data
|
||||||
from allmydata.uri import wrap_dirnode_cap
|
from allmydata.uri import wrap_dirnode_cap
|
||||||
from pycryptopp.cipher.aes import AES
|
|
||||||
from allmydata.util.dictutil import AuxValueDict
|
from allmydata.util.dictutil import AuxValueDict
|
||||||
|
|
||||||
from eliot import (
|
from eliot import (
|
||||||
|
@ -7,12 +7,12 @@ from twisted.internet import defer
|
|||||||
|
|
||||||
from allmydata import uri
|
from allmydata import uri
|
||||||
from twisted.internet.interfaces import IConsumer
|
from twisted.internet.interfaces import IConsumer
|
||||||
|
from allmydata.crypto.aes import AES
|
||||||
from allmydata.interfaces import IImmutableFileNode, IUploadResults
|
from allmydata.interfaces import IImmutableFileNode, IUploadResults
|
||||||
from allmydata.util import consumer
|
from allmydata.util import consumer
|
||||||
from allmydata.check_results import CheckResults, CheckAndRepairResults
|
from allmydata.check_results import CheckResults, CheckAndRepairResults
|
||||||
from allmydata.util.dictutil import DictOfSets
|
from allmydata.util.dictutil import DictOfSets
|
||||||
from allmydata.util.happinessutil import servers_of_happiness
|
from allmydata.util.happinessutil import servers_of_happiness
|
||||||
from pycryptopp.cipher.aes import AES
|
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from allmydata.immutable.checker import Checker
|
from allmydata.immutable.checker import Checker
|
||||||
|
@ -5,6 +5,7 @@ from twisted.internet import defer
|
|||||||
from twisted.application import service
|
from twisted.application import service
|
||||||
from foolscap.api import Referenceable, Copyable, RemoteCopy, fireEventually
|
from foolscap.api import Referenceable, Copyable, RemoteCopy, fireEventually
|
||||||
|
|
||||||
|
from allmydata.crypto.aes import AES
|
||||||
from allmydata.util.hashutil import file_renewal_secret_hash, \
|
from allmydata.util.hashutil import file_renewal_secret_hash, \
|
||||||
file_cancel_secret_hash, bucket_renewal_secret_hash, \
|
file_cancel_secret_hash, bucket_renewal_secret_hash, \
|
||||||
bucket_cancel_secret_hash, plaintext_hasher, \
|
bucket_cancel_secret_hash, plaintext_hasher, \
|
||||||
@ -23,7 +24,6 @@ from allmydata.interfaces import IUploadable, IUploader, IUploadResults, \
|
|||||||
NoServersError, InsufficientVersionError, UploadUnhappinessError, \
|
NoServersError, InsufficientVersionError, UploadUnhappinessError, \
|
||||||
DEFAULT_MAX_SEGMENT_SIZE, IProgress, IPeerSelector
|
DEFAULT_MAX_SEGMENT_SIZE, IProgress, IPeerSelector
|
||||||
from allmydata.immutable import layout
|
from allmydata.immutable import layout
|
||||||
from pycryptopp.cipher.aes import AES
|
|
||||||
|
|
||||||
from six.moves import cStringIO as StringIO
|
from six.moves import cStringIO as StringIO
|
||||||
from happiness_upload import share_placement, calculate_happiness
|
from happiness_upload import share_placement, calculate_happiness
|
||||||
@ -1064,8 +1064,8 @@ class EncryptAnUploadable(object):
|
|||||||
self._plaintext_hasher.update(chunk)
|
self._plaintext_hasher.update(chunk)
|
||||||
self._update_segment_hash(chunk)
|
self._update_segment_hash(chunk)
|
||||||
# TODO: we have to encrypt the data (even if hash_only==True)
|
# TODO: we have to encrypt the data (even if hash_only==True)
|
||||||
# because pycryptopp's AES-CTR implementation doesn't offer a
|
# because the AES-CTR implementation doesn't offer a
|
||||||
# way to change the counter value. Once pycryptopp acquires
|
# way to change the counter value. Once it acquires
|
||||||
# this ability, change this to simply update the counter
|
# this ability, change this to simply update the counter
|
||||||
# before each call to (hash_only==False) _encryptor.process()
|
# before each call to (hash_only==False) _encryptor.process()
|
||||||
ciphertext = self._encryptor.process(chunk)
|
ciphertext = self._encryptor.process(chunk)
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
from twisted.internet import defer, reactor
|
from twisted.internet import defer, reactor
|
||||||
from foolscap.api import eventually
|
from foolscap.api import eventually
|
||||||
|
|
||||||
|
from allmydata.crypto.aes import AES
|
||||||
from allmydata.interfaces import IMutableFileNode, ICheckable, ICheckResults, \
|
from allmydata.interfaces import IMutableFileNode, ICheckable, ICheckResults, \
|
||||||
NotEnoughSharesError, MDMF_VERSION, SDMF_VERSION, IMutableUploadable, \
|
NotEnoughSharesError, MDMF_VERSION, SDMF_VERSION, IMutableUploadable, \
|
||||||
IMutableFileVersion, IWriteable
|
IMutableFileVersion, IWriteable
|
||||||
@ -12,8 +13,6 @@ from allmydata.util.assertutil import precondition
|
|||||||
from allmydata.uri import WriteableSSKFileURI, ReadonlySSKFileURI, \
|
from allmydata.uri import WriteableSSKFileURI, ReadonlySSKFileURI, \
|
||||||
WriteableMDMFFileURI, ReadonlyMDMFFileURI
|
WriteableMDMFFileURI, ReadonlyMDMFFileURI
|
||||||
from allmydata.monitor import Monitor
|
from allmydata.monitor import Monitor
|
||||||
from pycryptopp.cipher.aes import AES
|
|
||||||
|
|
||||||
from allmydata.mutable.publish import Publish, MutableData,\
|
from allmydata.mutable.publish import Publish, MutableData,\
|
||||||
TransformingUploadable
|
TransformingUploadable
|
||||||
from allmydata.mutable.common import MODE_READ, MODE_WRITE, MODE_CHECK, UnrecoverableFileError, \
|
from allmydata.mutable.common import MODE_READ, MODE_WRITE, MODE_CHECK, UnrecoverableFileError, \
|
||||||
|
@ -4,15 +4,15 @@ from itertools import count
|
|||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.python import failure
|
from twisted.python import failure
|
||||||
|
|
||||||
|
from allmydata.crypto.aes import AES
|
||||||
from allmydata.interfaces import IPublishStatus, SDMF_VERSION, MDMF_VERSION, \
|
from allmydata.interfaces import IPublishStatus, SDMF_VERSION, MDMF_VERSION, \
|
||||||
IMutableUploadable
|
IMutableUploadable
|
||||||
from allmydata.util import base32, hashutil, mathutil, log
|
from allmydata.util import base32, hashutil, mathutil, log
|
||||||
from allmydata.util.dictutil import DictOfSets
|
from allmydata.util.dictutil import DictOfSets
|
||||||
from allmydata import hashtree, codec
|
from allmydata import hashtree, codec
|
||||||
from allmydata.storage.server import si_b2a
|
from allmydata.storage.server import si_b2a
|
||||||
from pycryptopp.cipher.aes import AES
|
|
||||||
from foolscap.api import eventually, fireEventually
|
from foolscap.api import eventually, fireEventually
|
||||||
|
|
||||||
from allmydata.mutable.common import MODE_WRITE, MODE_CHECK, MODE_REPAIR, \
|
from allmydata.mutable.common import MODE_WRITE, MODE_CHECK, MODE_REPAIR, \
|
||||||
UncoordinatedWriteError, NotEnoughServersError
|
UncoordinatedWriteError, NotEnoughServersError
|
||||||
from allmydata.mutable.servermap import ServerMap
|
from allmydata.mutable.servermap import ServerMap
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from itertools import count
|
from itertools import count
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
@ -8,6 +8,7 @@ from twisted.internet.interfaces import IPushProducer, IConsumer
|
|||||||
from foolscap.api import eventually, fireEventually, DeadReferenceError, \
|
from foolscap.api import eventually, fireEventually, DeadReferenceError, \
|
||||||
RemoteException
|
RemoteException
|
||||||
|
|
||||||
|
from allmydata.crypto.aes import AES
|
||||||
from allmydata.interfaces import IRetrieveStatus, NotEnoughSharesError, \
|
from allmydata.interfaces import IRetrieveStatus, NotEnoughSharesError, \
|
||||||
DownloadStopped, MDMF_VERSION, SDMF_VERSION
|
DownloadStopped, MDMF_VERSION, SDMF_VERSION
|
||||||
from allmydata.util.assertutil import _assert, precondition
|
from allmydata.util.assertutil import _assert, precondition
|
||||||
@ -15,7 +16,7 @@ from allmydata.util import hashutil, log, mathutil, deferredutil
|
|||||||
from allmydata.util.dictutil import DictOfSets
|
from allmydata.util.dictutil import DictOfSets
|
||||||
from allmydata import hashtree, codec
|
from allmydata import hashtree, codec
|
||||||
from allmydata.storage.server import si_b2a
|
from allmydata.storage.server import si_b2a
|
||||||
from pycryptopp.cipher.aes import AES
|
|
||||||
from pycryptopp.publickey import rsa
|
from pycryptopp.publickey import rsa
|
||||||
|
|
||||||
from allmydata.mutable.common import CorruptShareError, BadShareError, \
|
from allmydata.mutable.common import CorruptShareError, BadShareError, \
|
||||||
|
@ -5,12 +5,12 @@ from twisted.application import service
|
|||||||
|
|
||||||
from foolscap.api import Tub, fireEventually, flushEventualQueue
|
from foolscap.api import Tub, fireEventually, flushEventualQueue
|
||||||
|
|
||||||
|
from allmydata.crypto.aes import AES
|
||||||
from allmydata.storage.server import si_b2a
|
from allmydata.storage.server import si_b2a
|
||||||
from allmydata.storage_client import StorageFarmBroker
|
from allmydata.storage_client import StorageFarmBroker
|
||||||
from allmydata.immutable import offloaded, upload
|
from allmydata.immutable import offloaded, upload
|
||||||
from allmydata import uri, client
|
from allmydata import uri, client
|
||||||
from allmydata.util import hashutil, fileutil, mathutil
|
from allmydata.util import hashutil, fileutil, mathutil
|
||||||
from pycryptopp.cipher.aes import AES
|
|
||||||
|
|
||||||
MiB = 1024*1024
|
MiB = 1024*1024
|
||||||
|
|
||||||
|
@ -16,8 +16,7 @@ if sys.platform == "win32":
|
|||||||
|
|
||||||
from twisted.python import log
|
from twisted.python import log
|
||||||
|
|
||||||
from pycryptopp.cipher.aes import AES
|
from allmydata.crypto.aes import AES
|
||||||
|
|
||||||
from allmydata.util.assertutil import _assert
|
from allmydata.util.assertutil import _assert
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user