{"action":"created","issue":{"url":"https://api.github.com/repos/openssl/openssl/issues/1455","repository_url":"https://api.github.com/repos/openssl/openssl","labels_url":"https://api.github.com/repos/openssl/openssl/issues/1455/labels{/name}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/1455/comments","events_url":"https://api.github.com/repos/openssl/openssl/issues/1455/events","html_url":"https://github.com/openssl/openssl/pull/1455","id":171075992,"number":1455,"title":"Never return -1 from BN_exp","user":{"login":"bukka","id":137594,"avatar_url":"https://avatars.githubusercontent.com/u/137594?v=3","gravatar_id":"","url":"https://api.github.com/users/bukka","html_url":"https://github.com/bukka","followers_url":"https://api.github.com/users/bukka/followers","following_url":"https://api.github.com/users/bukka/following{/other_user}","gists_url":"https://api.github.com/users/bukka/gists{/gist_id}","starred_url":"https://api.github.com/users/bukka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bukka/subscriptions","organizations_url":"https://api.github.com/users/bukka/orgs","repos_url":"https://api.github.com/users/bukka/repos","events_url":"https://api.github.com/users/bukka/events{/privacy}","received_events_url":"https://api.github.com/users/bukka/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openssl/openssl/labels/reviewed","name":"reviewed","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"richsalz","id":7332500,"avatar_url":"https://avatars.githubusercontent.com/u/7332500?v=3","gravatar_id":"","url":"https://api.github.com/users/richsalz","html_url":"https://github.com/richsalz","followers_url":"https://api.github.com/users/richsalz/followers","following_url":"https://api.github.com/users/richsalz/following{/other_user}","gists_url":"https://api.github.com/users/richsalz/gists{/gist_id}","starred_url":"https://api.github.com/users/richsalz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richsalz/subscriptions","organizations_url":"https://api.github.com/users/richsalz/orgs","repos_url":"https://api.github.com/users/richsalz/repos","events_url":"https://api.github.com/users/richsalz/events{/privacy}","received_events_url":"https://api.github.com/users/richsalz/received_events","type":"User","site_admin":false},"assignees":[{"login":"richsalz","id":7332500,"avatar_url":"https://avatars.githubusercontent.com/u/7332500?v=3","gravatar_id":"","url":"https://api.github.com/users/richsalz","html_url":"https://github.com/richsalz","followers_url":"https://api.github.com/users/richsalz/followers","following_url":"https://api.github.com/users/richsalz/following{/other_user}","gists_url":"https://api.github.com/users/richsalz/gists{/gist_id}","starred_url":"https://api.github.com/users/richsalz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richsalz/subscriptions","organizations_url":"https://api.github.com/users/richsalz/orgs","repos_url":"https://api.github.com/users/richsalz/repos","events_url":"https://api.github.com/users/richsalz/events{/privacy}","received_events_url":"https://api.github.com/users/richsalz/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/openssl/openssl/milestones/1","html_url":"https://github.com/openssl/openssl/milestones/1.1.0","labels_url":"https://api.github.com/repos/openssl/openssl/milestones/1/labels","id":1748232,"number":1,"title":"1.1.0","description":"","creator":{"login":"levitte","id":698918,"avatar_url":"https://avatars.githubusercontent.com/u/698918?v=3","gravatar_id":"","url":"https://api.github.com/users/levitte","html_url":"https://github.com/levitte","followers_url":"https://api.github.com/users/levitte/followers","following_url":"https://api.github.com/users/levitte/following{/other_user}","gists_url":"https://api.github.com/users/levitte/gists{/gist_id}","starred_url":"https://api.github.com/users/levitte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levitte/subscriptions","organizations_url":"https://api.github.com/users/levitte/orgs","repos_url":"https://api.github.com/users/levitte/repos","events_url":"https://api.github.com/users/levitte/events{/privacy}","received_events_url":"https://api.github.com/users/levitte/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":256,"state":"open","created_at":"2016-05-04T17:53:39Z","updated_at":"2016-08-14T21:18:26Z","due_on":"2016-08-24T22:00:00Z","closed_at":null},"comments":2,"created_at":"2016-08-14T20:06:24Z","updated_at":"2016-08-14T21:46:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/1455","html_url":"https://github.com/openssl/openssl/pull/1455","diff_url":"https://github.com/openssl/openssl/pull/1455.diff","patch_url":"https://github.com/openssl/openssl/pull/1455.patch"},"body":"The return code of `BN_exp`, `BN_mod_exp` is documented as 0. However it might return -1 in the cases below which can happen if BN is not correct. This is an issue for example in ` DSA_generate_key` that relies on that return value.\r\n\r\nThis is actually not a theoretical issue as it happened when I was playing with DSA in PHP openssl ext:\r\n\r\nhttps://github.com/php/php-src/blob/c3c90abb17017af83133f57ec5d7663c0b33fdff/ext/openssl/tests/bug72336.phpt\r\n\r\nThe problem was that we expect binary value - BN_bin2bn is used on the string (meaning user forgot to call hex2bin). What happened is that `DSA_generate_key` returned 1 (success) but in fact priv key wasn't generated. Currently I have to do this after porting to 1.1 which is a bit messy.\r\n\r\nhttps://github.com/php/php-src/blob/c3c90abb17017af83133f57ec5d7663c0b33fdff/ext/openssl/openssl.c#L4077-L4082\r\n\r\nI understand that it might not be good to fix it in 1.0.2 due to BC break but 1.1 would be good IMHO."},"comment":{"url":"https://api.github.com/repos/openssl/openssl/issues/comments/239699750","html_url":"https://github.com/openssl/openssl/pull/1455#issuecomment-239699750","issue_url":"https://api.github.com/repos/openssl/openssl/issues/1455","id":239699750,"user":{"login":"t-j-h","id":7409473,"avatar_url":"https://avatars.githubusercontent.com/u/7409473?v=3","gravatar_id":"","url":"https://api.github.com/users/t-j-h","html_url":"https://github.com/t-j-h","followers_url":"https://api.github.com/users/t-j-h/followers","following_url":"https://api.github.com/users/t-j-h/following{/other_user}","gists_url":"https://api.github.com/users/t-j-h/gists{/gist_id}","starred_url":"https://api.github.com/users/t-j-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-j-h/subscriptions","organizations_url":"https://api.github.com/users/t-j-h/orgs","repos_url":"https://api.github.com/users/t-j-h/repos","events_url":"https://api.github.com/users/t-j-h/events{/privacy}","received_events_url":"https://api.github.com/users/t-j-h/received_events","type":"User","site_admin":false},"created_at":"2016-08-14T21:46:03Z","updated_at":"2016-08-14T21:46:03Z","body":"That the actual function can return -1 and always has means that this is actually a documentation error in this instance. That it should be consistent and not do so is a separate item. Taking a quick \"grep\" for return statements in the bn code I think this won't be the only function where a return of neither 0 or 1 is possible."}}
{"actor":{"display_login":"t-j-h"}}