Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Add support for encrypted data bag items v2 #27

Closed
wants to merge 0 commits into from

Conversation

kamilbednarz
Copy link

Hi,

This is an updated version of my previous pull request (#26).

As you suggested, I got rid of m2crypto wrappers over OpenSSL functions by using them directly (via ctypes) - please see chef/aes.py file.

Please let me know if this looks good.

Best regards,
Kamil

@kamilbednarz
Copy link
Author

Added a few commits, I wasn't aware of some of the dependencies before seeing Travis failure logs.

import hashlib

class EncryptedDataBagItem(chef.DataBagItem):
SUPPORTED_ENCRYPTION_VERSIONS = (1,2)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this doesn't actually support version 1.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually only Version 0 is not supported at the moment (default encryption version in Chef 10.x http://docs.opscode.com/chef/essentials_data_bags.html).

I think by using OpenSSL via ctypes version 0 can be implemented as well in the future (pkcs5_keyivgen needs to be implemented http://apidock.com/ruby/v1_9_2_180/OpenSSL/Cipher/pkcs5_keyivgen).

@kamilbednarz
Copy link
Author

Hi coderanger,

Thanks for all your comments to my code! They are very valuable for me, since as you saw, I don't know many good programming practices in Python.

I updated the pull request with some more commits. Most of them were changes made according to your suggestions. I also refactored these ugly nested classes (encryptors, decryptors), please let me know if you like the code more.

Best,
Kamil

@kamilbednarz
Copy link
Author

Hey, Is there anything I can help you with in order to review these changes?

@benjit89
Copy link

benjit89 commented Apr 6, 2015

Hi Coderanger,

What still needs done on this pull request to get it merged in? I see this is a bit outdated, but I would really like support for encrypted data bags so I can help finish this up.

Benji

freimer added a commit to freimer/pychef that referenced this pull request Apr 15, 2016
@tescalada
Copy link

Is there anything I can do to help see this merged?

@scriptwriter
Copy link

We should try to merge this asap.

@kamilbednarz
Copy link
Author

This branch was ancient, impossible to merge. Closing this PR.

I refreshed that with current master & merged @fpedrini's code (from https://github.com/rapid7/pychef/tree/encrypted_databags) and submitted another Pr:
#82

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

Successfully merging this pull request may close these issues.

5 participants