Skip to content

RawMasterKeyProvider runtim-error: AttributeError: can't set attribute #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
solzsolz opened this issue Dec 5, 2017 · 2 comments
Closed

Comments

@solzsolz
Copy link

solzsolz commented Dec 5, 2017

hi

I called below method:

cycle_file("sample.txt")

Got below run-time error:


traceback (most recent call last):
File ".\testSdk.py", line 116, in
main()
File ".\testSdk.py", line 109, in main
cycle_file("sample.txt")
File ".\testSdk.py", line 61, in cycle_file
master_key_provider.add_master_key(key_id)
File "C:\Users\A610620\AppData\Local\Continuum\Anaconda3\lib\site-packages\aws_encryption_sdk\key_providers\base.py", line 155, in add_master_key
master_key = self._new_master_key(key_id)
File "C:\Users\A610620\AppData\Local\Continuum\Anaconda3\lib\site-packages\aws_encryption_sdk\key_providers\raw.py", line 234, in _new_master_key
wrapping_key=wrapping_key
File "<attrs generated init 97ee74820011dd83c2b5dad60b4be0b7f1be967f>", line 3, in init
AttributeError: can't set attribute


exception (2nd exception!) is being thrown here (def _get_raw_key)

def _get_raw_key(self, key_id):
    """Returns a static, randomly-generated symmetric key for the specified key ID.

    :param str key_id: Key ID
    :returns: Wrapping key that contains the specified static key
    :rtype: :class:`aws_encryption_sdk.internal.crypto.WrappingKey`
    """
    try:
        static_key = self._static_keys[key_id]
    except KeyError:
        static_key = os.urandom(32)
        self._static_keys[key_id] = static_key
        try:
            return WrappingKey(wrapping_algorithm=WrappingAlgorithm.AES_256_GCM_IV12_TAG16_NO_PADDING,wrapping_key=static_key,wrapping_key_type=EncryptionKeyType.SYMMETRIC)
        except Exception as e:
            print (e)
@mattsb42-aws
Copy link
Member

mattsb42-aws commented Dec 5, 2017

Hi,

It looks like you ran into this issue, which was breaking our use of attrs and abc.abstractproperty in MasterKeyConfig. I fixed this in #33, and that is now published to PyPI as 1.3.3. Upgrading to this new version will fix this problem.

@mattsb42-aws
Copy link
Member

Closing this issue since the fix is published and no additional issue has come up. Feel free to re-open if you keep seeing problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants