Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x #516

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Liam0205
Copy link

@Liam0205 Liam0205 commented Jan 7, 2020

Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities with OpenSSL 1.1.x.

See:

Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.

Please read the "guidelines for contributing" linked above!

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

Welcome to GitGitGadget

Hi @Liam0205, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests.

Please make sure that your Pull Request has a good description, as it will be used as cover letter.

Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:

  • the lines should not exceed 76 columns,
  • the first line should be like a header and typically start with a prefix like "tests:" or "commit:", and
  • the commit messages' body should be describing the "why?" of the change.
  • Finally, the commit messages should end in a Signed-off-by: line matching the commits' author.

It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code.

Contributing the patches

Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form /allow. A good way to find other contributors is to locate recent pull requests where someone has been /allowed:

Both the person who commented /allow and the PR author are able to /allow you.

An alternative is the channel #git-devel on the FreeNode IRC network:

<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345
<veteran> newcontributor: it is done
<newcontributor> thanks!

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment /submit.

If you want to see what email(s) would be sent for a /submit request, add a PR comment /preview to have the email(s) sent to you. You must have a public GitHub email address for this.

After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail).

If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the (raw) link), then import it into your mail program. If you use GMail, you can do this via:

curl -g --user "<EMailAddress>:<Password>" \
    --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):

Changes since v1:
- Fixed a typo in the commit message (found by ...)
- Added a code comment to ... as suggested by ...
...

To send a new iteration, just add another PR comment with the contents: /submit.

Need help?

New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join.

You may also be able to find help in real time in the developer IRC channel, #git-devel on Freenode. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of #git-devel is archived, though.

Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities with OpenSSL 1.1.x.

See:

* <https://www.openssl.org/docs/man1.1.0/man3/SSLv23_method.html>
* <https://wiki.openssl.org/index.php/Library_Initialization>

Signed-off-by: Liam Huang <liamhuang0205@gmail.com>
@HebaWaly
Copy link

HebaWaly commented Jan 7, 2020

/allow

@Liam0205
Copy link
Author

Liam0205 commented Jan 7, 2020

Thanks @HebaWaly .

@Liam0205
Copy link
Author

Liam0205 commented Jan 7, 2020

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

User Liam0205 is now allowed to use GitGitGadget.

WARNING: Liam0205 has no public email address set on GitHub

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

Submitted as pull.516.git.1578391376.gitgitgadget@gmail.com

WARNING: Liam0205 has no public email address set on GitHub

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

On the Git mailing list, Johannes Schindelin wrote (reply to this):

Hi Liam,

On Tue, 7 Jan 2020, Liam Huang via GitGitGadget wrote:

> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities
> with OpenSSL 1.1.x.

In your PR, the "Checks" tab shows that this breaks the build for all
non-32-bit Linux builds and for Windows. Here is an excerpt of the failed
`linux-clang` build:

-- snip --
[...]
imap-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]
                int num_subj_alt_names = OPENSSL_sk_num(subj_alt_names);
                                                        ^~~~~~~~~~~~~~
/usr/include/openssl/stack.h:23:41: note: passing argument to parameter here
int OPENSSL_sk_num(const OPENSSL_STACK *);
                                        ^
imap-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]
                        GENERAL_NAME *subj_alt_name = OPENSSL_sk_value(subj_alt_names, i);
                                                                       ^~~~~~~~~~~~~~
/usr/include/openssl/stack.h:24:45: note: passing argument to parameter here
void *OPENSSL_sk_value(const OPENSSL_STACK *, int);
                                            ^
imap-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]
                OPENSSL_sk_pop_free(subj_alt_names, GENERAL_NAME_free);
                                    ^~~~~~~~~~~~~~
/usr/include/openssl/stack.h:33:41: note: passing argument to parameter 'st' here
void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));
                                        ^
imap-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]
                OPENSSL_sk_pop_free(subj_alt_names, GENERAL_NAME_free);
                                                    ^~~~~~~~~~~~~~~~~
/usr/include/openssl/stack.h:33:52: note: passing argument to parameter 'func' here
void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));
                                                   ^
4 errors generated.
Makefile:2382: recipe for target 'imap-send.o' failed
-- snap --

For the full build logs, please have a look at
https://dev.azure.com/gitgitgadget/git/_build/results?buildId=25858&view=logs&j=8f20da19-31b7-5cef-4813-95b8788bd086&t=56027f08-fde3-50ad-0c9a-5ec7df432ed0

