git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
@ 2020-01-07 10:02 Liam Huang via GitGitGadget
  2020-01-07 10:02 ` [PATCH 1/1] " Liam Huang via GitGitGadget
  2020-01-07 12:19 ` [PATCH 0/1] " Johannes Schindelin
  0 siblings, 2 replies; 10+ messages in thread
From: Liam Huang via GitGitGadget @ 2020-01-07 10:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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

Liam Huang (1):
  Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x

 imap-send.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)


base-commit: 042ed3e048af08014487d19196984347e3be7d1c
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-516%2FLiam0205%2Fpatch-1-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-516/Liam0205/patch-1-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/516
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 10:02 [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x Liam Huang via GitGitGadget
@ 2020-01-07 10:02 ` Liam Huang via GitGitGadget
  2020-01-07 20:19   ` Junio C Hamano
  2020-01-07 12:19 ` [PATCH 0/1] " Johannes Schindelin
  1 sibling, 1 reply; 10+ messages in thread
From: Liam Huang via GitGitGadget @ 2020-01-07 10:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Liam Huang

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.

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>
---
 imap-send.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/imap-send.c b/imap-send.c
index 6c54d8c29d..446fd5532b 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -249,15 +249,28 @@ static int verify_hostname(X509 *cert, const char *hostname)
 	/* try the DNS subjectAltNames */
 	found = 0;
 	if ((subj_alt_names = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL))) {
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+		int num_subj_alt_names = OPENSSL_sk_num(subj_alt_names);
+#else
 		int num_subj_alt_names = sk_GENERAL_NAME_num(subj_alt_names);
+#endif
 		for (i = 0; !found && i < num_subj_alt_names; i++) {
+			
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+			GENERAL_NAME *subj_alt_name = OPENSSL_sk_value(subj_alt_names, i);
+#else
 			GENERAL_NAME *subj_alt_name = sk_GENERAL_NAME_value(subj_alt_names, i);
+#endif
 			if (subj_alt_name->type == GEN_DNS &&
 			    strlen((const char *)subj_alt_name->d.ia5->data) == (size_t)subj_alt_name->d.ia5->length &&
 			    host_matches(hostname, (const char *)(subj_alt_name->d.ia5->data)))
 				found = 1;
 		}
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+		OPENSSL_sk_pop_free(subj_alt_names, GENERAL_NAME_free);
+#else
 		sk_GENERAL_NAME_pop_free(subj_alt_names, GENERAL_NAME_free);
+#endif
 	}
 	if (found)
 		return 0;
@@ -284,12 +297,22 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
 	int ret;
 	X509 *cert;
 
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+        OPENSSL_init_ssl(0, NULL);
+
+	meth = TLS_method();
+#else
 	SSL_library_init();
 	SSL_load_error_strings();
 
 	meth = SSLv23_method();
+#endif
 	if (!meth) {
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+		ssl_socket_perror("TLS_method");
+#else
 		ssl_socket_perror("SSLv23_method");
+#endif
 		return -1;
 	}
 
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 10:02 [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x Liam Huang via GitGitGadget
  2020-01-07 10:02 ` [PATCH 1/1] " Liam Huang via GitGitGadget
@ 2020-01-07 12:19 ` Johannes Schindelin
  2020-01-07 17:01   ` Junio C Hamano
  1 sibling, 1 reply; 10+ messages in thread
From: Johannes Schindelin @ 2020-01-07 12:19 UTC (permalink / raw)
  To: Liam Huang via GitGitGadget, Liam Huang; +Cc: git, Junio C Hamano

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 12:19 ` [PATCH 0/1] " Johannes Schindelin
@ 2020-01-07 17:01   ` Junio C Hamano
  2020-01-07 18:48     ` Johannes Schindelin
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2020-01-07 17:01 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Liam Huang via GitGitGadget, Liam Huang, git

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 17:01   ` Junio C Hamano
@ 2020-01-07 18:48     ` Johannes Schindelin
  2020-01-07 19:57       ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Johannes Schindelin @ 2020-01-07 18:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Liam Huang via GitGitGadget, Liam Huang, git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 18:48     ` Johannes Schindelin
@ 2020-01-07 19:57       ` Junio C Hamano
  2020-01-07 20:15         ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2020-01-07 19:57 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Liam Huang via GitGitGadget, Liam Huang, git

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 19:57       ` Junio C Hamano
@ 2020-01-07 20:15         ` Junio C Hamano
  2020-01-08 10:59           ` Johannes Schindelin
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2020-01-07 20:15 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Liam Huang via GitGitGadget, Liam Huang, git

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 10:02 ` [PATCH 1/1] " Liam Huang via GitGitGadget
@ 2020-01-07 20:19   ` Junio C Hamano
  0 siblings, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2020-01-07 20:19 UTC (permalink / raw)
  To: Liam Huang via GitGitGadget; +Cc: git

"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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-07 20:15         ` Junio C Hamano
@ 2020-01-08 10:59           ` Johannes Schindelin
  2020-01-08 16:09             ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Johannes Schindelin @ 2020-01-08 10:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Liam Huang via GitGitGadget, Liam Huang, git

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x
  2020-01-08 10:59           ` Johannes Schindelin
@ 2020-01-08 16:09             ` Junio C Hamano
  0 siblings, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2020-01-08 16:09 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Liam Huang via GitGitGadget, Liam Huang, git

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-08 16:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 10:02 [PATCH 0/1] Update imap-send.c, fix incompatibilities with OpenSSL 1.1.x Liam Huang via GitGitGadget
2020-01-07 10:02 ` [PATCH 1/1] " Liam Huang via GitGitGadget
2020-01-07 20:19   ` Junio C Hamano
2020-01-07 12:19 ` [PATCH 0/1] " Johannes Schindelin
2020-01-07 17:01   ` Junio C Hamano
2020-01-07 18:48     ` Johannes Schindelin
2020-01-07 19:57       ` Junio C Hamano
2020-01-07 20:15         ` Junio C Hamano
2020-01-08 10:59           ` Johannes Schindelin
2020-01-08 16:09             ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).