GitHub PullRequestReviewCommentEvent at 2014-02-28 21:23:04
Repository: cryptography
Actor: public
Payload: {"comment":{"url":"https://api.github.com/repos/pyca/cryptography/pulls/comments/10181786","id":10181786,"diff_hunk":"@@ -793,5 +832,37 @@ def _verify_pkcs1(self, rsa_cdata, evp_pkey, evp_md):\n         if res == 0:\n             raise InvalidSignature\n \n+    def _verify_pss(self, rsa_cdata, evp_pkey, evp_md):\n+        pkey_size = self._backend._lib.EVP_PKEY_size(evp_pkey)\n+        assert pkey_size > 0\n+        buf = self._backend._ffi.new(\"unsigned char[]\", pkey_size)\n+        res = self._backend._lib.RSA_public_decrypt(\n+            len(self._signature),\n+            self._signature,\n+            buf,\n+            rsa_cdata,\n+            self._backend._lib.RSA_NO_PADDING\n+        )\n+        if res == -1:\n+            print(\"TEMPORARY MARK MAN IS THIS GHETTO\")\n+            print(\"modulus: {0}\".format(self._public_key.modulus))\n+            print(\"pub_exp: {0}\".format(self._public_key.public_exponent))\n+            print(\"modulus: {0}\".format(self._backend._bn_to_int(rsa_cdata.n)))\n+            print(\"pub_exp: {0}\".format(self._backend._bn_to_int(rsa_cdata.e)))\n+            self._backend._handle_error(None)\n+        assert res == pkey_size\n+\n+        data_to_verify = self._hash_ctx.finalize()\n+        self._hash_ctx = None\n+        res = self._backend._lib.RSA_verify_PKCS1_PSS(\n+            rsa_cdata,\n+            data_to_verify,\n+            evp_md,\n+            buf,\n+            -2\n+        )\n+        if res != 1:\n+            raise InvalidSignature","path":"cryptography/hazmat/backends/openssl/backend.py","position":101,"original_position":101,"commit_id":"2b3c2bf44db537798f0694780d8c7d9ce687f0b4","original_commit_id":"2b3c2bf44db537798f0694780d8c7d9ce687f0b4","user":{"login":"public","id":83000,"avatar_url":"https://avatars.githubusercontent.com/u/83000","gravatar_id":"91731227630488f1d17e3e780e9eb50a","url":"https://api.github.com/users/public","html_url":"https://github.com/public","followers_url":"https://api.github.com/users/public/followers","following_url":"https://api.github.com/users/public/following{/other_user}","gists_url":"https://api.github.com/users/public/gists{/gist_id}","starred_url":"https://api.github.com/users/public/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/public/subscriptions","organizations_url":"https://api.github.com/users/public/orgs","repos_url":"https://api.github.com/users/public/repos","events_url":"https://api.github.com/users/public/events{/privacy}","received_events_url":"https://api.github.com/users/public/received_events","type":"User","site_admin":false},"body":"Errors can be pushed onto the stack here? I think this is part of why you are getting intermittent test failures.","created_at":"2014-02-28T21:23:04Z","updated_at":"2014-02-28T21:23:04Z","html_url":"https://github.com/pyca/cryptography/pull/676#discussion_r10181786","pull_request_url":"https://api.github.com/repos/pyca/cryptography/pulls/676","_links":{"self":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/comments/10181786"},"html":{"href":"https://github.com/pyca/cryptography/pull/676#discussion_r10181786"},"pull_request":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/676"}}}}