Could you fix those compile errors, please?

While at it, please also fix your author email: it should match your
_real_ email address, i.e. "liamhuang0205@gmail.com", not
"Liam0205@users.noreply.github.com".

Thank you,
Johannes

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

On the Git mailing list, Junio C Hamano wrote (reply to this):

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Liam,
>
> On Tue, 7 Jan 2020, Liam Huang via GitGitGadget wrote:
>
>> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities
>> with OpenSSL 1.1.x.
>
> In your PR, the "Checks" tab shows that this breaks the build for all
> non-32-bit Linux builds and for Windows. Here is an excerpt of the failed
> `linux-clang` build:
> -- snip --
> ...
> Could you fix those compile errors, please?
>
> While at it, please also fix your author email: it should match your
> _real_ email address, i.e. "liamhuang0205@gmail.com", not
> "Liam0205@users.noreply.github.com".

Also, please do *not* CC iterations of a patch to me that hasn't
seen a concensus that it is a good idea on the list yet, unless
you know I am the area expert and am interested in seeing it.

Thanks.

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

On the Git mailing list, Johannes Schindelin wrote (reply to this):

Hi Junio,

On Tue, 7 Jan 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Hi Liam,
> >
> > On Tue, 7 Jan 2020, Liam Huang via GitGitGadget wrote:
> >
> >> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities
> >> with OpenSSL 1.1.x.
> >
> > In your PR, the "Checks" tab shows that this breaks the build for all
> > non-32-bit Linux builds and for Windows. Here is an excerpt of the failed
> > `linux-clang` build:
> > -- snip --
> > ...
> > Could you fix those compile errors, please?
> >
> > While at it, please also fix your author email: it should match your
> > _real_ email address, i.e. "liamhuang0205@gmail.com", not
> > "Liam0205@users.noreply.github.com".
>
> Also, please do *not* CC iterations of a patch to me that hasn't
> seen a concensus that it is a good idea on the list yet, unless
> you know I am the area expert and am interested in seeing it.

I am afraid that I do not know of any means to teach GitGitGadget to make
that call whether it has seen a consensus.

And I fear that you are asking me to punt back that decision to
contributors, i.e. put a lot of the burden of knowing how Git
contributions are expected to progress _away_ from GitGitGadget. It is,
however, the explicit mission of GitGitGadget to _take that responsibility
of knowing all these things and not err at any step along the way *from*
the contributors_.

Of course, I can teach GitGitGadget to not Cc: you. Like, always. Not sure
that you would like that any better because you would not even be Cc:ed
once consensus was reached. So I'm not sure that I want to put in that
work for something you will equally hate in the end.

Or do you have any splendid ideas how this could be made easy on you _and_
on contributors (and for bonus points, _also_ on me)?

Ciao,
Dscho

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

On the Git mailing list, Junio C Hamano wrote (reply to this):

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> I am afraid that I do not know of any means to teach GitGitGadget to make
> that call whether it has seen a consensus.
>
> And I fear that you are asking me to punt back that decision to
> contributors, i.e. put a lot of the burden of knowing how Git
> contributions are expected to progress _away_ from GitGitGadget.

Yes, and that is why I am giving review comments to contributors to
teach how the development community works.

> Of course, I can teach GitGitGadget to not Cc: you. Like, always. Not sure
> that you would like that any better because you would not even be Cc:ed
> once consensus was reached.

That would actually be better.  Somebody in the discussion thread
would probably say "This is good enough---send it to the maintainer"
when the topic is ready.

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 7, 2020

On the Git mailing list, Junio C Hamano wrote (reply to this):

Junio C Hamano <gitster@pobox.com> writes:

>> Of course, I can teach GitGitGadget to not Cc: you. Like, always. Not sure
>> that you would like that any better because you would not even be Cc:ed
>> once consensus was reached.
>
> That would actually be better.  Somebody in the discussion thread

s/better/much much &/;

> would probably say "This is good enough---send it to the maintainer"
> when the topic is ready.

Besides, when they send out patches they would also add area experts
and those who participated in the review of the earlier round to Cc:
so GGG needs to have a mechanism to allow the end user to do so.  And
by treating the maintainer merely just one of the reviewer, that
mechanism can naturally be reused.

@@ -249,15 +249,28 @@ static int verify_hostname(X509 *cert, const char *hostname)
/* try the DNS subjectAltNames */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Junio C Hamano wrote (reply to this):

