GitHub PullRequestEvent at 2014-09-25 15:38:23
Repository: OpenSC
Actor: philipWendland
Payload: {"action":"opened","number":288,"pull_request":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/288","id":21791443,"html_url":"https://github.com/OpenSC/OpenSC/pull/288","diff_url":"https://github.com/OpenSC/OpenSC/pull/288.diff","patch_url":"https://github.com/OpenSC/OpenSC/pull/288.patch","issue_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/288","number":288,"state":"open","locked":false,"title":"add the possibility to store public ECC keys encoded according to SPKI","user":{"login":"philipWendland","id":3743372,"avatar_url":"https://avatars.githubusercontent.com/u/3743372?v=2","gravatar_id":"","url":"https://api.github.com/users/philipWendland","html_url":"https://github.com/philipWendland","followers_url":"https://api.github.com/users/philipWendland/followers","following_url":"https://api.github.com/users/philipWendland/following{/other_user}","gists_url":"https://api.github.com/users/philipWendland/gists{/gist_id}","starred_url":"https://api.github.com/users/philipWendland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipWendland/subscriptions","organizations_url":"https://api.github.com/users/philipWendland/orgs","repos_url":"https://api.github.com/users/philipWendland/repos","events_url":"https://api.github.com/users/philipWendland/events{/privacy}","received_events_url":"https://api.github.com/users/philipWendland/received_events","type":"User","site_admin":false},"body":"When using \"standard means\" to store public ECC keys to the filesystem, the key is encoded as RAW containing only the ecPointQ. This is problematic, because when extracting the key from the EF again (pkcs15-tool --read-public-key), there is no information about the curve.\r\nThe extracted keys (.pem) are unusable because they lack information about the curve.\r\n\r\nThis code path is apparently not used by any card-driver at the moment. However, I discovered this while developing a new Java Card applet with OpenSC read/write support.\r\n\r\nPKCS#15 (section 6.4.3) specifies two possible encodings for EC keys: RAW or SPKI \r\nThe proposed change adds the possibility to specify in the profile which ECC encoding should be used. The default is the RAW encoding as used before - I don't want to mess things up with existing drivers.\r\n\r\n\r\npkcs15-pubkey.c: When reading the key, I use the ASN1 constructed sequence tag (0x30) to identify the SPKI encoding. RAW encoded public keys begin with 0x04. The profile->key_encoding_flags can't be used here, because there is no access to the profile from this function.\r\n\r\nprofile: I decided to use flags rather than a definite value because the key encodings might have to be extended at some point (e.g. for different key types, or: \"ECC-RAW-with-parameters\")\r\n\r\nWith this change and SPKI in the profile of my applet, I can verify ECDSA signatures using OpenSSL with the extracted key.\r\nPlease let me know if I should correct something.","created_at":"2014-09-25T15:38:23Z","updated_at":"2014-09-25T15:38:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/288/commits","review_comments_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/288/comments","review_comment_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/288/comments","statuses_url":"https://api.github.com/repos/OpenSC/OpenSC/statuses/b4cf0f70baa25caced76021250b835df50b8ffee","head":{"label":"philipWendland:upstream-ecc-fix","ref":"upstream-ecc-fix","sha":"b4cf0f70baa25caced76021250b835df50b8ffee","user":{"login":"philipWendland","id":3743372,"avatar_url":"https://avatars.githubusercontent.com/u/3743372?v=2","gravatar_id":"","url":"https://api.github.com/users/philipWendland","html_url":"https://github.com/philipWendland","followers_url":"https://api.github.com/users/philipWendland/followers","following_url":"https://api.github.com/users/philipWendland/following{/other_user}","gists_url":"https://api.github.com/users/philipWendland/gists{/gist_id}","starred_url":"https://api.github.com/users/philipWendland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipWendland/subscriptions","organizations_url":"https://api.github.com/users/philipWendland/orgs","repos_url":"https://api.github.com/users/philipWendland/repos","events_url":"https://api.github.com/users/philipWendland/events{/privacy}","received_events_url":"https://api.github.com/users/philipWendland/received_events","type":"User","site_admin":false},"repo":{"id":23426348,"name":"OpenSC","full_name":"philipWendland/OpenSC","owner":{"login":"philipWendland","id":3743372,"avatar_url":"https://avatars.githubusercontent.com/u/3743372?v=2","gravatar_id":"","url":"https://api.github.com/users/philipWendland","html_url":"https://github.com/philipWendland","followers_url":"https://api.github.com/users/philipWendland/followers","following_url":"https://api.github.com/users/philipWendland/following{/other_user}","gists_url":"https://api.github.com/users/philipWendland/gists{/gist_id}","starred_url":"https://api.github.com/users/philipWendland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipWendland/subscriptions","organizations_url":"https://api.github.com/users/philipWendland/orgs","repos_url":"https://api.github.com/users/philipWendland/repos","events_url":"https://api.github.com/users/philipWendland/events{/privacy}","received_events_url":"https://api.github.com/users/philipWendland/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/philipWendland/OpenSC","description":"Open source smart card tools and middleware. PKCS#11/MiniDriver/Tokend","fork":true,"url":"https://api.github.com/repos/philipWendland/OpenSC","forks_url":"https://api.github.com/repos/philipWendland/OpenSC/forks","keys_url":"https://api.github.com/repos/philipWendland/OpenSC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/philipWendland/OpenSC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/philipWendland/OpenSC/teams","hooks_url":"https://api.github.com/repos/philipWendland/OpenSC/hooks","issue_events_url":"https://api.github.com/repos/philipWendland/OpenSC/issues/events{/number}","events_url":"https://api.github.com/repos/philipWendland/OpenSC/events","assignees_url":"https://api.github.com/repos/philipWendland/OpenSC/assignees{/user}","branches_url":"https://api.github.com/repos/philipWendland/OpenSC/branches{/branch}","tags_url":"https://api.github.com/repos/philipWendland/OpenSC/tags","blobs_url":"https://api.github.com/repos/philipWendland/OpenSC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/philipWendland/OpenSC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/philipWendland/OpenSC/git/refs{/sha}","trees_url":"https://api.github.com/repos/philipWendland/OpenSC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/philipWendland/OpenSC/statuses/{sha}","languages_url":"https://api.github.com/repos/philipWendland/OpenSC/languages","stargazers_url":"https://api.github.com/repos/philipWendland/OpenSC/stargazers","contributors_url":"https://api.github.com/repos/philipWendland/OpenSC/contributors","subscribers_url":"https://api.github.com/repos/philipWendland/OpenSC/subscribers","subscription_url":"https://api.github.com/repos/philipWendland/OpenSC/subscription","commits_url":"https://api.github.com/repos/philipWendland/OpenSC/commits{/sha}","git_commits_url":"https://api.github.com/repos/philipWendland/OpenSC/git/commits{/sha}","comments_url":"https://api.github.com/repos/philipWendland/OpenSC/comments{/number}","issue_comment_url":"https://api.github.com/repos/philipWendland/OpenSC/issues/comments/{number}","contents_url":"https://api.github.com/repos/philipWendland/OpenSC/contents/{+path}","compare_url":"https://api.github.com/repos/philipWendland/OpenSC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/philipWendland/OpenSC/merges","archive_url":"https://api.github.com/repos/philipWendland/OpenSC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/philipWendland/OpenSC/downloads","issues_url":"https://api.github.com/repos/philipWendland/OpenSC/issues{/number}","pulls_url":"https://api.github.com/repos/philipWendland/OpenSC/pulls{/number}","milestones_url":"https://api.github.com/repos/philipWendland/OpenSC/milestones{/number}","notifications_url":"https://api.github.com/repos/philipWendland/OpenSC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/philipWendland/OpenSC/labels{/name}","releases_url":"https://api.github.com/repos/philipWendland/OpenSC/releases{/id}","created_at":"2014-08-28T12:05:08Z","updated_at":"2014-08-28T12:29:36Z","pushed_at":"2014-09-25T15:12:55Z","git_url":"git://github.com/philipWendland/OpenSC.git","ssh_url":"git@github.com:philipWendland/OpenSC.git","clone_url":"https://github.com/philipWendland/OpenSC.git","svn_url":"https://github.com/philipWendland/OpenSC","homepage":"https://github.com/OpenSC/OpenSC/wiki","size":8094,"stargazers_count":0,"watchers_count":0,"language":"C","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":"master"}},"base":{"label":"OpenSC:master","ref":"master","sha":"cb89a870aed943c6b2df2de41d9524ba4ca2e45a","user":{"login":"OpenSC","id":895249,"avatar_url":"https://avatars.githubusercontent.com/u/895249?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenSC","html_url":"https://github.com/OpenSC","followers_url":"https://api.github.com/users/OpenSC/followers","following_url":"https://api.github.com/users/OpenSC/following{/other_user}","gists_url":"https://api.github.com/users/OpenSC/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSC/subscriptions","organizations_url":"https://api.github.com/users/OpenSC/orgs","repos_url":"https://api.github.com/users/OpenSC/repos","events_url":"https://api.github.com/users/OpenSC/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSC/received_events","type":"Organization","site_admin":false},"repo":{"id":1999692,"name":"OpenSC","full_name":"OpenSC/OpenSC","owner":{"login":"OpenSC","id":895249,"avatar_url":"https://avatars.githubusercontent.com/u/895249?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenSC","html_url":"https://github.com/OpenSC","followers_url":"https://api.github.com/users/OpenSC/followers","following_url":"https://api.github.com/users/OpenSC/following{/other_user}","gists_url":"https://api.github.com/users/OpenSC/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSC/subscriptions","organizations_url":"https://api.github.com/users/OpenSC/orgs","repos_url":"https://api.github.com/users/OpenSC/repos","events_url":"https://api.github.com/users/OpenSC/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSC/OpenSC","description":"Open source smart card tools and middleware. PKCS#11/MiniDriver/Tokend","fork":false,"url":"https://api.github.com/repos/OpenSC/OpenSC","forks_url":"https://api.github.com/repos/OpenSC/OpenSC/forks","keys_url":"https://api.github.com/repos/OpenSC/OpenSC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSC/OpenSC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSC/OpenSC/teams","hooks_url":"https://api.github.com/repos/OpenSC/OpenSC/hooks","issue_events_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSC/OpenSC/events","assignees_url":"https://api.github.com/repos/OpenSC/OpenSC/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSC/OpenSC/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSC/OpenSC/tags","blobs_url":"https://api.github.com/repos/OpenSC/OpenSC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSC/OpenSC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSC/OpenSC/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSC/OpenSC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSC/OpenSC/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSC/OpenSC/languages","stargazers_url":"https://api.github.com/repos/OpenSC/OpenSC/stargazers","contributors_url":"https://api.github.com/repos/OpenSC/OpenSC/contributors","subscribers_url":"https://api.github.com/repos/OpenSC/OpenSC/subscribers","subscription_url":"https://api.github.com/repos/OpenSC/OpenSC/subscription","commits_url":"https://api.github.com/repos/OpenSC/OpenSC/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSC/OpenSC/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenSC/OpenSC/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSC/OpenSC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSC/OpenSC/merges","archive_url":"https://api.github.com/repos/OpenSC/OpenSC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSC/OpenSC/downloads","issues_url":"https://api.github.com/repos/OpenSC/OpenSC/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSC/OpenSC/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSC/OpenSC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSC/OpenSC/labels{/name}","releases_url":"https://api.github.com/repos/OpenSC/OpenSC/releases{/id}","created_at":"2011-07-05T09:45:08Z","updated_at":"2014-09-24T23:50:32Z","pushed_at":"2014-09-18T21:32:22Z","git_url":"git://github.com/OpenSC/OpenSC.git","ssh_url":"git@github.com:OpenSC/OpenSC.git","clone_url":"https://github.com/OpenSC/OpenSC.git","svn_url":"https://github.com/OpenSC/OpenSC","homepage":"https://github.com/OpenSC/OpenSC/wiki","size":41523,"stargazers_count":198,"watchers_count":198,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":41,"forks":130,"open_issues":41,"watchers":198,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/288"},"html":{"href":"https://github.com/OpenSC/OpenSC/pull/288"},"issue":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/288"},"comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/288/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/288/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/288/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSC/OpenSC/statuses/b4cf0f70baa25caced76021250b835df50b8ffee"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":45,"deletions":2,"changed_files":6}}