Skip to content
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

Update Path for MODE_CBC deprecation warning #46

Open
imagescape opened this issue Oct 2, 2014 · 0 comments
Open

Update Path for MODE_CBC deprecation warning #46

imagescape opened this issue Oct 2, 2014 · 0 comments

Comments

@imagescape
Copy link
Contributor

Hi all. What's the proper update path to fix the following deprecation warning?

https://github.com/svetlyak40wt/django-fields/blob/master/src/django_fields/fields.py#L41

"Default usage of pycrypto's AES block type defaults has been "
"deprecated and will be removed in 0.3.0 (default will become "
"MODE_CBC). Please specify a secure block_type, such as CBC.",
DeprecationWarning,

I tried changing all of the encrypted fields in my app to add "block_type=BLOCK_TYPE" to the model and resyncing the database, but got the following error. I think that this is because the new block type makes encrypted values larger than the field can store.

  File "/home/jjasinski/Sites/osf/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 350, in get_db_prep_save
 prepared=False)
 File "/home/jjasinski/Sites/osf/local/lib/python2.7/site-packages/django_fields/fields.py", line 164, in get_db_prep_value
 str(len(value)) + " > " + str(self.unencrypted_length)
ValueError: Field value longer than max allowed: 37 > 12
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

1 participant