"Liam Huang via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Liam Huang <Liam0205@users.noreply.github.com>
>
> Some APIs have been changed since OpenSSL 1.1.0, so fix incompatibilities with OpenSSL 1.1.x.

I wonder if the patch can be made a lot less noisy with something
along this line

        #if OPENSSL_VERSION_NUMBER < 0x10100000L
        #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)
        #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))
        #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))
        #endif

which would allow you to reduce many #if/#else/#endif in the actual
code.

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 8, 2020

On the Git mailing list, Johannes Schindelin wrote (reply to this):

Hi Junio,

I will change GitGitGadget to no longer Cc: you automatically.

Please register my suspicion that this will make GitGitGadget a lot less
useful: the stated mission of GitGitGadget is to make contributing patches
to the Git project _easier_ so that the contributor can focus on the
changes they want to make, rather than on the rather involved process.

I know, you do not find any fault with the current process; it works for
you. It just does not work all that well for many other people, myself
included. The sheer amount of mostly unwritten, and not exactly static
rules contributors are expected to follow are starting to remind me of
Kafka's "The Trial".

On Tue, 7 Jan 2020, Junio C Hamano wrote:

> Besides, when they send out patches they would also add area experts and
> those who participated in the review of the earlier round to Cc: so GGG
> needs to have a mechanism to allow the end user to do so.

So GitGitGadget should now also learn to determine who the current area
experts are???

I must have misread your request.

> And by treating the maintainer merely just one of the reviewer, that
> mechanism can naturally be reused.

Well, I certainly do not treat you as just one of the reviewers, as your
complaints definitely keep me on my tip toes with regards to GitGitGadget.

I do have to remind myself frequently that only two people ever complained
about GitGitGadget, literally everybody else who is using GitGitGadget is
quite happy. So maybe I should listen more to those positive voices.
Actually, now that I wrote it, I think that is the only sane course of
action here: listen more to positive voices.

Ciao,
Dscho

@gitgitgadget
Copy link

gitgitgadget bot commented Jan 8, 2020

On the Git mailing list, Junio C Hamano wrote (reply to this):

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> I will change GitGitGadget to no longer Cc: you automatically.

Thanks.

> Please register my suspicion that this will make GitGitGadget a lot less
> useful: the stated mission of GitGitGadget is to make contributing patches
> to the Git project _easier_ so that the contributor can focus on the
> changes they want to make, rather than on the rather involved process.

I am not sure where that "a lot" comes from.  FWIW I do not expect
my response rate to change at all [*1*], but perhaps you have
something else, perhaps effect on reviewers other than me, in mind?

In any case, a large part of focusing on changes they want to make
is to ask for help from the right people who know the part of the
system they want to touch, and that is ...

>> Besides, when they send out patches they would also add area experts and
>> those who participated in the review of the earlier round to Cc: so GGG
>> needs to have a mechanism to allow the end user to do so.
>
> So GitGitGadget should now also learn to determine who the current area
> experts are???

... done by CC'ing the right folks, right?

Whether they run "shortlog --since=18.months $pathspec" locally to
find them, or GGG does so for them before turning the patch into a
piece of e-mail and offers "perhaps some of these people can help
you?", after the contributor decides from whom to ask help, there
would be some way for the contributor to tell GGG "ok I'll ask this
person to help by placing the addresss on the CC", no?  That is what
I meant by the mention of CC: in the part of my response you quoted.

> I must have misread your request.

No, it wasn't even a request (unless GGG does not offer any way to
say "I want this to be CC'ed to these folks", that is).  It was
merely "the contributor must have a way to choose to (or not to) cc
me (or anybody), I presume".

The request part was "let them do so themselves, instead of always
cc'ing me, because the latter does not add any bit of useful
information."

After all, software development is a human interaction process.  I
wouldn't mind if the automated CC is done to address some 'bot
(e.g. patch tracker) at all, but it simply is rude to treat other
people as a convenient review bot and it is even more so to do so
blindly and automatically, which is what automated CC added by GGG
is.  At least, when the contributor chooses to ask a reviewer X,
even if the choice were wreong and the patch were in an area the
reviewer X were not familiar with at all, it means something that
the contributor decided to ask for help from X by CC'ing.


[Footnote]

*1* I do not read patch e-mails out of my mbox and instead read via
the nntp interface to lore or public-inbox archive.  The list of
messages presented to me to choose which ones to read and respond to
would only show me who the author is and what the title is, so "is
it CC'ed to me?" does not affect my response rate at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants