{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/comments/93721411","pull_request_review_id":14254070,"id":93721411,"diff_hunk":"@@ -21,49 +21,79 @@\n import static org.mockito.Mockito.verify;\n import static org.mockito.Mockito.when;\n \n+import com.google.common.base.Throwables;\n+import com.palantir.crypto.KeyMaterial;\n import com.palantir.crypto.cipher.CipherStreamSupplier;\n import com.palantir.crypto.cipher.SeekableCipher;\n import java.io.IOException;\n import java.security.InvalidAlgorithmParameterException;\n import java.security.InvalidKeyException;\n import java.security.NoSuchAlgorithmException;\n+import java.security.SecureRandom;\n+import java.util.Properties;\n import javax.crypto.Cipher;\n-import javax.crypto.CipherOutputStream;\n+import javax.crypto.KeyGenerator;\n import javax.crypto.NoSuchPaddingException;\n+import javax.crypto.SecretKey;\n import javax.crypto.ShortBufferException;\n+import javax.crypto.spec.IvParameterSpec;\n+import org.apache.commons.crypto.cipher.CryptoCipher;\n+import org.apache.commons.crypto.stream.CryptoOutputStream;\n import org.apache.hadoop.fs.FSDataOutputStream;\n import org.junit.Before;\n import org.junit.Test;\n \n public final class FsCipherOutputStreamTest {\n \n     private FSDataOutputStream os;\n-    private Cipher initCipher;\n+    private CryptoCipher initCipher;\n     private SeekableCipher seekableCipher;\n     private CipherStreamSupplier supplier;\n-    private CipherOutputStream cos;\n+    private CryptoOutputStream cos;\n     private FsCipherOutputStream scos;\n+    private IvParameterSpec ivParameterSpec;\n+    private SecretKey key;\n+    private String transformation = \"AES/CBC/PKCS5Padding\";\n+    private KeyMaterial keyMaterial;\n \n     @Before\n     public void before()\n             throws ShortBufferException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException,\n             InvalidAlgorithmParameterException {\n-        initCipher = mock(Cipher.class);\n+        initCipher = mock(CryptoCipher.class);\n         os = mock(FSDataOutputStream.class);\n-        cos = mock(CipherOutputStream.class);\n+        cos = mock(CryptoOutputStream.class);\n         seekableCipher = mock(SeekableCipher.class);\n         supplier = mock(CipherStreamSupplier.class);\n+        keyMaterial = mock(KeyMaterial.class);\n+        ivParameterSpec = mock(IvParameterSpec.class);\n+        byte[] iv = new byte[16];\n+        SecureRandom rng = new SecureRandom();\n+        rng.nextBytes(iv);\n+        // this.ivParameterSpec = new IvParameterSpec(iv);","path":"hadoop-crypto/src/test/java/com/palantir/hadoop/cipher/FsCipherOutputStreamTest.java","position":58,"original_position":58,"commit_id":"b5aaf3bbab59164f9254f07c403c1b1d625fdbb2","original_commit_id":"b5aaf3bbab59164f9254f07c403c1b1d625fdbb2","user":{"login":"uschi2000","id":6528449,"avatar_url":"https://avatars.githubusercontent.com/u/6528449?v=3","gravatar_id":"","url":"https://api.github.com/users/uschi2000","html_url":"https://github.com/uschi2000","followers_url":"https://api.github.com/users/uschi2000/followers","following_url":"https://api.github.com/users/uschi2000/following{/other_user}","gists_url":"https://api.github.com/users/uschi2000/gists{/gist_id}","starred_url":"https://api.github.com/users/uschi2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uschi2000/subscriptions","organizations_url":"https://api.github.com/users/uschi2000/orgs","repos_url":"https://api.github.com/users/uschi2000/repos","events_url":"https://api.github.com/users/uschi2000/events{/privacy}","received_events_url":"https://api.github.com/users/uschi2000/received_events","type":"User","site_admin":false},"body":"oops","created_at":"2016-12-23T01:16:32Z","updated_at":"2016-12-23T01:18:47Z","html_url":"https://github.com/palantir/hadoop-crypto/pull/35#discussion_r93721411","pull_request_url":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/comments/93721411"},"html":{"href":"https://github.com/palantir/hadoop-crypto/pull/35#discussion_r93721411"},"pull_request":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35","id":98868743,"html_url":"https://github.com/palantir/hadoop-crypto/pull/35","diff_url":"https://github.com/palantir/hadoop-crypto/pull/35.diff","patch_url":"https://github.com/palantir/hadoop-crypto/pull/35.patch","issue_url":"https://api.github.com/repos/palantir/hadoop-crypto/issues/35","number":35,"state":"open","locked":false,"title":"[WIP] sr/native libs","user":{"login":"sjrand","id":1912073,"avatar_url":"https://avatars.githubusercontent.com/u/1912073?v=3","gravatar_id":"","url":"https://api.github.com/users/sjrand","html_url":"https://github.com/sjrand","followers_url":"https://api.github.com/users/sjrand/followers","following_url":"https://api.github.com/users/sjrand/following{/other_user}","gists_url":"https://api.github.com/users/sjrand/gists{/gist_id}","starred_url":"https://api.github.com/users/sjrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjrand/subscriptions","organizations_url":"https://api.github.com/users/sjrand/orgs","repos_url":"https://api.github.com/users/sjrand/repos","events_url":"https://api.github.com/users/sjrand/events{/privacy}","received_events_url":"https://api.github.com/users/sjrand/received_events","type":"User","site_admin":false},"body":"Same idea as #22, which I didn't actually mean to close.","created_at":"2016-12-21T04:06:26Z","updated_at":"2016-12-23T01:18:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"061098ba3e13a41ee17d59ded438b739fa9db6cd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35/commits","review_comments_url":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35/comments","review_comment_url":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/hadoop-crypto/issues/35/comments","statuses_url":"https://api.github.com/repos/palantir/hadoop-crypto/statuses/b5aaf3bbab59164f9254f07c403c1b1d625fdbb2","head":{"label":"sjrand:sr/native-libs","ref":"sr/native-libs","sha":"b5aaf3bbab59164f9254f07c403c1b1d625fdbb2","user":{"login":"sjrand","id":1912073,"avatar_url":"https://avatars.githubusercontent.com/u/1912073?v=3","gravatar_id":"","url":"https://api.github.com/users/sjrand","html_url":"https://github.com/sjrand","followers_url":"https://api.github.com/users/sjrand/followers","following_url":"https://api.github.com/users/sjrand/following{/other_user}","gists_url":"https://api.github.com/users/sjrand/gists{/gist_id}","starred_url":"https://api.github.com/users/sjrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjrand/subscriptions","organizations_url":"https://api.github.com/users/sjrand/orgs","repos_url":"https://api.github.com/users/sjrand/repos","events_url":"https://api.github.com/users/sjrand/events{/privacy}","received_events_url":"https://api.github.com/users/sjrand/received_events","type":"User","site_admin":false},"repo":{"id":75011911,"name":"hadoop-crypto","full_name":"sjrand/hadoop-crypto","owner":{"login":"sjrand","id":1912073,"avatar_url":"https://avatars.githubusercontent.com/u/1912073?v=3","gravatar_id":"","url":"https://api.github.com/users/sjrand","html_url":"https://github.com/sjrand","followers_url":"https://api.github.com/users/sjrand/followers","following_url":"https://api.github.com/users/sjrand/following{/other_user}","gists_url":"https://api.github.com/users/sjrand/gists{/gist_id}","starred_url":"https://api.github.com/users/sjrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjrand/subscriptions","organizations_url":"https://api.github.com/users/sjrand/orgs","repos_url":"https://api.github.com/users/sjrand/repos","events_url":"https://api.github.com/users/sjrand/events{/privacy}","received_events_url":"https://api.github.com/users/sjrand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sjrand/hadoop-crypto","description":"Library for per-file client-side encyption in Hadoop FileSystems such as HDFS or S3.","fork":true,"url":"https://api.github.com/repos/sjrand/hadoop-crypto","forks_url":"https://api.github.com/repos/sjrand/hadoop-crypto/forks","keys_url":"https://api.github.com/repos/sjrand/hadoop-crypto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sjrand/hadoop-crypto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sjrand/hadoop-crypto/teams","hooks_url":"https://api.github.com/repos/sjrand/hadoop-crypto/hooks","issue_events_url":"https://api.github.com/repos/sjrand/hadoop-crypto/issues/events{/number}","events_url":"https://api.github.com/repos/sjrand/hadoop-crypto/events","assignees_url":"https://api.github.com/repos/sjrand/hadoop-crypto/assignees{/user}","branches_url":"https://api.github.com/repos/sjrand/hadoop-crypto/branches{/branch}","tags_url":"https://api.github.com/repos/sjrand/hadoop-crypto/tags","blobs_url":"https://api.github.com/repos/sjrand/hadoop-crypto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sjrand/hadoop-crypto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sjrand/hadoop-crypto/git/refs{/sha}","trees_url":"https://api.github.com/repos/sjrand/hadoop-crypto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sjrand/hadoop-crypto/statuses/{sha}","languages_url":"https://api.github.com/repos/sjrand/hadoop-crypto/languages","stargazers_url":"https://api.github.com/repos/sjrand/hadoop-crypto/stargazers","contributors_url":"https://api.github.com/repos/sjrand/hadoop-crypto/contributors","subscribers_url":"https://api.github.com/repos/sjrand/hadoop-crypto/subscribers","subscription_url":"https://api.github.com/repos/sjrand/hadoop-crypto/subscription","commits_url":"https://api.github.com/repos/sjrand/hadoop-crypto/commits{/sha}","git_commits_url":"https://api.github.com/repos/sjrand/hadoop-crypto/git/commits{/sha}","comments_url":"https://api.github.com/repos/sjrand/hadoop-crypto/comments{/number}","issue_comment_url":"https://api.github.com/repos/sjrand/hadoop-crypto/issues/comments{/number}","contents_url":"https://api.github.com/repos/sjrand/hadoop-crypto/contents/{+path}","compare_url":"https://api.github.com/repos/sjrand/hadoop-crypto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sjrand/hadoop-crypto/merges","archive_url":"https://api.github.com/repos/sjrand/hadoop-crypto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sjrand/hadoop-crypto/downloads","issues_url":"https://api.github.com/repos/sjrand/hadoop-crypto/issues{/number}","pulls_url":"https://api.github.com/repos/sjrand/hadoop-crypto/pulls{/number}","milestones_url":"https://api.github.com/repos/sjrand/hadoop-crypto/milestones{/number}","notifications_url":"https://api.github.com/repos/sjrand/hadoop-crypto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sjrand/hadoop-crypto/labels{/name}","releases_url":"https://api.github.com/repos/sjrand/hadoop-crypto/releases{/id}","deployments_url":"https://api.github.com/repos/sjrand/hadoop-crypto/deployments","created_at":"2016-11-28T20:33:59Z","updated_at":"2016-11-28T20:34:01Z","pushed_at":"2016-12-22T05:26:02Z","git_url":"git://github.com/sjrand/hadoop-crypto.git","ssh_url":"git@github.com:sjrand/hadoop-crypto.git","clone_url":"https://github.com/sjrand/hadoop-crypto.git","svn_url":"https://github.com/sjrand/hadoop-crypto","homepage":null,"size":217,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"f96a85507eabce41d42f679fb4a8a83c17fa089b","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":62156481,"name":"hadoop-crypto","full_name":"palantir/hadoop-crypto","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/hadoop-crypto","description":"Library for per-file client-side encyption in Hadoop FileSystems such as HDFS or S3.","fork":false,"url":"https://api.github.com/repos/palantir/hadoop-crypto","forks_url":"https://api.github.com/repos/palantir/hadoop-crypto/forks","keys_url":"https://api.github.com/repos/palantir/hadoop-crypto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/hadoop-crypto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/hadoop-crypto/teams","hooks_url":"https://api.github.com/repos/palantir/hadoop-crypto/hooks","issue_events_url":"https://api.github.com/repos/palantir/hadoop-crypto/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/hadoop-crypto/events","assignees_url":"https://api.github.com/repos/palantir/hadoop-crypto/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/hadoop-crypto/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/hadoop-crypto/tags","blobs_url":"https://api.github.com/repos/palantir/hadoop-crypto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/hadoop-crypto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/hadoop-crypto/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/hadoop-crypto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/hadoop-crypto/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/hadoop-crypto/languages","stargazers_url":"https://api.github.com/repos/palantir/hadoop-crypto/stargazers","contributors_url":"https://api.github.com/repos/palantir/hadoop-crypto/contributors","subscribers_url":"https://api.github.com/repos/palantir/hadoop-crypto/subscribers","subscription_url":"https://api.github.com/repos/palantir/hadoop-crypto/subscription","commits_url":"https://api.github.com/repos/palantir/hadoop-crypto/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/hadoop-crypto/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/hadoop-crypto/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/hadoop-crypto/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/hadoop-crypto/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/hadoop-crypto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/hadoop-crypto/merges","archive_url":"https://api.github.com/repos/palantir/hadoop-crypto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/hadoop-crypto/downloads","issues_url":"https://api.github.com/repos/palantir/hadoop-crypto/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/hadoop-crypto/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/hadoop-crypto/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/hadoop-crypto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/hadoop-crypto/labels{/name}","releases_url":"https://api.github.com/repos/palantir/hadoop-crypto/releases{/id}","deployments_url":"https://api.github.com/repos/palantir/hadoop-crypto/deployments","created_at":"2016-06-28T16:18:49Z","updated_at":"2016-12-07T11:02:35Z","pushed_at":"2016-12-22T05:26:03Z","git_url":"git://github.com/palantir/hadoop-crypto.git","ssh_url":"git@github.com:palantir/hadoop-crypto.git","clone_url":"https://github.com/palantir/hadoop-crypto.git","svn_url":"https://github.com/palantir/hadoop-crypto","homepage":null,"size":219,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":4,"forks":6,"open_issues":4,"watchers":10,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35"},"html":{"href":"https://github.com/palantir/hadoop-crypto/pull/35"},"issue":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/issues/35"},"comments":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/hadoop-crypto/statuses/b5aaf3bbab59164f9254f07c403c1b1d625fdbb2"}}}}
{"actor":{"display_login":"uschi2000"}}