net-libs/c-client: update metadata
Package-Manager: Portage-3.0.30, Repoman-3.0.3 RepoMan-Options: --force
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
--- src/osdep/unix/Makefile~ 2011-06-07 16:04:29.000000000 +0300
|
||||
+++ src/osdep/unix/Makefile 2011-06-07 15:55:31.000000000 +0300
|
||||
--- a/src/osdep/unix/Makefile~ 2011-06-07 16:04:29.000000000 +0300
|
||||
+++ b/src/osdep/unix/Makefile 2011-06-07 15:55:31.000000000 +0300
|
||||
@@ -954,23 +954,24 @@
|
||||
|
||||
# Once-only environment setup
|
||||
|
||||
66
net-libs/c-client/files/c-client-2007f-openssl-1.1.patch
Normal file
66
net-libs/c-client/files/c-client-2007f-openssl-1.1.patch
Normal file
@@ -0,0 +1,66 @@
|
||||
diff -Nru a/src/osdep/unix/ssl_unix.c b/src/osdep/unix/ssl_unix.c
|
||||
--- a/src/osdep/unix/ssl_unix.c 2011-07-23 02:20:10.000000000 +0200
|
||||
+++ b/src/osdep/unix/ssl_unix.c 2018-09-22 09:34:26.492765776 +0200
|
||||
@@ -59,7 +59,7 @@
|
||||
static SSLSTREAM *ssl_start(TCPSTREAM *tstream,char *host,unsigned long flags);
|
||||
static char *ssl_start_work (SSLSTREAM *stream,char *host,unsigned long flags);
|
||||
static int ssl_open_verify (int ok,X509_STORE_CTX *ctx);
|
||||
-static char *ssl_validate_cert (X509 *cert,char *host);
|
||||
+static char *ssl_validate_cert (X509 *cert,char *host, char *cert_subj);
|
||||
static long ssl_compare_hostnames (unsigned char *s,unsigned char *pat);
|
||||
static char *ssl_getline_work (SSLSTREAM *stream,unsigned long *size,
|
||||
long *contd);
|
||||
@@ -210,6 +210,7 @@
|
||||
BIO *bio;
|
||||
X509 *cert;
|
||||
unsigned long sl,tl;
|
||||
+ char cert_subj[250];
|
||||
char *s,*t,*err,tmp[MAILTMPLEN];
|
||||
sslcertificatequery_t scq =
|
||||
(sslcertificatequery_t) mail_parameters (NIL,GET_SSLCERTIFICATEQUERY,NIL);
|
||||
@@ -266,13 +267,17 @@
|
||||
if (SSL_write (stream->con,"",0) < 0)
|
||||
return ssl_last_error ? ssl_last_error : "SSL negotiation failed";
|
||||
/* need to validate host names? */
|
||||
- if (!(flags & NET_NOVALIDATECERT) &&
|
||||
- (err = ssl_validate_cert (cert = SSL_get_peer_certificate (stream->con),
|
||||
- host))) {
|
||||
- /* application callback */
|
||||
- if (scq) return (*scq) (err,host,cert ? cert->name : "???") ? NIL : "";
|
||||
- /* error message to return via mm_log() */
|
||||
- sprintf (tmp,"*%.128s: %.255s",err,cert ? cert->name : "???");
|
||||
+ if (!(flags & NET_NOVALIDATECERT)) {
|
||||
+ cert_subj[0] = '\0';
|
||||
+ cert = SSL_get_peer_certificate(stream->con);
|
||||
+ if (cert)
|
||||
+ X509_NAME_oneline(X509_get_subject_name(cert), cert_subj, sizeof(cert_subj));
|
||||
+ err = ssl_validate_cert (cert, host, cert_subj);
|
||||
+ if (err)
|
||||
+ /* application callback */
|
||||
+ if (scq) return (*scq) (err,host,cert ? cert_subj : "???") ? NIL : "";
|
||||
+ /* error message to return via mm_log() */
|
||||
+ sprintf (tmp,"*%.128s: %.255s",err,cert ? cert_subj : "???");
|
||||
return ssl_last_error = cpystr (tmp);
|
||||
}
|
||||
return NIL;
|
||||
@@ -313,7 +318,7 @@
|
||||
* Returns: NIL if validated, else string of error message
|
||||
*/
|
||||
|
||||
-static char *ssl_validate_cert (X509 *cert,char *host)
|
||||
+static char *ssl_validate_cert (X509 *cert,char *host, char *cert_subj)
|
||||
{
|
||||
int i,n;
|
||||
char *s,*t,*ret;
|
||||
@@ -322,9 +327,9 @@
|
||||
/* make sure have a certificate */
|
||||
if (!cert) ret = "No certificate from server";
|
||||
/* and that it has a name */
|
||||
- else if (!cert->name) ret = "No name in certificate";
|
||||
+ else if (cert_subj[0] == '\0') ret = "No name in certificate";
|
||||
/* locate CN */
|
||||
- else if (s = strstr (cert->name,"/CN=")) {
|
||||
+ else if (s = strstr (cert_subj,"/CN=")) {
|
||||
if (t = strchr (s += 4,'/')) *t = '\0';
|
||||
/* host name matches pattern? */
|
||||
ret = ssl_compare_hostnames (host,s) ? NIL :
|
||||
@@ -1,6 +1,6 @@
|
||||
diff -cr alpine-2.00.orig/imap/src/c-client/mail.h alpine-2.00.new/imap/src/c-client/mail.h
|
||||
*** src/c-client/mail.h 2008-08-08 18:34:22.000000000 +0100
|
||||
--- src/c-client/mail.h 2009-05-01 13:40:37.000000000 +0100
|
||||
*** a/src/c-client/mail.h 2008-08-08 18:34:22.000000000 +0100
|
||||
--- b/src/c-client/mail.h 2009-05-01 13:40:37.000000000 +0100
|
||||
***************
|
||||
*** 775,780 ****
|
||||
--- 775,781 ----
|
||||
@@ -12,8 +12,8 @@ diff -cr alpine-2.00.orig/imap/src/c-client/mail.h alpine-2.00.new/imap/src/c-cl
|
||||
};
|
||||
|
||||
diff -cr alpine-2.00.orig/imap/src/c-client/mail.c alpine-2.00.new/imap/src/c-client/mail.c
|
||||
*** src/c-client/mail.c 2008-06-04 19:39:54.000000000 +0100
|
||||
--- src/c-client/mail.c 2009-04-30 22:34:13.000000000 +0100
|
||||
*** a/src/c-client/mail.c 2008-06-04 19:39:54.000000000 +0100
|
||||
--- b/src/c-client/mail.c 2009-04-30 22:34:13.000000000 +0100
|
||||
***************
|
||||
*** 2712,2717 ****
|
||||
--- 2712,2719 ----
|
||||
|
||||
Reference in New Issue
Block a user