)]}'
{"etc/glance-api.conf":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"68b26b8b87c921aa583ad2896cfa5522d68b1d2f","unresolved":false,"context_lines":[{"line_number":26,"context_line":"# Backlog requests when creating socket"},{"line_number":27,"context_line":"backlog \u003d 4096"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d Security Options \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"# Certificate file to use when starting API server securely"},{"line_number":32,"context_line":"# cert_file \u003d /path/to/certfile"}],"source_content_type":"text/plain","patch_set":1,"id":"AAAACX%2F%2F54w%3D","line":29,"updated":"2011-10-28 17:27:33.000000000","message":"Maybe this header should be moved down below the \u0027key_file\u0027 option.","commit_id":"41fdd2383cdc5e7cc617aa514984c535c664e97e"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"68b26b8b87c921aa583ad2896cfa5522d68b1d2f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# AES key for encrypting store \u0027location\u0027 metadata, including"},{"line_number":38,"context_line":"# -- if used -- Swift or S3 credentials"},{"line_number":39,"context_line":"# Should be set to a random string of length 16, 24 or 32 bytes"},{"line_number":40,"context_line":"# metadata_key \u003d \u003c16, 24 or 32 char registry metadata key\u003e "},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d Registry Options \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":43,"context_line":""}],"source_content_type":"text/plain","patch_set":1,"id":"AAAACX%2F%2F54s%3D","line":40,"updated":"2011-10-28 17:27:33.000000000","message":"1) Can we call this something a bit more descriptive? Maybe metadata_encryption_key? It\u0027s difficult to understand what the option means out of this context. \n\n2) Remove the trailing whitespace","commit_id":"41fdd2383cdc5e7cc617aa514984c535c664e97e"}],"glance/common/crypt.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"68b26b8b87c921aa583ad2896cfa5522d68b1d2f","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from Crypto.Cipher import AES"},{"line_number":28,"context_line":"from Crypto import Random"},{"line_number":29,"context_line":"from Crypto.Random.random import StrongRandom"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def urlsafe_encrypt(key, plaintext, blocksize\u003d16):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F54o%3D","line":29,"updated":"2011-10-28 17:27:33.000000000","message":"Would you mind just import modules here? StrongRandom appears to be a class.","commit_id":"41fdd2383cdc5e7cc617aa514984c535c664e97e"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"91bce22227bd308509201a4a12d6aa91df012cd4","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        Pads text to be encrypted"},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":"        pad_length \u003d (blocksize - len(text) % blocksize)"},{"line_number":46,"context_line":"        sr \u003d random.StrongRandom()"},{"line_number":47,"context_line":"        pad \u003d \u0027\u0027.join(chr(sr.randint(1, 0xFF)) for i in range(pad_length - 1))"},{"line_number":48,"context_line":"        # We use chr(0) as a delimiter between text and padding"},{"line_number":49,"context_line":"        return text + chr(0) + pad"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F4mE%3D","line":46,"updated":"2011-11-03 23:07:05.000000000","message":"Do you know where StrongRandom gets its bits?  I\u0027m concerned that it could use /dev/random on Linux, which could block on servers if they don\u0027t generate enough entropy.","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e9fb45362f0791e7254d4f42b5793ca22ab6ff08","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        Pads text to be encrypted"},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":"        pad_length \u003d (blocksize - len(text) % blocksize)"},{"line_number":46,"context_line":"        sr \u003d random.StrongRandom()"},{"line_number":47,"context_line":"        pad \u003d \u0027\u0027.join(chr(sr.randint(1, 0xFF)) for i in range(pad_length - 1))"},{"line_number":48,"context_line":"        # We use chr(0) as a delimiter between text and padding"},{"line_number":49,"context_line":"        return text + chr(0) + pad"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F38Q%3D","line":46,"in_reply_to":"AAAACX%2F%2F4h8%3D","updated":"2011-11-07 16:51:48.000000000","message":"Excellent, it\u0027s using /dev/urandom; that was my concern.","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"984f86536ecb432ab30fef1c8fc96e62f9e140db","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        Pads text to be encrypted"},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":"        pad_length \u003d (blocksize - len(text) % blocksize)"},{"line_number":46,"context_line":"        sr \u003d random.StrongRandom()"},{"line_number":47,"context_line":"        pad \u003d \u0027\u0027.join(chr(sr.randint(1, 0xFF)) for i in range(pad_length - 1))"},{"line_number":48,"context_line":"        # We use chr(0) as a delimiter between text and padding"},{"line_number":49,"context_line":"        return text + chr(0) + pad"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F4h8%3D","line":46,"in_reply_to":"AAAACX%2F%2F4mE%3D","updated":"2011-11-07 16:42:25.000000000","message":"Hi Kevin, from looking at the pycrypto code it seems that StrongRandom.randint gets it bits from the same source as get_random_bytes. I verified this by running strace for both cases:\n\n$ grep \u0027/dev\u0027 randint.out \nopen(\"/dev/urandom\", O_RDONLY)          \u003d 3\n\n$ grep \u0027/dev/\u0027 get_random_bytes.out \nopen(\"/dev/urandom\", O_RDONLY)          \u003d 3","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"91bce22227bd308509201a4a12d6aa91df012cd4","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        sr \u003d random.StrongRandom()"},{"line_number":47,"context_line":"        pad \u003d \u0027\u0027.join(chr(sr.randint(1, 0xFF)) for i in range(pad_length - 1))"},{"line_number":48,"context_line":"        # We use chr(0) as a delimiter between text and padding"},{"line_number":49,"context_line":"        return text + chr(0) + pad"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    # random initial 16 bytes for CBC"},{"line_number":52,"context_line":"    init_vector \u003d Random.get_random_bytes(16)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F4l8%3D","line":49,"updated":"2011-11-03 23:07:05.000000000","message":"I really wish you could use get_random_bytes() here, like you do for your IV.  Is there any way to accomplish that?  Surely \u0027\\0\u0027 would never show up in the plaintext?","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e9fb45362f0791e7254d4f42b5793ca22ab6ff08","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        sr \u003d random.StrongRandom()"},{"line_number":47,"context_line":"        pad \u003d \u0027\u0027.join(chr(sr.randint(1, 0xFF)) for i in range(pad_length - 1))"},{"line_number":48,"context_line":"        # We use chr(0) as a delimiter between text and padding"},{"line_number":49,"context_line":"        return text + chr(0) + pad"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    # random initial 16 bytes for CBC"},{"line_number":52,"context_line":"    init_vector \u003d Random.get_random_bytes(16)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F38M%3D","line":49,"in_reply_to":"AAAACX%2F%2F4h4%3D","updated":"2011-11-07 16:51:48.000000000","message":"There are several approaches to the padding problem.  One of them is to\nspecify the length of the plaintext up front; another is to use bytes\nthat don\u0027t occur in your plaintext (or which you cause to not occur in\nyour plaintext through use of quoting or byte stuffing).  Frankly, any\nof these schemes would work; I like the length specification approach,\nbut then I tend toward premature optimization.  In any case, that\u0027s\nfine; I\u0027m just trying to understand your thinking.","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"984f86536ecb432ab30fef1c8fc96e62f9e140db","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        sr \u003d random.StrongRandom()"},{"line_number":47,"context_line":"        pad \u003d \u0027\u0027.join(chr(sr.randint(1, 0xFF)) for i in range(pad_length - 1))"},{"line_number":48,"context_line":"        # We use chr(0) as a delimiter between text and padding"},{"line_number":49,"context_line":"        return text + chr(0) + pad"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    # random initial 16 bytes for CBC"},{"line_number":52,"context_line":"    init_vector \u003d Random.get_random_bytes(16)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F4h4%3D","line":49,"in_reply_to":"AAAACX%2F%2F4l8%3D","updated":"2011-11-07 16:42:25.000000000","message":"Hi Kevin, that was my original approach but I wanted the functions to work for arbitrary input in order to be as generic as possible. The unit test which generates random input (including \u0027\\0\u0027) verify that that is the case.","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"}],"glance/registry/client.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"68b26b8b87c921aa583ad2896cfa5522d68b1d2f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        params \u003d self._extract_params(kwargs, images.SUPPORTED_PARAMS)"},{"line_number":62,"context_line":"        res \u003d self.do_request(\"GET\", \"/images/detail\", params\u003dparams)"},{"line_number":63,"context_line":"        data \u003d json.loads(res.read())[\u0027images\u0027]"},{"line_number":64,"context_line":"        return data"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def get_image(self, image_id):"},{"line_number":67,"context_line":"        \"\"\"Returns a mapping of image metadata from Registry\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F54k%3D","side":"PARENT","line":64,"updated":"2011-10-28 17:27:33.000000000","message":"You\u0027re going to need to decrypt here as well. The entities returned here are equivalent to that in get_image below.","commit_id":"ceab6b3ed4d46aa19ee33dd69560a695c1cdd141"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"68b26b8b87c921aa583ad2896cfa5522d68b1d2f","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if \u0027image\u0027 not in image_metadata.keys():"},{"line_number":81,"context_line":"            image_metadata \u003d dict(image\u003dimage_metadata)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        body \u003d json.dumps(image_metadata)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        res \u003d self.do_request(\"POST\", \"/images\", body, headers\u003dheaders)"},{"line_number":86,"context_line":"        # Registry returns a JSONified dict(image\u003dimage_info)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F54Y%3D","side":"PARENT","line":83,"updated":"2011-10-28 17:27:33.000000000","message":"Don\u0027t you want to encrypt here, too?","commit_id":"ceab6b3ed4d46aa19ee33dd69560a695c1cdd141"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"68b26b8b87c921aa583ad2896cfa5522d68b1d2f","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        res \u003d self.do_request(\"POST\", \"/images\", body, headers\u003dheaders)"},{"line_number":86,"context_line":"        # Registry returns a JSONified dict(image\u003dimage_info)"},{"line_number":87,"context_line":"        data \u003d json.loads(res.read())"},{"line_number":88,"context_line":"        return data[\u0027image\u0027]"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def update_image(self, image_id, image_metadata, purge_props\u003dFalse):"},{"line_number":91,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F54c%3D","side":"PARENT","line":88,"updated":"2011-10-28 17:27:33.000000000","message":"And decrypt here?","commit_id":"ceab6b3ed4d46aa19ee33dd69560a695c1cdd141"}],"glance/tests/functional/test_s3.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"49ee6a24a8f4e571f12e440e571832111b15dc6b","unresolved":false,"context_lines":[{"line_number":42,"context_line":"from glance.common import utils"},{"line_number":43,"context_line":"from glance.tests.functional import test_api"},{"line_number":44,"context_line":"from glance.tests.utils import execute, skip_if_disabled"},{"line_number":45,"context_line":"from glance.common import crypt"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"FIVE_KB \u003d 5 * 1024"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F5JQ%3D","line":45,"updated":"2011-11-02 18:28:34.000000000","message":"This needs to move up to the top of this block.","commit_id":"e51916ae59d29e5a01578f3c8ad13b38555f27c4"}],"glance/tests/functional/test_swift.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"49ee6a24a8f4e571f12e440e571832111b15dc6b","unresolved":false,"context_lines":[{"line_number":43,"context_line":"from glance.store.location import get_location_from_uri"},{"line_number":44,"context_line":"from glance.tests.functional import test_api"},{"line_number":45,"context_line":"from glance.tests.utils import execute, skip_if_disabled"},{"line_number":46,"context_line":"from glance.common import crypt"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"FIVE_KB \u003d 5 * 1024"},{"line_number":49,"context_line":"FIVE_MB \u003d 5 * 1024 * 1024"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F5JM%3D","line":46,"updated":"2011-11-02 18:28:34.000000000","message":"This needs to move to the top of this code block.","commit_id":"e51916ae59d29e5a01578f3c8ad13b38555f27c4"}],"glance/tests/unit/test_misc.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"49ee6a24a8f4e571f12e440e571832111b15dc6b","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def test_encryption(self):"},{"line_number":132,"context_line":"        # Check that original plaintext and unencrypted ciphertext match"},{"line_number":133,"context_line":"        # Check keys of the three allowed lengths"},{"line_number":134,"context_line":"        key_list \u003d [\"1234567890abcdef\","},{"line_number":135,"context_line":"                     \"12345678901234567890abcd\","},{"line_number":136,"context_line":"                      \"1234567890abcdef1234567890ABCDEF\"]"},{"line_number":137,"context_line":"        plaintext_list \u003d [\u0027\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F5Jc%3D","line":134,"updated":"2011-11-02 18:28:34.000000000","message":"The three items in this list should line up across lines.","commit_id":"e51916ae59d29e5a01578f3c8ad13b38555f27c4"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"49ee6a24a8f4e571f12e440e571832111b15dc6b","unresolved":false,"context_lines":[{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        for key in key_list:"},{"line_number":143,"context_line":"            for plaintext in plaintext_list:"},{"line_number":144,"context_line":"                ciphertext \u003d crypt.urlsafe_encrypt(key, plaintext, blocksize)"},{"line_number":145,"context_line":"                text \u003d crypt.urlsafe_decrypt(key, ciphertext)"},{"line_number":146,"context_line":"                self.assertTrue(plaintext \u003d\u003d text)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F5JY%3D","line":144,"updated":"2011-11-02 18:28:34.000000000","message":"Can we do any assertion after encryption? This would pass if the encrypt/decrypt functions returned what was passed into it","commit_id":"e51916ae59d29e5a01578f3c8ad13b38555f27c4"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"91bce22227bd308509201a4a12d6aa91df012cd4","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        plaintext_list \u003d [\u0027\u0027]"},{"line_number":138,"context_line":"        blocksize \u003d 64"},{"line_number":139,"context_line":"        for i in range(3 * blocksize):"},{"line_number":140,"context_line":"            plaintext_list.append(os.urandom(i))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        for key in key_list:"},{"line_number":143,"context_line":"            for plaintext in plaintext_list:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F4l4%3D","line":140,"updated":"2011-11-03 23:07:05.000000000","message":"That\u0027s an awful lot of plaintexts to test.  Any chance we could reduce this space a bit, just to speed up the test suite?  Maybe i in (0, 1, 63, 64, 65, 127, 128, 129, 191, 192)?","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e9fb45362f0791e7254d4f42b5793ca22ab6ff08","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        plaintext_list \u003d [\u0027\u0027]"},{"line_number":138,"context_line":"        blocksize \u003d 64"},{"line_number":139,"context_line":"        for i in range(3 * blocksize):"},{"line_number":140,"context_line":"            plaintext_list.append(os.urandom(i))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        for key in key_list:"},{"line_number":143,"context_line":"            for plaintext in plaintext_list:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F38E%3D","line":140,"in_reply_to":"AAAACX%2F%2F4gY%3D","updated":"2011-11-07 16:51:48.000000000","message":"Impressive.  I\u0027m just trying to keep our test timings as good as\npossible; nova can take upwards of 7 minutes to run the test suite, and\nI\u0027d like to keep glance from blowing up in that respect as much as\npossible :)","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"984f86536ecb432ab30fef1c8fc96e62f9e140db","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        plaintext_list \u003d [\u0027\u0027]"},{"line_number":138,"context_line":"        blocksize \u003d 64"},{"line_number":139,"context_line":"        for i in range(3 * blocksize):"},{"line_number":140,"context_line":"            plaintext_list.append(os.urandom(i))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        for key in key_list:"},{"line_number":143,"context_line":"            for plaintext in plaintext_list:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F4gY%3D","line":140,"in_reply_to":"AAAACX%2F%2F4l4%3D","updated":"2011-11-07 16:42:25.000000000","message":"I timed the test at \u003c 1 sec. (Hopefully that is not too long)","commit_id":"5e6fb33b22c868e8ce2638198c27f3e3a099318a"}]}
