{"action":"created","issue":{"url":"https://api.github.com/repos/openssl/openssl/issues/7493","repository_url":"https://api.github.com/repos/openssl/openssl","labels_url":"https://api.github.com/repos/openssl/openssl/issues/7493/labels{/name}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/7493/comments","events_url":"https://api.github.com/repos/openssl/openssl/issues/7493/events","html_url":"https://github.com/openssl/openssl/pull/7493","id":373931767,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NzQ2NzUw","number":7493,"title":"DSA: Check for sanity of input parameters","user":{"login":"ciz","id":696186,"node_id":"MDQ6VXNlcjY5NjE4Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/696186?v=4","gravatar_id":"","url":"https://api.github.com/users/ciz","html_url":"https://github.com/ciz","followers_url":"https://api.github.com/users/ciz/followers","following_url":"https://api.github.com/users/ciz/following{/other_user}","gists_url":"https://api.github.com/users/ciz/gists{/gist_id}","starred_url":"https://api.github.com/users/ciz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciz/subscriptions","organizations_url":"https://api.github.com/users/ciz/orgs","repos_url":"https://api.github.com/users/ciz/repos","events_url":"https://api.github.com/users/ciz/events{/privacy}","received_events_url":"https://api.github.com/users/ciz/received_events","type":"User","site_admin":false},"labels":[{"id":441165257,"node_id":"MDU6TGFiZWw0NDExNjUyNTc=","url":"https://api.github.com/repos/openssl/openssl/labels/1.0.2","name":"1.0.2","color":"bfdadc","default":false},{"id":441165399,"node_id":"MDU6TGFiZWw0NDExNjUzOTk=","url":"https://api.github.com/repos/openssl/openssl/labels/1.1.0","name":"1.1.0","color":"bfdadc","default":false},{"id":872237503,"node_id":"MDU6TGFiZWw4NzIyMzc1MDM=","url":"https://api.github.com/repos/openssl/openssl/labels/1.1.1","name":"1.1.1","color":"bfdadc","default":false},{"id":441165144,"node_id":"MDU6TGFiZWw0NDExNjUxNDQ=","url":"https://api.github.com/repos/openssl/openssl/labels/master","name":"master","color":"bfdadc","default":false},{"id":314766253,"node_id":"MDU6TGFiZWwzMTQ3NjYyNTM=","url":"https://api.github.com/repos/openssl/openssl/labels/ready","name":"ready","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/openssl/openssl/milestones/13","html_url":"https://github.com/openssl/openssl/milestone/13","labels_url":"https://api.github.com/repos/openssl/openssl/milestones/13/labels","id":3760591,"node_id":"MDk6TWlsZXN0b25lMzc2MDU5MQ==","number":13,"title":"1.1.1a","description":null,"creator":{"login":"mattcaswell","id":7422273,"node_id":"MDQ6VXNlcjc0MjIyNzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7422273?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":126,"state":"open","created_at":"2018-10-23T09:37:02Z","updated_at":"2018-11-13T23:12:49Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-10-25T12:52:11Z","updated_at":"2018-11-13T23:13:48Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/7493","html_url":"https://github.com/openssl/openssl/pull/7493","diff_url":"https://github.com/openssl/openssl/pull/7493.diff","patch_url":"https://github.com/openssl/openssl/pull/7493.patch"},"body":"dsa_builtin_paramgen2 never finishes when L <= N.\r\n\r\nLooking at the FIPS 186-2 DSA specification, which it implements:\r\n\r\nStep 3 generates q in the range 2^N-1 and 2^N\r\n\r\nStep 8 derives X from the seed value:\r\n  X = W + 2^L-1\r\n  (here W is smaller than 2^L-1 and hence X lies between 2^L-1 and 2^L)\r\n\r\nStep 9 computes p by rounding X to a number congruent to 1 mod 2q:\r\n  c = X mod 2q\r\n  p = X - (c - 1)\r\n\r\nStep 10\r\n  If p < 2^L-1 then start generating again\r\n\r\nSo for example if in paramgen2 N and L are both equal to 256.\r\nThen X belongs to the interval (2^255, 2^256) as does q.\r\nThis however makes 2q greater than 2^256, consequently also greater than X.\r\n\r\nSo in Step 9, c = X mod 2q yields back the value of X.\r\nAnd p = X - (c - 1) thus sets p to the value of 1.\r\n1 is smaller than  2^255 and the condition in step 10 is never fulfilled.\r\n\r\nWhen L and N are equal, the paramgen2 algorithm loops.\r\nL must be greater than N, eg. L=257, N=256 makes it successfully find the DSA parameters.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openssl/openssl/issues/comments/438474496","html_url":"https://github.com/openssl/openssl/pull/7493#issuecomment-438474496","issue_url":"https://api.github.com/repos/openssl/openssl/issues/7493","id":438474496,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODQ3NDQ5Ng==","user":{"login":"mspncp","id":11467854,"node_id":"MDQ6VXNlcjExNDY3ODU0","avatar_url":"https://avatars2.githubusercontent.com/u/11467854?v=4","gravatar_id":"","url":"https://api.github.com/users/mspncp","html_url":"https://github.com/mspncp","followers_url":"https://api.github.com/users/mspncp/followers","following_url":"https://api.github.com/users/mspncp/following{/other_user}","gists_url":"https://api.github.com/users/mspncp/gists{/gist_id}","starred_url":"https://api.github.com/users/mspncp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mspncp/subscriptions","organizations_url":"https://api.github.com/users/mspncp/orgs","repos_url":"https://api.github.com/users/mspncp/repos","events_url":"https://api.github.com/users/mspncp/events{/privacy}","received_events_url":"https://api.github.com/users/mspncp/received_events","type":"User","site_admin":false},"created_at":"2018-11-13T23:13:48Z","updated_at":"2018-11-13T23:13:48Z","author_association":"CONTRIBUTOR","body":"ping?"}}
{"actor":{"display_login":"mspncp"}}