Re: [PATCH v14 05/10] imap-send: gracefully fail if CRAM-MD5 authentication is requested without OpenSSL
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 7, 2025, 15:32 UTC
- Message-ID
- <xmqqy0u3zhxl.fsf@gitster.g>
- In-Reply-To
- <PN3PR01MB959732DB7232FFE1ED7D38F3B86EA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
Aditya Garg <gargaditya08@live.com> writes:
Show 12 quoted lines
> Unlike PLAIN, XOAUTH2 and OAUTHBEARER, CRAM-MD5 authentication is not > supported by libcurl and requires OpenSSL. If the user tries to use > CRAM-MD5 authentication without OpenSSL, the previous behaviour was to > attempt to authenticate and fail with a die(error). Handle this in a > better way by first checking if OpenSSL is available and then attempting > to authenticate. If OpenSSL is not available, print an error message and > exit gracefully. > > Signed-off-by: Aditya Garg <gargaditya08@live.com> > --- > imap-send.c | 61 ++++++++++++++++++----------------------------------- > 1 file changed, 20 insertions(+), 41 deletions(-)
This is a good thing to do, but I would have expected that it would come a lot earlier in the series, perhaps immediately after 01/10 fixes the copy-and-paste bug. If this is moved earlier in the series, it would need to introduce the try_auth_method() helper at the same time. Since there is no new authentication methods introduced at that stage in the series yet, it would be quite straight-forward to read and understand the patch, and on top of such a solidified ground, the series can add OAuth2.0 and PLAIN support on top.
Thanks.