Skip to content

Commit

Permalink
Merge pull request #12 from jvarho/python3
Browse files Browse the repository at this point in the history
Drop python2 support, support newest fusepy and python
  • Loading branch information
jvarho committed Nov 14, 2020
2 parents 7858259 + e8ea960 commit f08cb16
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ branches:
- master

python:
- "2.7"
- "3.4"
- "3.9"

addons:
apt:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2017, Jan Varho
Copyright (c) 2016-2020, Jan Varho

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
testall:
python2 rencfs-test.py
python3 rencfs-test.py

test:
python rencfs-test.py
python3 rencfs-test.py

coveralls:
python -m coverage run --branch rencfs-test.py
python3 -m coverage run --branch rencfs-test.py

coverage:
python -m coverage run --branch rencfs-test.py
python -m coverage report --include=rencfs.py
python -m coverage html --include=rencfs.py
python3 -m coverage run --branch rencfs-test.py
python3 -m coverage report --include=rencfs.py
python3 -m coverage html --include=rencfs.py
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Installation:
---

Requires:
* Python 2.7 or 3.4+
* Python 3.4+
* fusepy, e.g. `pip install fusepy`

One of:
Expand Down
11 changes: 9 additions & 2 deletions aes.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
#!/usr/bin/python3

# Copyright (c) 2017, Jan Varho
# Copyright (c) 2017-2020, Jan Varho
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -65,3 +65,10 @@ def pycrypto_aes_ctr(key, index):
pycrypto_aes_ecb(b'\1'*16)
aes_ecb = pycrypto_aes_ecb
aes_ctr = pycrypto_aes_ctr

if __name__ == '__main__': #pragma no cover
a = aes_ecb(b'\1'*16).encrypt(b'\0'*16)
b = aes_ctr(b'\1'*16, 0).encrypt(b'\0'*16)
c = aes_ctr(b'\1'*16, 1).encrypt(b'\0'*16)
assert a == b
assert a != c
10 changes: 7 additions & 3 deletions rencfs-test.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
#!/usr/bin/python3

# Copyright (c) 2016, Jan Varho
# Copyright (c) 2016-2020, Jan Varho
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand All @@ -17,7 +17,11 @@
import os
from os import urandom, R_OK, W_OK, X_OK
from unittest import defaultTestLoader, TestCase, TestSuite, TextTestRunner
from fuse import FuseOSError

try:
from fusepy import FUSE, FuseOSError, Operations
except ImportError:
from fuse import FUSE, FuseOSError, Operations

from rencfs import RencFSEncrypt, RencFSDecrypt

Expand Down
11 changes: 7 additions & 4 deletions rencfs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
#!/usr/bin/python3

# Copyright (c) 2016-2017, Jan Varho
# Copyright (c) 2016-2020, Jan Varho
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand All @@ -27,12 +27,15 @@
from base64 import b16encode
from hashlib import sha256

from fuse import FUSE, FuseOSError, Operations
try:
from fusepy import FUSE, FuseOSError, Operations
except ImportError:
from fuse import FUSE, FuseOSError, Operations

from aes import aes_ctr, aes_ecb


__version__ = '0.6'
__version__ = '0.7'

BLOCK_MASK = 15
BLOCK_SIZE = 16
Expand Down

0 comments on commit f08cb16

Please sign in to comment.