)]}'
{"barbican/plugin/dogtag.py":[{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"ad58df4f3b27dffb320ba9c06c9bac6fe80b4d89","unresolved":false,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        # Public key should be retrieved using the get_key_info method as"},{"line_number":199,"context_line":"        # it is treated as an attribute of the asymmetric key pair stored in the"},{"line_number":200,"context_line":"        # database."},{"line_number":201,"context_line":"        if secret_type \u003d\u003d sstore.SecretType.PUBLIC:"},{"line_number":202,"context_line":"            key_info \u003d self.keyclient.get_key_info(key_id)"},{"line_number":203,"context_line":"            recovered_key \u003d key_info.public_key"}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_89ebe911","line":200,"updated":"2014-08-29 18:07:04.000000000","message":"use \"KRA database\" instead of just \"database\"","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"ad58df4f3b27dffb320ba9c06c9bac6fe80b4d89","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        # database."},{"line_number":201,"context_line":"        if secret_type \u003d\u003d sstore.SecretType.PUBLIC:"},{"line_number":202,"context_line":"            key_info \u003d self.keyclient.get_key_info(key_id)"},{"line_number":203,"context_line":"            recovered_key \u003d key_info.public_key"},{"line_number":204,"context_line":"        else:"},{"line_number":205,"context_line":"            # TODO(alee-3) send transport key as well when dogtag client API"},{"line_number":206,"context_line":"            # changes in case the transport key has changed."}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_c9332160","line":203,"updated":"2014-08-29 18:07:04.000000000","message":"Its possible that the client could pass in a twsk and expect the results to be encrypted.  That doesn\u0027t make sense because the data is public, but we need to think about how to handle that case.\n\nMaybe we need to throw an exception -- or we need to try and handle it on the dogtag side.\n\nDoesn\u0027t have to be in this CR.","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"82b5526fd6085de085b7934deb466d807f34ffda","unresolved":false,"context_lines":[{"line_number":220,"context_line":"            key_spec\u003dsecret_metadata[DogtagKRAPlugin.SECRET_KEYSPEC],"},{"line_number":221,"context_line":"            content_type\u003dNone,"},{"line_number":222,"context_line":"            transport_key\u003dNone)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        return ret"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def delete_secret(self, secret_metadata):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_f642d866","line":223,"updated":"2014-09-03 01:17:16.000000000","message":"We need to think about how to return private and public keys.  See simple_crypto.py.  In this case, what is returned is the PEM base64 encoded public/private key with headers.\n\nI think we can use the pyCrypto RSA class to wrap what we get back from the DRM and return the relevant key in the right format.\n\nSo we can do something like this:\n\nfor public key:\n\nrsa_key \u003d RSA.importKey(key_info.public_key)\nreturn rsa_key.public_key.export_key(\u0027PEM\u0027)\n\nfor private key:\n\nif passphrase is None:\n    rsa_key \u003d RSA.importKey(key_data.data)\n    return rsa_key.private_key.exportKey(\u0027PEM\u0027)\n\nif passphrase is not none:\n   (if we can get the passphrase somehow) \n\n   return rsa_key.private_key.export_key(\u0027PEM\u0027, passphrase)","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"ad58df4f3b27dffb320ba9c06c9bac6fe80b4d89","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"        usages \u003d [key.SymKeyGenerationRequest.DECRYPT_USAGE,"},{"line_number":266,"context_line":"                  key.SymKeyGenerationRequest.ENCRYPT_USAGE]"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        client_key_id \u003d uuid.uuid4().hex"},{"line_number":269,"context_line":"        algorithm \u003d self._map_algorithm(key_spec.alg.lower())"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_e9a61d0e","line":267,"updated":"2014-08-29 18:07:04.000000000","message":"We use the same usages for both Symmetric and Asymmetric keys?","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"82b5526fd6085de085b7934deb466d807f34ffda","unresolved":false,"context_lines":[{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        return sstore.AsymmetricKeyMetadataDTO(private_key_metadata,"},{"line_number":292,"context_line":"                                               public_key_metadata)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def generate_supports(self, key_spec):"},{"line_number":295,"context_line":"        \"\"\"Key generation supported?"},{"line_number":296,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_6bbc4107","line":293,"updated":"2014-09-03 01:17:16.000000000","message":"We also need to handle the case where there is a passphrase passed in.  The passphrase is used when encrypting the private key when returning in PEM format.","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"6209cc1a1deb695c918e4407d48bf7693d9f3473","unresolved":false,"context_lines":[{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        return sstore.AsymmetricKeyMetadataDTO(private_key_metadata,"},{"line_number":292,"context_line":"                                               public_key_metadata)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def generate_supports(self, key_spec):"},{"line_number":295,"context_line":"        \"\"\"Key generation supported?"},{"line_number":296,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_51956e85","line":293,"in_reply_to":"fa98f980_6bbc4107","updated":"2014-09-03 01:28:21.000000000","message":"We could do passphrase as follows - if a passphrase is passed in - we store the key_id in the passphrase metadata object.  But we also store the key_id in the private key metadata object too.\n\nNow when we return the private key from get_secret(), we need to get the passphrase for wrapping in case it exists in the private key metadata.","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c71e49b808ebf54dade1c7b79023614dea9aecd9","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            else:"},{"line_number":209,"context_line":"                raise ValueError(\"Passphrase encryption not supported for \""},{"line_number":210,"context_line":"                                 \"secrets of this type.\")"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        twsk \u003d None"},{"line_number":213,"context_line":"        if \u0027trans_wrapped_session_key\u0027 in secret_metadata:"},{"line_number":214,"context_line":"            twsk \u003d secret_metadata[\u0027trans_wrapped_session_key\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_ee0e31e4","line":211,"updated":"2014-09-04 21:37:23.000000000","message":"Lets use a more specific exception here.\nSee DogtagAlgorithmPluginException above as an example.  Specify the type in the exception message","commit_id":"0ceaba2fb511e063b0ca54e94ef00fc5e7835e38"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c71e49b808ebf54dade1c7b79023614dea9aecd9","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        # Public key should be retrieved using the get_key_info method as"},{"line_number":221,"context_line":"        # it is treated as an attribute of the asymmetric key pair stored in"},{"line_number":222,"context_line":"        # the KRA database."},{"line_number":223,"context_line":"        if secret_type \u003d\u003d sstore.SecretType.PUBLIC:"},{"line_number":224,"context_line":"            key_info \u003d self.keyclient.get_key_info(key_id)"},{"line_number":225,"context_line":"            if key_spec.alg.upper() \u003d\u003d key.KeyClient.RSA_ALGORITHM:"},{"line_number":226,"context_line":"                recovered_key \u003d RSA.importKey(key_info.public_key).publickey()\\"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_eeaf117b","line":223,"updated":"2014-09-04 21:37:23.000000000","message":"None of the processing below will work with twsk.\nNeed to add a check that throws an exception - which will need to be mapped at the barbican-core level to a bad request (400) exception if twsk !\u003d None","commit_id":"0ceaba2fb511e063b0ca54e94ef00fc5e7835e38"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c71e49b808ebf54dade1c7b79023614dea9aecd9","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                pub_seq[:] \u003d key_info.public_key"},{"line_number":231,"context_line":"                recovered_key \u003d \"-----BEGIN DSA PUBLIC KEY-----\\n\" \\"},{"line_number":232,"context_line":"                                \"%s-----END DSA PUBLIC KEY-----\" % \\"},{"line_number":233,"context_line":"                                pub_seq.encode().encode(\"base64\")"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        elif secret_type \u003d\u003d sstore.SecretType.PRIVATE:"},{"line_number":236,"context_line":"            key_data \u003d self.keyclient.retrieve_key(key_id, twsk)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_ae7c29ed","line":233,"updated":"2014-09-04 21:37:23.000000000","message":"lets define the above \"---*---\" as constants","commit_id":"0ceaba2fb511e063b0ca54e94ef00fc5e7835e38"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c71e49b808ebf54dade1c7b79023614dea9aecd9","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                                pub_seq.encode().encode(\"base64\")"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        elif secret_type \u003d\u003d sstore.SecretType.PRIVATE:"},{"line_number":236,"context_line":"            key_data \u003d self.keyclient.retrieve_key(key_id, twsk)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"            if key_spec.alg.upper() \u003d\u003d key.KeyClient.RSA_ALGORITHM:"},{"line_number":239,"context_line":"                recovered_key \u003d RSA.importKey(key_data.data)\\"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_6ec32138","line":236,"updated":"2014-09-04 21:37:23.000000000","message":"See above note about twsk.  Use None explicitly for twsk","commit_id":"0ceaba2fb511e063b0ca54e94ef00fc5e7835e38"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"dd4885ce7cdd9b05d4524239e5a846a47e64f3cc","unresolved":false,"context_lines":[{"line_number":339,"context_line":"        passphrase_metadata \u003d {"},{"line_number":340,"context_line":"            DogtagKRAPlugin.KEY_ID: response.get_key_id(),"},{"line_number":341,"context_line":"            DogtagKRAPlugin.PASSPHRASE: passphrase"},{"line_number":342,"context_line":"        }"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"        return sstore.AsymmetricKeyMetadataDTO(private_key_metadata,"},{"line_number":345,"context_line":"                                               public_key_metadata,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_ab989b1c","line":342,"updated":"2014-09-04 21:02:09.000000000","message":"We cant just store the passphrase in the metadata like this.  The passphrase is a secret just like everything else.  The metadata is stored in the sql database completely unencrypted.\n\nInstead, you will need to store the passphrase in the KRA and then store the key_id for the passphrase KRA record.\n\nThen in get_secret(), you will need to retrieve that passphrase using the saved key_id.\n\nTo be honest, even this solution is pretty hokey because it means that the passphrase and secrets will be in memory here in the plugin.  Still, we don\u0027t have wrapping on the client side yet, so thats probably ok for now.\n\nFor Dogtag 10.2.1 we should extend the key gen mechanism to include a passphrase so that the wrapping will be done on the server (KRA) side.","commit_id":"0ceaba2fb511e063b0ca54e94ef00fc5e7835e38"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        return {DogtagKRAPlugin.SECRET_TYPE: secret_dto.type,"},{"line_number":189,"context_line":"                DogtagKRAPlugin.SECRET_KEYSPEC: secret_dto.key_spec,"},{"line_number":190,"context_line":"                DogtagKRAPlugin.KEY_ID: response.get_key_id()}"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def get_secret(self, secret_metadata, context):"},{"line_number":193,"context_line":"        \"\"\"Retrieve a secret from the KRA"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_2d481fb2","line":191,"updated":"2014-09-05 18:42:08.000000000","message":"We need to spend a little time thinking about what happens when someone tries to store an asymmetric and symmetric key type.","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                raise DogtagPluginNotSupportedException("},{"line_number":232,"context_line":"                    \"Passphrase encryption not supported for secrets of \""},{"line_number":233,"context_line":"                    \"this type: \" + secret_type)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        twsk \u003d None"},{"line_number":236,"context_line":"        if \u0027trans_wrapped_session_key\u0027 in secret_metadata:"},{"line_number":237,"context_line":"            twsk \u003d secret_metadata[\u0027trans_wrapped_session_key\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_4d7723a0","line":234,"updated":"2014-09-05 18:42:08.000000000","message":"This should be a different type of exception -- ie. not a 400.  Because we should have checks both in store_secret() and generate_symmetric_key() , existence of a passphrase for a non-RSA key would mean an inconsistency in the data.\n-- which is a 500-style error. You could probably use SecretGeneralException in secret_store.py.","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                    \"Passphrase encryption not supported for secrets of \""},{"line_number":233,"context_line":"                    \"this type: \" + secret_type)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        twsk \u003d None"},{"line_number":236,"context_line":"        if \u0027trans_wrapped_session_key\u0027 in secret_metadata:"},{"line_number":237,"context_line":"            twsk \u003d secret_metadata[\u0027trans_wrapped_session_key\u0027]"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_edda9776","line":235,"updated":"2014-09-05 18:42:08.000000000","message":"this method is getting long,  Lets extract lines 222-234 in a separate function --\u003e say _get_passphrase()","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        twsk \u003d None"},{"line_number":236,"context_line":"        if \u0027trans_wrapped_session_key\u0027 in secret_metadata:"},{"line_number":237,"context_line":"            twsk \u003d secret_metadata[\u0027trans_wrapped_session_key\u0027]"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        recovered_key \u003d None"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Public key should be retrieved using the get_key_info method as"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_edcb776f","line":238,"updated":"2014-09-05 18:42:08.000000000","message":"Lets re-factor a little to make this clearer.  Extract the lines 236-237 and the checks that throw a bad request exception to a new method get_transport_wrapped_session_key()\n\nBe sure to throw an exception defined in secret_store.py","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            if key_spec.alg.upper() \u003d\u003d key.KeyClient.RSA_ALGORITHM:"},{"line_number":251,"context_line":"                recovered_key \u003d RSA.importKey(key_info.public_key).publickey()\\"},{"line_number":252,"context_line":"                    .exportKey(\u0027PEM\u0027)"},{"line_number":253,"context_line":"            elif key_spec.alg.upper() \u003d\u003d key.KeyClient.DSA_ALGORITHM:"},{"line_number":254,"context_line":"                pub_seq \u003d asn1.DerSequence()"},{"line_number":255,"context_line":"                pub_seq[:] \u003d key_info.public_key"},{"line_number":256,"context_line":"                recovered_key \u003d \"%s\\n%s%s\" % \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_6de307d9","line":253,"updated":"2014-09-05 18:42:08.000000000","message":"The new hacking modules will discourage the use of \\\nReformat to avoid this -- you can use ()  for instance.","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":257,"context_line":"                                (DogtagKRAPlugin.DSA_PUBLIC_KEY_HEADER,"},{"line_number":258,"context_line":"                                 pub_seq.encode().encode(\"base64\"),"},{"line_number":259,"context_line":"                                 DogtagKRAPlugin.DSA_PUBLIC_KEY_FOOTER)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        elif secret_type \u003d\u003d sstore.SecretType.PRIVATE:"},{"line_number":262,"context_line":"            if twsk:"},{"line_number":263,"context_line":"                raise DogtagPluginNotSupportedException("}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_edf53783","line":260,"updated":"2014-09-05 18:42:08.000000000","message":"You also need an else: here in case the algorithm is something else - like ECC perhaps.  And to raise a NotSupportedException.","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":279,"context_line":"            # TODO(alee-3) send transport key as well when dogtag client API"},{"line_number":280,"context_line":"            # changes in case the transport key has changed."},{"line_number":281,"context_line":"            # Also add a case to return the encrypted_data attribute of KeyData"},{"line_number":282,"context_line":"            # when a transport key wrapped session key is passed."},{"line_number":283,"context_line":"            key_data \u003d self.keyclient.retrieve_key(key_id, twsk)"},{"line_number":284,"context_line":"            if twsk:"},{"line_number":285,"context_line":"                recovered_key \u003d key_data.encrypted_data"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_4d7c83ec","line":282,"updated":"2014-09-05 18:42:08.000000000","message":"Why do we need the note on line 281-282?","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":352,"context_line":"                raise DogtagPluginNotSupportedException(\"Passphrase encryption\""},{"line_number":353,"context_line":"                                                        \" is not supported for\""},{"line_number":354,"context_line":"                                                        \" DSA algorithm\")"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"            stored_passphrase_info \u003d self.keyclient.archive_key("},{"line_number":357,"context_line":"                uuid.uuid4().hex,"},{"line_number":358,"context_line":"                self.keyclient.PASS_PHRASE_TYPE,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_ca0e993a","line":355,"updated":"2014-09-05 18:42:08.000000000","message":"We probably actually want to use an exception defined in secret_store.py here.  If there is no suitable exception, then create a new one and map that exception back to a 400 \nexception code. See api.__init__ (generate_safe_exception_message)","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"3acbcee476697d1aaee7dda94b9ad4bff77e97f8","unresolved":false,"context_lines":[{"line_number":383,"context_line":"            DogtagKRAPlugin.KEY_ID: passphrase_key_id,"},{"line_number":384,"context_line":"            DogtagKRAPlugin.SECRET_KEYSPEC: None"},{"line_number":385,"context_line":"        }"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        return sstore.AsymmetricKeyMetadataDTO(private_key_metadata,"},{"line_number":388,"context_line":"                                               public_key_metadata,"},{"line_number":389,"context_line":"                                               passphrase_metadata)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_4acaa91b","line":386,"updated":"2014-09-05 18:42:08.000000000","message":"I think you should probably only be defining a passphrase_metadata object if passphrase is defined.  You can do that easily by moving this code to line 362 above.\n\nYou probably also need to define the SECRET_TYPE.  That is, \nyou need to define everything that is needed to successfully retrieve the passphrase as its own independent secret.\n\nIn case of no passphrase, return None for the passphrase_metadata","commit_id":"5f5f766b6be90b31ac06db7e3b6b0f4548996e9b"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"18e4779606e6edf42da7dd810cd67b6adc34fbbc","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            DogtagPluginAlgorithmNotSupportedException,"},{"line_number":114,"context_line":"            self"},{"line_number":115,"context_line":"        ).__init__(algorithm)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"class DogtagKRAPlugin(sstore.SecretStoreBase):"},{"line_number":119,"context_line":"    \"\"\"Implementation of the secret store plugin with KRA as the backend.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_cdb60c3e","line":116,"updated":"2014-09-11 18:09:24.000000000","message":"The above class is just a wrapper around SecretAlgorithmNotSupportedException - and does not appear to add anything.  Why not just throw SecretAlgorithmNotSupportedException , and remove the above class?","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"8527bea88b79dab5d2abe5794d2ab8f6558d36a9","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                    \"Secrets of type \" +"},{"line_number":168,"context_line":"                    secret_metadata[DogtagKRAPlugin.SECRET_TYPE] +"},{"line_number":169,"context_line":"                    \" should not have a passphrase in the database, \""},{"line_number":170,"context_line":"                    \"for being used during retrieval.\""},{"line_number":171,"context_line":"                )"},{"line_number":172,"context_line":"        return passphrase"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_2acf812a","line":170,"updated":"2014-09-11 16:45:08.000000000","message":"This is not quite accurate -- Secrets need to be both PRIVATE and algorithm needs to be RSA.","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"8527bea88b79dab5d2abe5794d2ab8f6558d36a9","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                    \"retrieving a \" + secret_type + \" key.\")"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        return twsk"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def import_transport_cert(self, crypto):"},{"line_number":190,"context_line":"        # Get transport cert and insert in the certdb"},{"line_number":191,"context_line":"        transport_cert \u003d self.systemcert_client.get_transport_cert()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_ca4355ad","line":188,"updated":"2014-09-11 16:45:08.000000000","message":"Please move all internal methods (ie. those that are _foo()) to after the public methods.","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"8527bea88b79dab5d2abe5794d2ab8f6558d36a9","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        # Public key should be retrieved using the get_key_info method as"},{"line_number":276,"context_line":"        # it is treated as an attribute of the asymmetric key pair stored in"},{"line_number":277,"context_line":"        # the KRA database."},{"line_number":278,"context_line":"        if secret_type \u003d\u003d sstore.SecretType.PUBLIC:"},{"line_number":279,"context_line":"            key_info \u003d self.keyclient.get_key_info(key_id)"},{"line_number":280,"context_line":"            if key_spec.alg.upper() \u003d\u003d key.KeyClient.RSA_ALGORITHM:"},{"line_number":281,"context_line":"                recovered_key \u003d (RSA.importKey(key_info.public_key).publickey()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_25e5f2db","line":278,"updated":"2014-09-11 16:45:08.000000000","message":"Move the comment 275 - 277 to after line 278","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"8527bea88b79dab5d2abe5794d2ab8f6558d36a9","unresolved":false,"context_lines":[{"line_number":419,"context_line":"            DogtagKRAPlugin.KEY_ID: response.get_key_id(),"},{"line_number":420,"context_line":"            DogtagKRAPlugin.PASSPHRASE_KEY_ID: passphrase_key_id"},{"line_number":421,"context_line":"        }"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        return sstore.AsymmetricKeyMetadataDTO(private_key_metadata,"},{"line_number":424,"context_line":"                                               public_key_metadata,"},{"line_number":425,"context_line":"                                               passphrase_metadata)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_ea2c9904","line":422,"updated":"2014-09-11 16:45:08.000000000","message":"If the algorithm is DSA, you will be storing a value of None for the passphrase_key_id.  That will potentially cause a problem later when retrieving the key.\n\nIn fact, given what I see in _get_passphrase above, it will result in an exception being thrown because the key will exist in the metadata (with a value of None), but the algorithm will not be RSA.\n\nBetter to only store the pasasphrase_key_id if it is not None.","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"dc7bbc21533ccdc94c4835a129664c997abd40dc","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    @staticmethod"},{"line_number":146,"context_line":"    def get_trans_wrapped_session_key(secret_metadata):"},{"line_number":147,"context_line":"        twsk \u003d None"},{"line_number":148,"context_line":"        if \u0027trans_wrapped_session_key\u0027 in secret_metadata:"},{"line_number":149,"context_line":"            twsk \u003d secret_metadata[\u0027trans_wrapped_session_key\u0027]"},{"line_number":150,"context_line":"        secret_type \u003d secret_metadata[DogtagKRAPlugin.SECRET_TYPE]"},{"line_number":151,"context_line":"        if secret_type in {sstore.SecretType.PUBLIC,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_0a82264f","line":148,"updated":"2014-09-22 20:58:14.000000000","message":"Nit-pick but I generally do not hard-coded strings used more than once.","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"dc7bbc21533ccdc94c4835a129664c997abd40dc","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            twsk \u003d secret_metadata[\u0027trans_wrapped_session_key\u0027]"},{"line_number":150,"context_line":"        secret_type \u003d secret_metadata[DogtagKRAPlugin.SECRET_TYPE]"},{"line_number":151,"context_line":"        if secret_type in {sstore.SecretType.PUBLIC,"},{"line_number":152,"context_line":"                           sstore.SecretType.PRIVATE}:"},{"line_number":153,"context_line":"            if twsk:"},{"line_number":154,"context_line":"                raise DogtagPluginNotSupportedException("},{"line_number":155,"context_line":"                    \"Encryption using session key is not supported when \""}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_2a68cab9","line":152,"updated":"2014-09-22 20:58:14.000000000","message":"Just curious why you only support wrapping public and private keys? Why not symmetric keys?","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"dc7bbc21533ccdc94c4835a129664c997abd40dc","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            RSA - PEM format. (If a passphrase is provided in the keyspec, it"},{"line_number":259,"context_line":"                               is used in generating the output)"},{"line_number":260,"context_line":"            DSA - PEM format. (But does not support passphrase encryption,"},{"line_number":261,"context_line":"                               An error is thrown for such a case.)"},{"line_number":262,"context_line":"        \"\"\""},{"line_number":263,"context_line":"        key_id \u003d secret_metadata[DogtagKRAPlugin.KEY_ID]"},{"line_number":264,"context_line":"        secret_type \u003d secret_metadata[DogtagKRAPlugin.SECRET_TYPE]"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_ea5882fc","line":261,"updated":"2014-09-22 20:58:14.000000000","message":"We really need to standardize this.","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e4b2dc08f3ee8d101e769e0bda0620f6a43bca5e","unresolved":false,"context_lines":[{"line_number":282,"context_line":"            elif key_spec.alg.upper() \u003d\u003d key.KeyClient.DSA_ALGORITHM:"},{"line_number":283,"context_line":"                pub_seq \u003d asn1.DerSequence()"},{"line_number":284,"context_line":"                pub_seq[:] \u003d key_info.public_key"},{"line_number":285,"context_line":"                recovered_key \u003d (\"%s\\n%s%s\" %"},{"line_number":286,"context_line":"                                 (DogtagKRAPlugin.DSA_PUBLIC_KEY_HEADER,"},{"line_number":287,"context_line":"                                 pub_seq.encode().encode(\"base64\"),"},{"line_number":288,"context_line":"                                 DogtagKRAPlugin.DSA_PUBLIC_KEY_FOOTER))"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_40a08f90","line":285,"updated":"2014-09-22 22:56:13.000000000","message":"Please use the newer .format() approach here.","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e4b2dc08f3ee8d101e769e0bda0620f6a43bca5e","unresolved":false,"context_lines":[{"line_number":299,"context_line":"            elif key_spec.alg.upper() \u003d\u003d key.KeyClient.DSA_ALGORITHM:"},{"line_number":300,"context_line":"                pub_seq \u003d asn1.DerSequence()"},{"line_number":301,"context_line":"                pub_seq[:] \u003d key_data.data"},{"line_number":302,"context_line":"                recovered_key \u003d (\"%s\\n%s%s\" %"},{"line_number":303,"context_line":"                                 (DogtagKRAPlugin.DSA_PRIVATE_KEY_HEADER,"},{"line_number":304,"context_line":"                                 pub_seq.encode().encode(\"base64\"),"},{"line_number":305,"context_line":"                                 DogtagKRAPlugin.DSA_PRIVATE_KEY_FOOTER))"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_20caab4f","line":302,"updated":"2014-09-22 22:56:13.000000000","message":"Same as above comment.","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e4b2dc08f3ee8d101e769e0bda0620f6a43bca5e","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        passphrase_metadata \u003d None"},{"line_number":392,"context_line":"        if passphrase:"},{"line_number":393,"context_line":"            if algorithm \u003d\u003d key.KeyClient.DSA_ALGORITHM:"},{"line_number":394,"context_line":"                raise DogtagPluginNotSupportedException(\"Passphrase encryption\""},{"line_number":395,"context_line":"                                                        \" is not supported for\""},{"line_number":396,"context_line":"                                                        \" DSA algorithm\")"},{"line_number":397,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_c030ff58","line":394,"updated":"2014-09-22 22:56:13.000000000","message":"Minor nit, but folks have been favoring this indent style:\n    raise DogtagPluginNotSupportedException(\n        \"Passphrase encryption is not supported for DSA algorithm\")","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":8004,"name":"Paul Kehrer","email":"paul.l.kehrer@gmail.com","username":"reaperhulk"},"change_message_id":"39b40b503ae2aeb04ff8fa1f210f564aa6f7ecf0","unresolved":false,"context_lines":[{"line_number":144,"context_line":"    @staticmethod"},{"line_number":145,"context_line":"    def get_trans_wrapped_session_key(secret_metadata):"},{"line_number":146,"context_line":"        twsk \u003d None"},{"line_number":147,"context_line":"        if \u0027trans_wrapped_session_key\u0027 in secret_metadata:"},{"line_number":148,"context_line":"            twsk \u003d secret_metadata[\u0027trans_wrapped_session_key\u0027]"},{"line_number":149,"context_line":"        secret_type \u003d secret_metadata[DogtagKRAPlugin.SECRET_TYPE]"},{"line_number":150,"context_line":"        if secret_type in [sstore.SecretType.PUBLIC,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9df570_d2afe2e1","line":147,"updated":"2014-09-23 13:52:41.000000000","message":"This would be better as\n\ntwsk \u003d secret_metadata.get(\u0027trans_wrapped_session_key\u0027, None)\n\nget will return the value of the key if it exists, otherwise it returns the second arg.","commit_id":"da0ed0daffdf16b19e3a4635c17707f237b5fbf2"},{"author":{"_account_id":8004,"name":"Paul Kehrer","email":"paul.l.kehrer@gmail.com","username":"reaperhulk"},"change_message_id":"39b40b503ae2aeb04ff8fa1f210f564aa6f7ecf0","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        in the KRA."},{"line_number":169,"context_line":"        \"\"\""},{"line_number":170,"context_line":"        passphrase \u003d None"},{"line_number":171,"context_line":"        key_spec \u003d secret_metadata[DogtagKRAPlugin.SECRET_KEYSPEC]"},{"line_number":172,"context_line":"        if DogtagKRAPlugin.PASSPHRASE_KEY_ID in secret_metadata:"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"            if key_spec.alg.upper() \u003d\u003d key.KeyClient.RSA_ALGORITHM:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9df570_927d5a71","line":171,"updated":"2014-09-23 13:52:41.000000000","message":"Is this key guaranteed to be present in the secret metadata? From the rest of the code it looks like yes, so this should be okay, but just wanted to confirm.","commit_id":"da0ed0daffdf16b19e3a4635c17707f237b5fbf2"},{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"78bd8384cb5f280d5a75f4cb7b0f76edcb0ce7d1","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        secret_metadata by Barbican core."},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"        Format/Type of the secret returned in the SecretDTO object."},{"line_number":254,"context_line":"        Always binary data.(which is sent by barbican core.)"},{"line_number":255,"context_line":"        In case of retrieving an asymmetric key that is generated using the"},{"line_number":256,"context_line":"        dogtag plugin, then the binary representation of, the asymmetric key in"},{"line_number":257,"context_line":"        PEM format, is returned"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9df570_23f29ed2","line":254,"updated":"2014-09-23 14:50:37.000000000","message":"This is confusing to me. It says always binary, but PEM format is string in Base64 format. I thought the previous revision was clearer.","commit_id":"da0ed0daffdf16b19e3a4635c17707f237b5fbf2"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a101f0d266dc0873eb21bb99dd612eda0da02a34","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                DogtagKRAPlugin.TRANSPORT_NICK)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        LOG.debug(\"completed DogtagKRAPlugin init\")"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    @staticmethod"},{"line_number":152,"context_line":"    def get_trans_wrapped_session_key(secret_metadata):"},{"line_number":153,"context_line":"        twsk \u003d None"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9df570_f603e3b5","line":150,"updated":"2014-09-24 03:45:57.000000000","message":"lets make this method private ie. _get_trans_wrapped_session_key() and move it down with the other private methods","commit_id":"979f0c47e06da0abdbadbb5ac93fdba136bcaf27"},{"author":{"_account_id":8004,"name":"Paul Kehrer","email":"paul.l.kehrer@gmail.com","username":"reaperhulk"},"change_message_id":"1b2afc571e392560d612494e535ccc3265646791","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def get_trans_wrapped_session_key(secret_metadata):"},{"line_number":153,"context_line":"        twsk \u003d None"},{"line_number":154,"context_line":"        if \u0027trans_wrapped_session_key\u0027 in secret_metadata:"},{"line_number":155,"context_line":"            twsk \u003d secret_metadata.get(\u0027trans_wrapped_session_key\u0027, None)"},{"line_number":156,"context_line":"        secret_type \u003d secret_metadata.get(DogtagKRAPlugin.SECRET_TYPE, None)"},{"line_number":157,"context_line":"        if secret_type in [sstore.SecretType.PUBLIC,"},{"line_number":158,"context_line":"                           sstore.SecretType.PRIVATE]:"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9df570_20d7e1ee","line":155,"updated":"2014-09-24 01:39:15.000000000","message":"With this line you don\u0027t need the if conditional (or the assignment of twsk \u003d None) at all now.","commit_id":"979f0c47e06da0abdbadbb5ac93fdba136bcaf27"},{"author":{"_account_id":6783,"name":"Nathan Reller","email":"nathan.s.reller@gmail.com","username":"rellerreller"},"change_message_id":"455a901e67acf3b14b9670acb608ecd45e857ba9","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        In case of retrieving an asymmetric key that is generated using the"},{"line_number":246,"context_line":"        dogtag plugin, then the binary representation of, the asymmetric key in"},{"line_number":247,"context_line":"        PEM format, is returned"},{"line_number":248,"context_line":"        \"\"\""},{"line_number":249,"context_line":"        key_id \u003d secret_metadata[DogtagKRAPlugin.KEY_ID]"},{"line_number":250,"context_line":"        secret_type \u003d secret_metadata.get(DogtagKRAPlugin.SECRET_TYPE, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9df570_5a8845e7","line":247,"updated":"2014-09-24 14:24:11.000000000","message":"One thing that we definitely need to talk about at the summit is the expected behavior for asymmetric keys. It looks like generate_asymmetric_keys is expected to generate a certificate. It is returning a certificate here. I think it is slightly odd to generate a public key and then return a certificate.\n\nI\u0027m ok with this now, but we should discuss later.","commit_id":"979f0c47e06da0abdbadbb5ac93fdba136bcaf27"}],"barbican/tests/plugin/test_dogtag.py":[{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"ad58df4f3b27dffb320ba9c06c9bac6fe80b4d89","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.keyclient_mock.generate_asymmetric_key.assert_called_once_with("},{"line_number":76,"context_line":"            mock.ANY,"},{"line_number":77,"context_line":"            sstore.KeyAlgorithm.RSA.upper(),"},{"line_number":78,"context_line":"            3072,"},{"line_number":79,"context_line":"            mock.ANY)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_generate_non_supported_algorithm(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_096fd92b","line":78,"updated":"2014-08-29 18:07:04.000000000","message":"How is this test passing? 2048 !\u003d 3072","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"ad58df4f3b27dffb320ba9c06c9bac6fe80b4d89","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        }"},{"line_number":184,"context_line":"        self.plugin.get_secret(secret_metadata, context)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        self.keyclient_mock.retrieve_key.assert_called_once_with(\u0027key1\u0027, None)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def test_supports_symmetric_aes_key_generation(self):"},{"line_number":189,"context_line":"        key_spec \u003d sstore.KeySpec(sstore.KeyAlgorithm.AES, 256)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1abeadc6_a936e500","line":186,"updated":"2014-08-29 18:07:04.000000000","message":"This is a test to retrieve the public key -- and yet it reads like a test to retrieve the private key -- ie. calls retrieve_key()\n\nI dont think the tests are running .. make sure to run them through nosetests.\n\nPlease also add a test to get a private key.","commit_id":"bb8d596ecfdc85df0ee9e69cde6a042013496026"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c71e49b808ebf54dade1c7b79023614dea9aecd9","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        self.plugin.get_secret(secret_metadata, context)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        self.keyclient_mock.retrieve_key.assert_called_once_with(\u0027key1\u0027, None)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def test_get_public_key(self):"},{"line_number":190,"context_line":"        key_spec \u003d mock.MagicMock()"},{"line_number":191,"context_line":"        context \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_2ede79dd","line":188,"updated":"2014-09-04 21:37:23.000000000","message":"Lets beef up these tests.  We do lots of processing - turning what is returned into PEM format.  Mock the returns from the DRM and check that the returns are correct.","commit_id":"0ceaba2fb511e063b0ca54e94ef00fc5e7835e38"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"18e4779606e6edf42da7dd810cd67b6adc34fbbc","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        key_spec \u003d sstore.KeySpec(sstore.KeyAlgorithm.RSA, 2048)"},{"line_number":181,"context_line":"        context \u003d mock.MagicMock()"},{"line_number":182,"context_line":"        key_data \u003d dogtag_key.KeyData()"},{"line_number":183,"context_line":"        key_data.data \u003d RSA.generate(2048).exportKey(\u0027PEM\u0027)"},{"line_number":184,"context_line":"        self.keyclient_mock.retrieve_key.return_value \u003d key_data"},{"line_number":185,"context_line":"        secret_metadata \u003d {"},{"line_number":186,"context_line":"            dogtag_import.DogtagKRAPlugin.SECRET_TYPE:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_2d3318ac","line":183,"updated":"2014-09-11 18:09:24.000000000","message":"This is not correct.  What comes back from the KRA in key_data.data is binary data, right?","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"18e4779606e6edf42da7dd810cd67b6adc34fbbc","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        result \u003d self.plugin.get_secret(secret_metadata, context)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        assert result.secret \u003d\u003d key_data.data"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_get_public_key(self):"},{"line_number":196,"context_line":"        key_spec \u003d sstore.KeySpec(sstore.KeyAlgorithm.RSA, 2048)"},{"line_number":197,"context_line":"        context \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_edf6705c","line":194,"updated":"2014-09-11 18:09:24.000000000","message":"OK - I can see how this test would pass, basically:\n\nresult.secret - RSA.importKey(key_data.data).exportKey(\u0027PEM\u0027)\n\nBut its probably better to have key_data.data be binary just as it would come the KRA.  See if there is a way in exportKey()","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"18e4779606e6edf42da7dd810cd67b6adc34fbbc","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        result \u003d self.plugin.get_secret(secret_metadata, context)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        assert result.secret \u003d\u003d key_info.public_key"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def test_supports_symmetric_aes_key_generation(self):"},{"line_number":212,"context_line":"        key_spec \u003d sstore.KeySpec(sstore.KeyAlgorithm.AES, 256)"},{"line_number":213,"context_line":"        self.assertTrue("}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_6da2804c","line":210,"updated":"2014-09-11 18:09:24.000000000","message":"Same consideration as above here.\n\nAlso it would be nice to see some tests with passphrases, both for get_secret and generate_secret","commit_id":"d498d09fcda47dfbfd0cf9be9d994e42bb736c28"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e4b2dc08f3ee8d101e769e0bda0620f6a43bca5e","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        }"},{"line_number":192,"context_line":"        result \u003d self.plugin.get_secret(secret_metadata, context)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        assert result.secret \u003d\u003d test_key.exportKey(\u0027PEM\u0027)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def test_get_public_key(self):"},{"line_number":197,"context_line":"        key_spec \u003d sstore.KeySpec(sstore.KeyAlgorithm.RSA, 2048)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_3bc1fe80","line":194,"updated":"2014-09-22 22:56:13.000000000","message":"Please instead use self.assertEqual(test_key.exportKey(\u0027PEM\u0027), result.secret)","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e4b2dc08f3ee8d101e769e0bda0620f6a43bca5e","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        }"},{"line_number":209,"context_line":"        result \u003d self.plugin.get_secret(secret_metadata, context)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        assert result.secret \u003d\u003d test_public_key.exportKey(\u0027PEM\u0027)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def test_store_passphrase_for_using_in_private_key_retrieval(self):"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_7bbb860e","line":211,"updated":"2014-09-22 22:56:13.000000000","message":"See above.","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e4b2dc08f3ee8d101e769e0bda0620f6a43bca5e","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        asym_key_DTO \u003d self.plugin.generate_asymmetric_key(key_spec, context)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        assert asym_key_DTO.private_key_meta["},{"line_number":229,"context_line":"            dogtag_import.DogtagKRAPlugin.PASSPHRASE_KEY_ID"},{"line_number":230,"context_line":"        ] \u003d\u003d \u00271\u0027"},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_9b374ab0","line":228,"updated":"2014-09-22 22:56:13.000000000","message":"See above.","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"e4b2dc08f3ee8d101e769e0bda0620f6a43bca5e","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        }"},{"line_number":252,"context_line":"        result \u003d self.plugin.get_secret(secret_metadata, context)"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        assert result.secret \u003d\u003d test_key.exportKey(\u0027PEM\u0027)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def test_supports_symmetric_aes_key_generation(self):"},{"line_number":257,"context_line":"        key_spec \u003d sstore.KeySpec(sstore.KeyAlgorithm.AES, 256)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9df570_db41d20c","line":254,"updated":"2014-09-22 22:56:13.000000000","message":"See above.","commit_id":"09f440fa055a81c9095672bd97be39322c1e47c6"},{"author":{"_account_id":8004,"name":"Paul Kehrer","email":"paul.l.kehrer@gmail.com","username":"reaperhulk"},"change_message_id":"1b2afc571e392560d612494e535ccc3265646791","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            dogtag_import.DogtagKRAPlugin.SECRET_TYPE:"},{"line_number":148,"context_line":"            sstore.SecretType.SYMMETRIC,"},{"line_number":149,"context_line":"            dogtag_import.DogtagKRAPlugin.ALG: sstore.KeyAlgorithm.AES,"},{"line_number":150,"context_line":"            dogtag_import.DogtagKRAPlugin.BIT_LENGTH: 2048,"},{"line_number":151,"context_line":"            dogtag_import.DogtagKRAPlugin.KEY_ID: \u0027key1\u0027"},{"line_number":152,"context_line":"        }"},{"line_number":153,"context_line":"        self.plugin.get_secret(secret_metadata)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9df570_80d24dd0","line":150,"updated":"2014-09-24 01:39:15.000000000","message":"Is Dogtag okay with a request for a 2048-bit AES key? (I realize this is mostly mocked, but maybe this should be 128/192/256?)","commit_id":"979f0c47e06da0abdbadbb5ac93fdba136bcaf27"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a101f0d266dc0873eb21bb99dd612eda0da02a34","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            dogtag_import.DogtagKRAPlugin.SECRET_TYPE:"},{"line_number":148,"context_line":"            sstore.SecretType.SYMMETRIC,"},{"line_number":149,"context_line":"            dogtag_import.DogtagKRAPlugin.ALG: sstore.KeyAlgorithm.AES,"},{"line_number":150,"context_line":"            dogtag_import.DogtagKRAPlugin.BIT_LENGTH: 2048,"},{"line_number":151,"context_line":"            dogtag_import.DogtagKRAPlugin.KEY_ID: \u0027key1\u0027"},{"line_number":152,"context_line":"        }"},{"line_number":153,"context_line":"        self.plugin.get_secret(secret_metadata)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9df570_b6cebb81","line":150,"in_reply_to":"da9df570_80d24dd0","updated":"2014-09-24 03:45:57.000000000","message":"Correct,this should be 256","commit_id":"979f0c47e06da0abdbadbb5ac93fdba136bcaf27"}],"etc/barbican/barbican-api.conf":[{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"a101f0d266dc0873eb21bb99dd612eda0da02a34","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"# Server name for RPC service"},{"line_number":152,"context_line":"server_name \u003d \u0027barbican.queue\u0027"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d Crypto plugin \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":156,"context_line":"[crypto]"}],"source_content_type":"text/plain","patch_set":8,"id":"da9df570_f6f123ce","line":153,"updated":"2014-09-24 03:45:57.000000000","message":"Lets get rid of this change.","commit_id":"979f0c47e06da0abdbadbb5ac93fdba136bcaf27"}]}
