Skip to content

Commit 528f01d

Browse files
committed
add warnings to not use null and counting master keys outside of testing
1 parent 81e48ed commit 528f01d

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

decrypt_oracle/src/aws_encryption_sdk_decrypt_oracle/key_providers/counting.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
from aws_encryption_sdk.exceptions import DecryptKeyError
2020
from aws_encryption_sdk.identifiers import AlgorithmSuite
2121
from aws_encryption_sdk.key_providers.base import MasterKey, MasterKeyConfig
22-
from aws_encryption_sdk.structures import EncryptedDataKey
23-
from aws_encryption_sdk.structures import DataKey
22+
from aws_encryption_sdk.structures import DataKey, EncryptedDataKey
2423

2524

2625
class CountingMasterKeyConfig(MasterKeyConfig):
@@ -40,6 +39,11 @@ class CountingMasterKey(MasterKey):
4039
4140
Generated/decrypted data keys are of the form: ``\01\02\03\04...`` counting
4241
bytes up from one to the data key length required for a given algorithm suite.
42+
43+
.. warning::
44+
45+
This master key is NOT secure and should never be used for anything other than testing.
46+
4347
"""
4448

4549
provider_id = "test_counting"

decrypt_oracle/src/aws_encryption_sdk_decrypt_oracle/key_providers/null.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
from aws_encryption_sdk.identifiers import AlgorithmSuite
1717
from aws_encryption_sdk.key_providers.base import MasterKey, MasterKeyConfig
18-
from aws_encryption_sdk.structures import EncryptedDataKey
19-
from aws_encryption_sdk.structures import DataKey
18+
from aws_encryption_sdk.structures import DataKey, EncryptedDataKey
2019

2120

2221
class NullMasterKeyConfig(MasterKeyConfig):
@@ -32,7 +31,13 @@ def __init__(self) -> None:
3231

3332
class NullMasterKey(MasterKey):
3433
"""Master key that generates null data keys and decrypts any data key with provider id
35-
"null" or "zero" as a null data key."""
34+
"null" or "zero" as a null data key.
35+
36+
.. warning::
37+
38+
This master key is NOT secure and should never be used for anything other than testing.
39+
40+
"""
3641

3742
provider_id = "null"
3843
_allowed_provider_ids = (provider_id, "zero")

0 commit comments

Comments
 (0)