Skip to content

Commit bd64577

Browse files
authored
Merge pull request #8 from jschlyter/fernet_binary_key
use default random binary key for FernetEncrypter
2 parents 03820d8 + fb93076 commit bd64577

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def run_tests(self):
7979
"Programming Language :: Python :: 3.10",
8080
"Topic :: Software Development :: Libraries :: Python Modules"],
8181
install_requires=[
82-
"cryptojwt==1.8.0",
82+
"cryptojwt>=1.8.1",
8383
"pyOpenSSL",
8484
"filelock>=3.0.12",
8585
'pyyaml>=5.1.2',

src/idpyoidc/encrypter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ def default_crypt_config():
1111
return {
1212
"class": DEFAULT_CRYPTO,
1313
"kwargs": {
14-
"password": os.urandom(16),
15-
"salt": os.urandom(16)
14+
"key": os.urandom(32),
15+
# "password": os.urandom(16),
16+
# "salt": os.urandom(16)
1617
# "keys": {
1718
# "key_defs": [
1819
# {"type": "OCT", "use": ["enc"], "kid": "password"},

tests/private/token_jwks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"keys": [{"kty": "oct", "use": "enc", "kid": "code", "k": "dzuF9LxAjaXpfLhzHIpPAShUhTRph81z"}]}
1+
{"keys": [{"kty": "oct", "use": "enc", "kid": "code", "k": "vSHDkLBHhDStkR0NWu8519rmV5zmnm5_"}]}

tests/test_20_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_entity_config(filename):
7575
def test_init_crypto_None():
7676
_res = init_crypto()
7777
assert _res["conf"]["class"] == DEFAULT_CRYPTO
78-
assert set(_res["conf"]["kwargs"].keys()) == {"password", "salt"}
78+
assert set(_res["conf"]["kwargs"].keys()) == {"key"}
7979
assert isinstance(_res["encrypter"], FernetEncrypter)
8080

8181

0 commit comments

Comments
 (0)