|
| 1 | +From 68d42105d78838d0ab155296b69fcb99d28d22c2 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Rudi Heitbaum <rudi@heitbaum.com> |
| 3 | +Date: Sat, 21 Mar 2026 03:56:46 +0000 |
| 4 | +Subject: [PATCH] allow build with OpenSSL 4.x |
| 5 | + |
| 6 | +--- |
| 7 | + src/lftp_ssl.cc | 12 ++++++------ |
| 8 | + 1 file changed, 6 insertions(+), 6 deletions(-) |
| 9 | + |
| 10 | +diff --git a/src/lftp_ssl.cc b/src/lftp_ssl.cc |
| 11 | +index f53edf24..49328f74 100644 |
| 12 | +--- a/src/lftp_ssl.cc |
| 13 | ++++ b/src/lftp_ssl.cc |
| 14 | +@@ -1022,8 +1022,8 @@ const char *lftp_ssl_openssl::strerror() |
| 15 | + int lftp_ssl_openssl::verify_crl(X509_STORE_CTX *ctx) |
| 16 | + { |
| 17 | + X509_OBJECT *obj=0; |
| 18 | +- X509_NAME *subject=0; |
| 19 | +- X509_NAME *issuer=0; |
| 20 | ++ const X509_NAME *subject=0; |
| 21 | ++ const X509_NAME *issuer=0; |
| 22 | + X509 *xs=0; |
| 23 | + X509_CRL *crl=0; |
| 24 | + X509_REVOKED *revoked=0; |
| 25 | +@@ -1436,7 +1436,7 @@ void lftp_ssl_openssl::check_certificate() |
| 26 | + unsigned char *nulstr = (unsigned char *)""; |
| 27 | + unsigned char *peer_CN = nulstr; |
| 28 | + |
| 29 | +- X509_NAME *name = X509_get_subject_name(server_cert) ; |
| 30 | ++ const X509_NAME *name = X509_get_subject_name(server_cert) ; |
| 31 | + if(name) |
| 32 | + while((j = X509_NAME_get_index_by_NID(name, NID_commonName, i))>=0) |
| 33 | + i=j; |
| 34 | +@@ -1446,7 +1446,7 @@ void lftp_ssl_openssl::check_certificate() |
| 35 | + UTF8 etc. */ |
| 36 | + |
| 37 | + if(i>=0) { |
| 38 | +- ASN1_STRING *tmp = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name,i)); |
| 39 | ++ const ASN1_STRING *tmp = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name,i)); |
| 40 | + |
| 41 | + /* In OpenSSL 0.9.7d and earlier, ASN1_STRING_to_UTF8 fails if the input |
| 42 | + is already UTF-8 encoded. We check for this case and copy the raw |
| 43 | +@@ -1522,8 +1522,8 @@ int lftp_ssl_openssl::verify_callback(int ok,X509_STORE_CTX *ctx) |
| 44 | + if(cert!=prev_cert) |
| 45 | + { |
| 46 | + int depth = X509_STORE_CTX_get_error_depth(ctx); |
| 47 | +- X509_NAME *subject = X509_get_subject_name(cert); |
| 48 | +- X509_NAME *issuer = X509_get_issuer_name(cert); |
| 49 | ++ const X509_NAME *subject = X509_get_subject_name(cert); |
| 50 | ++ const X509_NAME *issuer = X509_get_issuer_name(cert); |
| 51 | + char *subject_line = X509_NAME_oneline(subject, NULL, 0); |
| 52 | + char *issuer_line = X509_NAME_oneline(issuer, NULL, 0); |
| 53 | + Log::global->Format(3,"Certificate depth: %d; subject: %s; issuer: %s\n", |
| 54 | +-- |
| 55 | +2.53.0 |
| 56 | + |
0 commit comments