{"action":"created","comment":{"url":"https://api.github.com/repos/openssl/openssl/pulls/comments/243851341","pull_request_review_id":187723082,"id":243851341,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mzg1MTM0MQ==","diff_hunk":"@@ -0,0 +1,268 @@\n+/*\n+ * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License 2.0 (the \"License\").  You may not use\n+ * this file except in compliance with the License.  You can obtain a copy\n+ * in the file LICENSE in the source distribution or at\n+ * https://www.openssl.org/source/license.html\n+ */\n+\n+#include <string.h>\n+#include <openssl/x509v3.h>\n+#include <openssl/err.h>\n+#include <openssl/ess.h>\n+#include \"internal/ess_int.h\"\n+\n+static ESS_CERT_ID *ESS_CERT_ID_new_init(X509 *cert, int issuer_needed);\n+static ESS_CERT_ID_V2 *ESS_CERT_ID_V2_new_init(const EVP_MD *hash_alg,\n+                                        X509 *cert, int issuer_needed);\n+\n+ESS_SIGNING_CERT *ESS_SIGNING_CERT_new_init(X509 *signcert,\n+                                            STACK_OF(X509) *certs,\n+                                            int issuer_needed)\n+{\n+    ESS_CERT_ID *cid;\n+    ESS_SIGNING_CERT *sc = NULL;\n+    int i;\n+\n+    if ((sc = ESS_SIGNING_CERT_new()) == NULL)\n+        goto err;\n+    if (sc->cert_ids == NULL\n+        && (sc->cert_ids = sk_ESS_CERT_ID_new_null()) == NULL)\n+        goto err;\n+\n+    if ((cid = ESS_CERT_ID_new_init(signcert, issuer_needed)) == NULL\n+        || !sk_ESS_CERT_ID_push(sc->cert_ids, cid))\n+        goto err;\n+    for (i = 0; i < sk_X509_num(certs); ++i) {\n+        X509 *cert = sk_X509_value(certs, i);\n+        if ((cid = ESS_CERT_ID_new_init(cert, 1)) == NULL\n+            || !sk_ESS_CERT_ID_push(sc->cert_ids, cid))","path":"crypto/ess/ess_lib.c","position":40,"original_position":40,"commit_id":"50f6f5d22c4271b2340350e593b5da681c6d678b","original_commit_id":"50f6f5d22c4271b2340350e593b5da681c6d678b","user":{"login":"FdaSilvaYY","id":15791524,"node_id":"MDQ6VXNlcjE1NzkxNTI0","avatar_url":"https://avatars1.githubusercontent.com/u/15791524?v=4","gravatar_id":"","url":"https://api.github.com/users/FdaSilvaYY","html_url":"https://github.com/FdaSilvaYY","followers_url":"https://api.github.com/users/FdaSilvaYY/followers","following_url":"https://api.github.com/users/FdaSilvaYY/following{/other_user}","gists_url":"https://api.github.com/users/FdaSilvaYY/gists{/gist_id}","starred_url":"https://api.github.com/users/FdaSilvaYY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FdaSilvaYY/subscriptions","organizations_url":"https://api.github.com/users/FdaSilvaYY/orgs","repos_url":"https://api.github.com/users/FdaSilvaYY/repos","events_url":"https://api.github.com/users/FdaSilvaYY/events{/privacy}","received_events_url":"https://api.github.com/users/FdaSilvaYY/received_events","type":"User","site_admin":false},"body":"When any sk_ESS_CERT_ID_push call fails, you should free the pointed item, i:e:  `cid` pointer here.","created_at":"2018-12-24T18:23:22Z","updated_at":"2018-12-24T18:53:24Z","html_url":"https://github.com/openssl/openssl/pull/7893#discussion_r243851341","pull_request_url":"https://api.github.com/repos/openssl/openssl/pulls/7893","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments/243851341"},"html":{"href":"https://github.com/openssl/openssl/pull/7893#discussion_r243851341"},"pull_request":{"href":"https://api.github.com/repos/openssl/openssl/pulls/7893"}}},"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/7893","id":238495521,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4NDk1NTIx","html_url":"https://github.com/openssl/openssl/pull/7893","diff_url":"https://github.com/openssl/openssl/pull/7893.diff","patch_url":"https://github.com/openssl/openssl/pull/7893.patch","issue_url":"https://api.github.com/repos/openssl/openssl/issues/7893","number":7893,"state":"open","locked":false,"title":"Add support for CAdES Basic Electronic Signatures (CAdES-BES)","user":{"login":"opensignature","id":7429613,"node_id":"MDQ6VXNlcjc0Mjk2MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/7429613?v=4","gravatar_id":"","url":"https://api.github.com/users/opensignature","html_url":"https://github.com/opensignature","followers_url":"https://api.github.com/users/opensignature/followers","following_url":"https://api.github.com/users/opensignature/following{/other_user}","gists_url":"https://api.github.com/users/opensignature/gists{/gist_id}","starred_url":"https://api.github.com/users/opensignature/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensignature/subscriptions","organizations_url":"https://api.github.com/users/opensignature/orgs","repos_url":"https://api.github.com/users/opensignature/repos","events_url":"https://api.github.com/users/opensignature/events{/privacy}","received_events_url":"https://api.github.com/users/opensignature/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for your pull request. Please review these requirements:\r\n\r\nContributors guide: https://github.com/openssl/openssl/blob/master/CONTRIBUTING\r\n\r\nOther than that, provide a description above this comment if there isn't one already\r\n\r\nIf this fixes a github issue, make sure to have a line saying 'Fixes #XXXX' (without quotes) in the commit message.\r\n-->\r\nA CAdES Basic Electronic Signature (CAdES-BES) contains, among other\r\nspecifications, a collection of  Signing Certificate reference attributes,\r\nstored in the signedData ether as ESS signing-certificate or as\r\nESS signing-certificate-v2. These are described in detail in Section 5.7.2\r\nof RFC 5126 - CMS Advanced Electronic Signatures (CAdES).\r\n\r\nThis patch adds support for adding  ESS signing-certificate[-v2] attributes\r\nto CMS signedData. Although it implements only a small part of the RFC, it\r\nis sufficient many cases to enable the `openssl cms` app to create signatures\r\nwhich comply with legal requirements of some European States (e.g Italy).\r\n\r\n(migrated from #7611)\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n- [ ] documentation is added or updated\r\n- [ ] tests are added or updated\r\n","created_at":"2018-12-13T18:56:04Z","updated_at":"2018-12-24T18:53:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f6a95f380521dcae966d6da11abfe6c17ca9608","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openssl/openssl/pulls/7893/commits","review_comments_url":"https://api.github.com/repos/openssl/openssl/pulls/7893/comments","review_comment_url":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/7893/comments","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/50f6f5d22c4271b2340350e593b5da681c6d678b","head":{"label":"opensignature:add-cades","ref":"add-cades","sha":"50f6f5d22c4271b2340350e593b5da681c6d678b","user":{"login":"opensignature","id":7429613,"node_id":"MDQ6VXNlcjc0Mjk2MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/7429613?v=4","gravatar_id":"","url":"https://api.github.com/users/opensignature","html_url":"https://github.com/opensignature","followers_url":"https://api.github.com/users/opensignature/followers","following_url":"https://api.github.com/users/opensignature/following{/other_user}","gists_url":"https://api.github.com/users/opensignature/gists{/gist_id}","starred_url":"https://api.github.com/users/opensignature/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensignature/subscriptions","organizations_url":"https://api.github.com/users/opensignature/orgs","repos_url":"https://api.github.com/users/opensignature/repos","events_url":"https://api.github.com/users/opensignature/events{/privacy}","received_events_url":"https://api.github.com/users/opensignature/received_events","type":"User","site_admin":false},"repo":{"id":157007622,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcwMDc2MjI=","name":"openssl","full_name":"opensignature/openssl","private":false,"owner":{"login":"opensignature","id":7429613,"node_id":"MDQ6VXNlcjc0Mjk2MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/7429613?v=4","gravatar_id":"","url":"https://api.github.com/users/opensignature","html_url":"https://github.com/opensignature","followers_url":"https://api.github.com/users/opensignature/followers","following_url":"https://api.github.com/users/opensignature/following{/other_user}","gists_url":"https://api.github.com/users/opensignature/gists{/gist_id}","starred_url":"https://api.github.com/users/opensignature/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensignature/subscriptions","organizations_url":"https://api.github.com/users/opensignature/orgs","repos_url":"https://api.github.com/users/opensignature/repos","events_url":"https://api.github.com/users/opensignature/events{/privacy}","received_events_url":"https://api.github.com/users/opensignature/received_events","type":"User","site_admin":false},"html_url":"https://github.com/opensignature/openssl","description":"TLS/SSL and crypto library","fork":true,"url":"https://api.github.com/repos/opensignature/openssl","forks_url":"https://api.github.com/repos/opensignature/openssl/forks","keys_url":"https://api.github.com/repos/opensignature/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opensignature/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opensignature/openssl/teams","hooks_url":"https://api.github.com/repos/opensignature/openssl/hooks","issue_events_url":"https://api.github.com/repos/opensignature/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/opensignature/openssl/events","assignees_url":"https://api.github.com/repos/opensignature/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/opensignature/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/opensignature/openssl/tags","blobs_url":"https://api.github.com/repos/opensignature/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opensignature/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opensignature/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/opensignature/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opensignature/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/opensignature/openssl/languages","stargazers_url":"https://api.github.com/repos/opensignature/openssl/stargazers","contributors_url":"https://api.github.com/repos/opensignature/openssl/contributors","subscribers_url":"https://api.github.com/repos/opensignature/openssl/subscribers","subscription_url":"https://api.github.com/repos/opensignature/openssl/subscription","commits_url":"https://api.github.com/repos/opensignature/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/opensignature/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/opensignature/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/opensignature/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/opensignature/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/opensignature/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opensignature/openssl/merges","archive_url":"https://api.github.com/repos/opensignature/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opensignature/openssl/downloads","issues_url":"https://api.github.com/repos/opensignature/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/opensignature/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/opensignature/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/opensignature/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opensignature/openssl/labels{/name}","releases_url":"https://api.github.com/repos/opensignature/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/opensignature/openssl/deployments","created_at":"2018-11-10T18:05:33Z","updated_at":"2018-12-14T10:34:18Z","pushed_at":"2018-12-22T15:03:11Z","git_url":"git://github.com/opensignature/openssl.git","ssh_url":"git@github.com:opensignature/openssl.git","clone_url":"https://github.com/opensignature/openssl.git","svn_url":"https://github.com/opensignature/openssl","homepage":"https://www.openssl.org","size":162598,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openssl:master","ref":"master","sha":"9a3b5b766421b7ed9df859956d44fcbe52c2dd82","user":{"login":"openssl","id":3279138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNzkxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"repo":{"id":7634677,"node_id":"MDEwOlJlcG9zaXRvcnk3NjM0Njc3","name":"openssl","full_name":"openssl/openssl","private":false,"owner":{"login":"openssl","id":3279138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNzkxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openssl/openssl","description":"TLS/SSL and crypto library","fork":false,"url":"https://api.github.com/repos/openssl/openssl","forks_url":"https://api.github.com/repos/openssl/openssl/forks","keys_url":"https://api.github.com/repos/openssl/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openssl/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openssl/openssl/teams","hooks_url":"https://api.github.com/repos/openssl/openssl/hooks","issue_events_url":"https://api.github.com/repos/openssl/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/openssl/openssl/events","assignees_url":"https://api.github.com/repos/openssl/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/openssl/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/openssl/openssl/tags","blobs_url":"https://api.github.com/repos/openssl/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openssl/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openssl/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/openssl/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/openssl/openssl/languages","stargazers_url":"https://api.github.com/repos/openssl/openssl/stargazers","contributors_url":"https://api.github.com/repos/openssl/openssl/contributors","subscribers_url":"https://api.github.com/repos/openssl/openssl/subscribers","subscription_url":"https://api.github.com/repos/openssl/openssl/subscription","commits_url":"https://api.github.com/repos/openssl/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/openssl/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/openssl/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/openssl/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/openssl/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/openssl/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openssl/openssl/merges","archive_url":"https://api.github.com/repos/openssl/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openssl/openssl/downloads","issues_url":"https://api.github.com/repos/openssl/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/openssl/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/openssl/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/openssl/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openssl/openssl/labels{/name}","releases_url":"https://api.github.com/repos/openssl/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/openssl/openssl/deployments","created_at":"2013-01-15T22:34:48Z","updated_at":"2018-12-24T18:22:59Z","pushed_at":"2018-12-24T17:34:11Z","git_url":"git://github.com/openssl/openssl.git","ssh_url":"git@github.com:openssl/openssl.git","clone_url":"https://github.com/openssl/openssl.git","svn_url":"https://github.com/openssl/openssl","homepage":"https://www.openssl.org","size":163562,"stargazers_count":8996,"watchers_count":8996,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4099,"mirror_url":null,"archived":false,"open_issues_count":627,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4099,"open_issues":627,"watchers":8996,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/7893"},"html":{"href":"https://github.com/openssl/openssl/pull/7893"},"issue":{"href":"https://api.github.com/repos/openssl/openssl/issues/7893"},"comments":{"href":"https://api.github.com/repos/openssl/openssl/issues/7893/comments"},"review_comments":{"href":"https://api.github.com/repos/openssl/openssl/pulls/7893/comments"},"review_comment":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openssl/openssl/pulls/7893/commits"},"statuses":{"href":"https://api.github.com/repos/openssl/openssl/statuses/50f6f5d22c4271b2340350e593b5da681c6d678b"}},"author_association":"NONE"}}
{"actor":{"display_login":"FdaSilvaYY"}}