{"thread":{"id":"52577","subject":"[PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","startedAt":"2020-01-07T10:03:02Z","lastAt":"2020-01-08T16:09:40Z","messageCount":10,"participants":["Liam Huang via GitGitGadget","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"389342","messageId":"pull.516.git.1578391376.gitgitgadget@gmail.com","threadId":"52577","inReplyTo":null,"subject":"[PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Liam Huang via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-01-07T10:02:55Z","receivedAt":"2020-01-07T10:03:02Z","isPatch":true,"sender":{"key":"name:Liam Huang","avatar":null},"body":"Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities\nwith OpenSSL 1.1.x.\n\nSee:\n\n * https://www.openssl.org/docs/man1.1.0/man3/SSLv23_method.html\n * https://wiki.openssl.org/index.php/Library_Initialization\n\nLiam Huang (1):\n  Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x\n\n imap-send.c | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)\n\n\nbase-commit: 042ed3e048af08014487d19196984347e3be7d1c\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-516%2FLiam0205%2Fpatch-1-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-516/Liam0205/patch-1-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/516\n-- \ngitgitgadget\n"},{"id":"389343","messageId":"8c96c56a1818b066d4570873e00c52d42399e3c2.1578391376.git.gitgitgadget@gmail.com","threadId":"52577","inReplyTo":"pull.516.git.1578391376.gitgitgadget@gmail.com","subject":"[PATCH 1/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Liam Huang via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-01-07T10:02:56Z","receivedAt":"2020-01-07T10:03:02Z","isPatch":true,"sender":{"key":"name:Liam Huang","avatar":null},"body":"From: Liam Huang <Liam0205@users.noreply.github.com>\n\nSome APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities with OpenSSL 1.1.x.\n\nSee:\n\n* <https://www.openssl.org/docs/man1.1.0/man3/SSLv23_method.html>\n* <https://wiki.openssl.org/index.php/Library_Initialization>\n\nSigned-off-by: Liam Huang <liamhuang0205@gmail.com>\n---\n imap-send.c | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)\n\ndiff --git a/imap-send.c b/imap-send.c\nindex 6c54d8c29d..446fd5532b 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -249,15 +249,28 @@ static int verify_hostname(X509 *cert, const char *hostname)\n \t/* try the DNS subjectAltNames */\n \tfound = 0;\n \tif ((subj_alt_names = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL))) {\n+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n+\t\tint num_subj_alt_names = OPENSSL_sk_num(subj_alt_names);\n+#else\n \t\tint num_subj_alt_names = sk_GENERAL_NAME_num(subj_alt_names);\n+#endif\n \t\tfor (i = 0; !found && i < num_subj_alt_names; i++) {\n+\t\t\t\n+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n+\t\t\tGENERAL_NAME *subj_alt_name = OPENSSL_sk_value(subj_alt_names, i);\n+#else\n \t\t\tGENERAL_NAME *subj_alt_name = sk_GENERAL_NAME_value(subj_alt_names, i);\n+#endif\n \t\t\tif (subj_alt_name->type == GEN_DNS &&\n \t\t\t    strlen((const char *)subj_alt_name->d.ia5->data) == (size_t)subj_alt_name->d.ia5->length &&\n \t\t\t    host_matches(hostname, (const char *)(subj_alt_name->d.ia5->data)))\n \t\t\t\tfound = 1;\n \t\t}\n+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n+\t\tOPENSSL_sk_pop_free(subj_alt_names, GENERAL_NAME_free);\n+#else\n \t\tsk_GENERAL_NAME_pop_free(subj_alt_names, GENERAL_NAME_free);\n+#endif\n \t}\n \tif (found)\n \t\treturn 0;\n@@ -284,12 +297,22 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve\n \tint ret;\n \tX509 *cert;\n \n+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n+        OPENSSL_init_ssl(0, NULL);\n+\n+\tmeth = TLS_method();\n+#else\n \tSSL_library_init();\n \tSSL_load_error_strings();\n \n \tmeth = SSLv23_method();\n+#endif\n \tif (!meth) {\n+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n+\t\tssl_socket_perror(\"TLS_method\");\n+#else\n \t\tssl_socket_perror(\"SSLv23_method\");\n+#endif\n \t\treturn -1;\n \t}\n \n-- \ngitgitgadget\n"},{"id":"389361","messageId":"nycvar.QRO.7.76.6.2001071313580.46@tvgsbejvaqbjf.bet","threadId":"52577","inReplyTo":"pull.516.git.1578391376.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-07T12:19:24Z","receivedAt":"2020-01-07T12:19:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Liam,\n\nOn Tue, 7 Jan 2020, Liam Huang via GitGitGadget wrote:\n\n> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities\n> with OpenSSL 1.1.x.\n\nIn your PR, the \"Checks\" tab shows that this breaks the build for all\nnon-32-bit Linux builds and for Windows. Here is an excerpt of the failed\n`linux-clang` build:\n\n-- snip --\n[...]\nimap-send.c:253:43: error: incompatible pointer types passing 'struct stack_st_GENERAL_NAME *' to parameter of type 'const OPENSSL_STACK *' (aka 'const struct stack_st *') [-Werror,-Wincompatible-pointer-types]\n                int num_subj_alt_names = OPENSSL_sk_num(subj_alt_names);\n                                                        ^~~~~~~~~~~~~~\n/usr/include/openssl/stack.h:23:41: note: passing argument to parameter here\nint OPENSSL_sk_num(const OPENSSL_STACK *);\n                                        ^\nimap-send.c:260:51: error: incompatible pointer types passing 'struct stack_st_GENERAL_NAME *' to parameter of type 'const OPENSSL_STACK *' (aka 'const struct stack_st *') [-Werror,-Wincompatible-pointer-types]\n                        GENERAL_NAME *subj_alt_name = OPENSSL_sk_value(subj_alt_names, i);\n                                                                       ^~~~~~~~~~~~~~\n/usr/include/openssl/stack.h:24:45: note: passing argument to parameter here\nvoid *OPENSSL_sk_value(const OPENSSL_STACK *, int);\n                                            ^\nimap-send.c:270:23: error: incompatible pointer types passing 'struct stack_st_GENERAL_NAME *' to parameter of type 'OPENSSL_STACK *' (aka 'struct stack_st *') [-Werror,-Wincompatible-pointer-types]\n                OPENSSL_sk_pop_free(subj_alt_names, GENERAL_NAME_free);\n                                    ^~~~~~~~~~~~~~\n/usr/include/openssl/stack.h:33:41: note: passing argument to parameter 'st' here\nvoid OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));\n                                        ^\nimap-send.c:270:39: error: incompatible pointer types passing 'void (GENERAL_NAME *)' (aka 'void (struct GENERAL_NAME_st *)') to parameter of type 'void (*)(void *)' [-Werror,-Wincompatible-pointer-types]\n                OPENSSL_sk_pop_free(subj_alt_names, GENERAL_NAME_free);\n                                                    ^~~~~~~~~~~~~~~~~\n/usr/include/openssl/stack.h:33:52: note: passing argument to parameter 'func' here\nvoid OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));\n                                                   ^\n4 errors generated.\nMakefile:2382: recipe for target 'imap-send.o' failed\n-- snap --\n\nFor the full build logs, please have a look at\nhttps://dev.azure.com/gitgitgadget/git/_build/results?buildId=25858&view=logs&j=8f20da19-31b7-5cef-4813-95b8788bd086&t=56027f08-fde3-50ad-0c9a-5ec7df432ed0\n\nCould you fix those compile errors, please?\n\nWhile at it, please also fix your author email: it should match your\n_real_ email address, i.e. \"liamhuang0205@gmail.com\", not\n\"Liam0205@users.noreply.github.com\".\n\nThank you,\nJohannes\n"},{"id":"389397","messageId":"xmqqv9pn5hgl.fsf@gitster-ct.c.googlers.com","threadId":"52577","inReplyTo":"nycvar.QRO.7.76.6.2001071313580.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-07T17:01:14Z","receivedAt":"2020-01-07T17:01:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Liam,\n>\n> On Tue, 7 Jan 2020, Liam Huang via GitGitGadget wrote:\n>\n>> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities\n>> with OpenSSL 1.1.x.\n>\n> In your PR, the \"Checks\" tab shows that this breaks the build for all\n> non-32-bit Linux builds and for Windows. Here is an excerpt of the failed\n> `linux-clang` build:\n> -- snip --\n> ...\n> Could you fix those compile errors, please?\n>\n> While at it, please also fix your author email: it should match your\n> _real_ email address, i.e. \"liamhuang0205@gmail.com\", not\n> \"Liam0205@users.noreply.github.com\".\n\nAlso, please do *not* CC iterations of a patch to me that hasn't\nseen a concensus that it is a good idea on the list yet, unless\nyou know I am the area expert and am interested in seeing it.\n\nThanks.\n"},{"id":"389408","messageId":"nycvar.QRO.7.76.6.2001071944250.46@tvgsbejvaqbjf.bet","threadId":"52577","inReplyTo":"xmqqv9pn5hgl.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-07T18:48:16Z","receivedAt":"2020-01-07T18:48:23Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 7 Jan 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> > Hi Liam,\n> >\n> > On Tue, 7 Jan 2020, Liam Huang via GitGitGadget wrote:\n> >\n> >> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities\n> >> with OpenSSL 1.1.x.\n> >\n> > In your PR, the \"Checks\" tab shows that this breaks the build for all\n> > non-32-bit Linux builds and for Windows. Here is an excerpt of the failed\n> > `linux-clang` build:\n> > -- snip --\n> > ...\n> > Could you fix those compile errors, please?\n> >\n> > While at it, please also fix your author email: it should match your\n> > _real_ email address, i.e. \"liamhuang0205@gmail.com\", not\n> > \"Liam0205@users.noreply.github.com\".\n>\n> Also, please do *not* CC iterations of a patch to me that hasn't\n> seen a concensus that it is a good idea on the list yet, unless\n> you know I am the area expert and am interested in seeing it.\n\nI am afraid that I do not know of any means to teach GitGitGadget to make\nthat call whether it has seen a consensus.\n\nAnd I fear that you are asking me to punt back that decision to\ncontributors, i.e. put a lot of the burden of knowing how Git\ncontributions are expected to progress _away_ from GitGitGadget. It is,\nhowever, the explicit mission of GitGitGadget to _take that responsibility\nof knowing all these things and not err at any step along the way *from*\nthe contributors_.\n\nOf course, I can teach GitGitGadget to not Cc: you. Like, always. Not sure\nthat you would like that any better because you would not even be Cc:ed\nonce consensus was reached. So I'm not sure that I want to put in that\nwork for something you will equally hate in the end.\n\nOr do you have any splendid ideas how this could be made easy on you _and_\non contributors (and for bonus points, _also_ on me)?\n\nCiao,\nDscho\n"},{"id":"389418","messageId":"xmqq7e2359an.fsf@gitster-ct.c.googlers.com","threadId":"52577","inReplyTo":"nycvar.QRO.7.76.6.2001071944250.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-07T19:57:36Z","receivedAt":"2020-01-07T19:57:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I am afraid that I do not know of any means to teach GitGitGadget to make\n> that call whether it has seen a consensus.\n>\n> And I fear that you are asking me to punt back that decision to\n> contributors, i.e. put a lot of the burden of knowing how Git\n> contributions are expected to progress _away_ from GitGitGadget.\n\nYes, and that is why I am giving review comments to contributors to\nteach how the development community works.\n\n> Of course, I can teach GitGitGadget to not Cc: you. Like, always. Not sure\n> that you would like that any better because you would not even be Cc:ed\n> once consensus was reached.\n\nThat would actually be better.  Somebody in the discussion thread\nwould probably say \"This is good enough---send it to the maintainer\"\nwhen the topic is ready.\n"},{"id":"389421","messageId":"xmqqtv573twq.fsf@gitster-ct.c.googlers.com","threadId":"52577","inReplyTo":"xmqq7e2359an.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-07T20:15:17Z","receivedAt":"2020-01-07T20:15:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> Of course, I can teach GitGitGadget to not Cc: you. Like, always. Not sure\n>> that you would like that any better because you would not even be Cc:ed\n>> once consensus was reached.\n>\n> That would actually be better.  Somebody in the discussion thread\n\ns/better/much much &/;\n\n> would probably say \"This is good enough---send it to the maintainer\"\n> when the topic is ready.\n\nBesides, when they send out patches they would also add area experts\nand those who participated in the review of the earlier round to Cc:\nso GGG needs to have a mechanism to allow the end user to do so.  And\nby treating the maintainer merely just one of the reviewer, that\nmechanism can naturally be reused.\n"},{"id":"389422","messageId":"xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com","threadId":"52577","inReplyTo":"8c96c56a1818b066d4570873e00c52d42399e3c2.1578391376.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-07T20:19:15Z","receivedAt":"2020-01-07T20:19:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Liam Huang via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Liam Huang <Liam0205@users.noreply.github.com>\n>\n> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities with OpenSSL 1.1.x.\n\nI wonder if the patch can be made a lot less noisy with something\nalong this line\n\n        #if OPENSSL_VERSION_NUMBER < 0x10100000L\n        #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)\n        #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))\n        #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))\n        #endif\n\nwhich would allow you to reduce many #if/#else/#endif in the actual\ncode.\n\n"},{"id":"389466","messageId":"nycvar.QRO.7.76.6.2001081148300.46@tvgsbejvaqbjf.bet","threadId":"52577","inReplyTo":"xmqqtv573twq.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-08T10:59:46Z","receivedAt":"2020-01-08T10:59:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nI will change GitGitGadget to no longer Cc: you automatically.\n\nPlease register my suspicion that this will make GitGitGadget a lot less\nuseful: the stated mission of GitGitGadget is to make contributing patches\nto the Git project _easier_ so that the contributor can focus on the\nchanges they want to make, rather than on the rather involved process.\n\nI know, you do not find any fault with the current process; it works for\nyou. It just does not work all that well for many other people, myself\nincluded. The sheer amount of mostly unwritten, and not exactly static\nrules contributors are expected to follow are starting to remind me of\nKafka's \"The Trial\".\n\nOn Tue, 7 Jan 2020, Junio C Hamano wrote:\n\n> Besides, when they send out patches they would also add area experts and\n> those who participated in the review of the earlier round to Cc: so GGG\n> needs to have a mechanism to allow the end user to do so.\n\nSo GitGitGadget should now also learn to determine who the current area\nexperts are???\n\nI must have misread your request.\n\n> And by treating the maintainer merely just one of the reviewer, that\n> mechanism can naturally be reused.\n\nWell, I certainly do not treat you as just one of the reviewers, as your\ncomplaints definitely keep me on my tip toes with regards to GitGitGadget.\n\nI do have to remind myself frequently that only two people ever complained\nabout GitGitGadget, literally everybody else who is using GitGitGadget is\nquite happy. So maybe I should listen more to those positive voices.\nActually, now that I wrote it, I think that is the only sane course of\naction here: listen more to positive voices.\n\nCiao,\nDscho\n\n"},{"id":"389482","messageId":"xmqqzhey2amf.fsf@gitster-ct.c.googlers.com","threadId":"52577","inReplyTo":"nycvar.QRO.7.76.6.2001081148300.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-08T16:09:28Z","receivedAt":"2020-01-08T16:09:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I will change GitGitGadget to no longer Cc: you automatically.\n\nThanks.\n\n> Please register my suspicion that this will make GitGitGadget a lot less\n> useful: the stated mission of GitGitGadget is to make contributing patches\n> to the Git project _easier_ so that the contributor can focus on the\n> changes they want to make, rather than on the rather involved process.\n\nI am not sure where that \"a lot\" comes from.  FWIW I do not expect\nmy response rate to change at all [*1*], but perhaps you have\nsomething else, perhaps effect on reviewers other than me, in mind?\n\nIn any case, a large part of focusing on changes they want to make\nis to ask for help from the right people who know the part of the\nsystem they want to touch, and that is ...\n\n>> Besides, when they send out patches they would also add area experts and\n>> those who participated in the review of the earlier round to Cc: so GGG\n>> needs to have a mechanism to allow the end user to do so.\n>\n> So GitGitGadget should now also learn to determine who the current area\n> experts are???\n\n... done by CC'ing the right folks, right?\n\nWhether they run \"shortlog --since=18.months $pathspec\" locally to\nfind them, or GGG does so for them before turning the patch into a\npiece of e-mail and offers \"perhaps some of these people can help\nyou?\", after the contributor decides from whom to ask help, there\nwould be some way for the contributor to tell GGG \"ok I'll ask this\nperson to help by placing the addresss on the CC\", no?  That is what\nI meant by the mention of CC: in the part of my response you quoted.\n\n> I must have misread your request.\n\nNo, it wasn't even a request (unless GGG does not offer any way to\nsay \"I want this to be CC'ed to these folks\", that is).  It was\nmerely \"the contributor must have a way to choose to (or not to) cc\nme (or anybody), I presume\".\n\nThe request part was \"let them do so themselves, instead of always\ncc'ing me, because the latter does not add any bit of useful\ninformation.\"\n\nAfter all, software development is a human interaction process.  I\nwouldn't mind if the automated CC is done to address some 'bot\n(e.g. patch tracker) at all, but it simply is rude to treat other\npeople as a convenient review bot and it is even more so to do so\nblindly and automatically, which is what automated CC added by GGG\nis.  At least, when the contributor chooses to ask a reviewer X,\neven if the choice were wreong and the patch were in an area the\nreviewer X were not familiar with at all, it means something that\nthe contributor decided to ask for help from X by CC'ing.\n\n\n[Footnote]\n\n*1* I do not read patch e-mails out of my mbox and instead read via\nthe nntp interface to lore or public-inbox archive.  The list of\nmessages presented to me to choose which ones to read and respond to\nwould only show me who the author is and what the title is, so \"is\nit CC'ed to me?\" does not affect my response rate at all.\n"}]}