Tested and fixed file copying from Crypto.decrypt_project
In the function for grabbing project files (`Config.get_project_files`) I was overcomplicating getting the current working directory. Simplified the process and removed the bug!
This commit is contained in:
parent
b56bb83558
commit
c32201fd05
3 changed files with 28 additions and 25 deletions
pappyproxy
|
@ -124,18 +124,6 @@ class PappyConfig(object):
|
|||
|
||||
:Default: 'project.crypt'
|
||||
|
||||
.. data: crypt_mode
|
||||
|
||||
Boolean value to determine whether project is being decrypted or encrypted, during
|
||||
start-up and tear-down respectively.
|
||||
|
||||
.. data: salt
|
||||
|
||||
Nonce value used for key derivation. Generated by reading 16 bytes
|
||||
from /dev/urandom.
|
||||
|
||||
:Default: ``os.urandom(16)``
|
||||
|
||||
.. data: salt_file
|
||||
|
||||
Clear-text file containing the salt generated for key derivation. A new salt
|
||||
|
@ -175,8 +163,6 @@ class PappyConfig(object):
|
|||
self.archive = 'project.archive'
|
||||
self.crypt_dir = os.path.join(os.getcwd(), 'crypt')
|
||||
self.crypt_file = 'project.crypt'
|
||||
self.crypt_mode = None
|
||||
self.salt = os.urandom(16)
|
||||
self.salt_file = 'project.salt'
|
||||
|
||||
def get_default_config(self):
|
||||
|
@ -188,12 +174,14 @@ class PappyConfig(object):
|
|||
|
||||
def get_project_files(self):
|
||||
file_glob = glob.glob('*')
|
||||
pp = os.path.join(os.getcwd())
|
||||
pp = os.getcwd() + os.sep
|
||||
project_files = [pp+f for f in file_glob if os.path.isfile(pp+f)]
|
||||
|
||||
if self.salt_file in project_files:
|
||||
project_files.remove(self.salt_file)
|
||||
if self.crypt_file in project_files:
|
||||
project_files.remove(self.crypt_file)
|
||||
|
||||
return project_files
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue