public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paul Howarth <paul@city-fan.org>
To: git-commits@fedoraproject.org
Subject: [rpms/proftpd] f43: Apply upstream fixes for GH#2484 and GH#2497
Date: Mon, 23 Nov 2026 17:04:53 GMT	[thread overview]
Message-ID: <179545349306.1.13957907155209634126.rpms-proftpd-04304e309eab@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/proftpd
            Branch : f43
            Commit : 04304e309eab36e7c4b7b906a755fe18977b98c7
            Author : Paul Howarth <paul@city-fan.org>
            Date   : 2026-11-22T19:18:03+00:00
            Stats  : +1154/-1 in 6 file(s)
            URL    : https://src.fedoraproject.org/rpms/proftpd/c/04304e309eab36e7c4b7b906a755fe18977b98c7?branch=f43

            Log:
            Apply upstream fixes for GH#2484 and GH#2497

- ProFTPD modules used OpenSSL 4.x custom providers that collide with defaults,
  causing segfaults (GH#2484)
- Address Auth API error mishandling/mismatch allowing for inadvertent
  authentication bypass (GH#2497)

---
diff --git a/18535936.patch b/18535936.patch
new file mode 100644
index 0000000..3f50ee2
--- /dev/null
+++ b/18535936.patch
@@ -0,0 +1,485 @@
+From 18535936b37b4b789e37242b4433d069df4689a7 Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Sat, 21 Nov 2026 13:07:09 -0800
+Subject: [PATCH] Issue #2497: Address Auth API error mishandling/mismatch
+ allowing for inadvertent authentication bypass.
+
+---
+ contrib/mod_ldap.c      | 10 ++---
+ contrib/mod_sql.c       |  5 ++-
+ modules/mod_auth_pam.c  | 25 ++++++++++--
+ modules/mod_auth_unix.c |  6 +--
+ src/auth.c              | 61 ++++++++++++++++++++++++++++
+ tests/api/auth.c        | 90 ++++++++++++++++++++++++++++++++++++++---
+ 6 files changed, 178 insertions(+), 19 deletions(-)
+
+diff --git a/contrib/mod_ldap.c b/contrib/mod_ldap.c
+index da8c2c513b..927a02f006 100644
+--- a/contrib/mod_ldap.c
++++ b/contrib/mod_ldap.c
+@@ -1807,7 +1807,7 @@ MODRET ldap_auth_auth(cmd_rec *cmd) {
+   filter = pr_ldap_interpolate_filter(cmd->tmp_pool, ldap_user_basedn,
+     username);
+   if (filter == NULL) {
+-    return NULL;
++    return PR_DECLINED(cmd);
+   }
+ 
+   /* If anything here fails hard (IOW, we've found an LDAP entry for the
+@@ -1919,7 +1919,7 @@ MODRET ldap_auth_check(cmd_rec *cmd) {
+       (void) pr_log_writefile(ldap_logfd, MOD_LDAP_VERSION,
+         "invalid credentials used for %s", ldap_authbind_dn);
+       LDAP_UNBIND(ld_auth);
+-      return PR_ERROR(cmd);
++      return PR_ERROR_INT(cmd, PR_AUTH_BADPWD);
+     }
+ 
+     LDAP_UNBIND(ld_auth);
+@@ -1957,13 +1957,13 @@ MODRET ldap_auth_check(cmd_rec *cmd) {
+       pr_trace_msg(trace_channel, 19,
+         "using %s auth scheme, crypt(3) failed: %s", hash_method,
+         strerror(errno));
+-      return PR_ERROR(cmd);
++      return PR_ERROR_INT(cmd, PR_AUTH_BADPWD);
+     }
+ 
+     if (strcmp(crypted, cryptpass + encname_len) != 0) {
+       pr_trace_msg(trace_channel, 19,
+         "using '%s' auth scheme, comparison failed", hash_method);
+-      return PR_ERROR(cmd);
++      return PR_ERROR_INT(cmd, PR_AUTH_BADPWD);
+     }
+ 
+   /* The {clear} scheme */
+@@ -1971,7 +1971,7 @@ MODRET ldap_auth_check(cmd_rec *cmd) {
+     if (strcmp(pass, cryptpass + encname_len) != 0) {
+       pr_trace_msg(trace_channel, 19,
+         "using '%s' auth scheme, comparison failed", hash_method);
+-      return PR_ERROR(cmd);
++      return PR_ERROR_INT(cmd, PR_AUTH_BADPWD);
+     }
+ 
+   } else {
+diff --git a/contrib/mod_sql.c b/contrib/mod_sql.c
+index 0871d9121c..2d90fb427a 100644
+--- a/contrib/mod_sql.c
++++ b/contrib/mod_sql.c
+@@ -4306,7 +4306,10 @@ MODRET sql_auth_authenticate(cmd_rec *cmd) {
+   mr = sql_dispatch(sql_make_cmd(cmd->tmp_pool, 2, MOD_SQL_DEF_CONN_NAME,
+     user), "sql_escapestring");
+   if (check_response(mr, 0) < 0) {
+-    return mr;
++    /* We KNOW that an error occurred here, so return DECLINED to indicate
++     * that we could not process the request (Issue #2497).
++     */
++    return PR_DECLINED(cmd);
+   }
+ 
+   user = (char *) mr->data;
+diff --git a/modules/mod_auth_pam.c b/modules/mod_auth_pam.c
+index dccf5a0006..0097fa073b 100644
+--- a/modules/mod_auth_pam.c
++++ b/modules/mod_auth_pam.c
+@@ -268,7 +268,11 @@ MODRET pam_auth(cmd_rec *cmd) {
+ 
+   /* Just in case... */
+   if (cmd->argc != 2) {
+-    return pam_authoritative ? PR_ERROR(cmd) : PR_DECLINED(cmd);
++    if (pam_authoritative == TRUE) {
++      return PR_ERROR_INT(cmd, PR_AUTH_ERROR);
++    }
++
++    return PR_DECLINED(cmd);
+   }
+ 
+   /* Allocate our entries; we free these up at the end of the authentication. */
+@@ -293,7 +297,11 @@ MODRET pam_auth(cmd_rec *cmd) {
+ #endif
+   pam_user = malloc(pam_user_len);
+   if (pam_user == NULL) {
+-    return pam_authoritative ? PR_ERROR(cmd) : PR_DECLINED(cmd);
++    if (pam_authoritative == TRUE) {
++      return PR_ERROR_INT(cmd, PR_AUTH_ERROR);
++    }
++
++    return PR_DECLINED(cmd);
+   }
+ 
+   sstrncpy(pam_user, cmd->argv[0], pam_user_len);
+@@ -310,7 +318,12 @@ MODRET pam_auth(cmd_rec *cmd) {
+     pam_user = NULL;
+     pam_user_len = 0;
+     pam_pass_len = 0;
+-    return pam_authoritative ? PR_ERROR(cmd) : PR_DECLINED(cmd);
++
++    if (pam_authoritative == TRUE) {
++      return PR_ERROR_INT(cmd, PR_AUTH_ERROR);
++    }
++
++    return PR_DECLINED(cmd);
+   }
+ 
+   sstrncpy(pam_pass, cmd->argv[1], pam_pass_len);
+@@ -587,7 +600,11 @@ MODRET pam_auth(cmd_rec *cmd) {
+       pam_user_len = 0;
+     }
+ 
+-    return pam_authoritative ? PR_ERROR_INT(cmd, retval) : PR_DECLINED(cmd);
++    if (pam_authoritative == TRUE) {
++      return PR_ERROR_INT(cmd, retval);
++    }
++
++    return PR_DECLINED(cmd);
+   }
+ 
+   session.auth_mech = "mod_auth_pam.c";
+diff --git a/modules/mod_auth_unix.c b/modules/mod_auth_unix.c
+index 00af9f21d6..635ec7896a 100644
+--- a/modules/mod_auth_unix.c
++++ b/modules/mod_auth_unix.c
+@@ -928,7 +928,7 @@ MODRET pw_check(cmd_rec *cmd) {
+       PRIVS_RELINQUISH
+       pr_log_auth(PR_LOG_NOTICE, "sia_ses_authent() returned %d for user '%s'",
+         res, user);
+-      return PR_ERROR(cmd);
++      return PR_ERROR_INT(cmd, PR_AUTH_ERROR);
+     }
+ 
+     res = sia_ses_estab(NULL, ent);
+@@ -936,14 +936,14 @@ MODRET pw_check(cmd_rec *cmd) {
+       PRIVS_RELINQUISH
+       pr_log_auth(PR_LOG_NOTICE, "sia_ses_estab() returned %d for user '%s'",
+         res, user);
+-      return PR_ERROR(cmd);
++      return PR_ERROR_INT(cmd, PR_AUTH_ERROR);
+     }
+ 
+     res = sia_ses_release(&ent);
+     if (res != SIASUCCESS) {
+       PRIVS_RELINQUISH
+       pr_log_auth(PR_LOG_NOTICE, "sia_ses_release() returned %d", res);
+-      return PR_ERROR(cmd);
++      return PR_ERROR_INT(cmd, PR_AUTH_ERROR);
+     }
+   }
+   PRIVS_RELINQUISH
+diff --git a/src/auth.c b/src/auth.c
+index 7961ca6866..2e0eb0201e 100644
+--- a/src/auth.c
++++ b/src/auth.c
+@@ -982,6 +982,16 @@ int pr_auth_authenticate(pool *p, const char *name, const char *pw) {
+             "module '%s' used for authenticating user '%s'", elt->name, name);
+ 
+           res = MODRET_ERROR(mr);
++          if (res > 0) {
++            /* We KNOW that an error was returned, so make sure that this
++             * auth value is appropriately an error (Issue #2497).
++             */
++            pr_trace_msg(trace_channel, 4,
++              "module '%s' provided unwise error value (%d %s) when "
++              "authenticating user '%s', using %s instead", elt->name, res,
++              get_authcode_str(res), name, get_authcode_str(PR_AUTH_ERROR));
++            res = PR_AUTH_ERROR;
++          }
+ 
+           if (cmd->tmp_pool) {
+             destroy_pool(cmd->tmp_pool);
+@@ -1023,6 +1033,17 @@ int pr_auth_authenticate(pool *p, const char *name, const char *pw) {
+ 
+   } else if (MODRET_ISERROR(mr)) {
+     res = MODRET_ERROR(mr);
++    if (res > 0) {
++      /* We KNOW that an error was returned, so make sure that this auth
++       * value is appropriately an error (Issue #2497).
++       */
++      pr_trace_msg(trace_channel, 9,
++        "obtained unwise error value (%d %s) when authenticating user '%s', "
++        "using %s instead", res, get_authcode_str(res), name,
++        get_authcode_str(PR_AUTH_ERROR));
++      res = PR_AUTH_ERROR;
++    }
++
+     pr_trace_msg(trace_channel, 9,
+       "obtained ERROR (%s) for authenticating user '%s'", get_authcode_str(res),
+       name);
+@@ -1075,6 +1096,17 @@ int pr_auth_authorize(pool *p, const char *name) {
+ 
+   if (MODRET_ISERROR(mr)) {
+     res = MODRET_ERROR(mr);
++    if (res > 0) {
++      /* We KNOW that an error was returned, so make sure that this auth
++       * value is appropriately an error (Issue #2497).
++       */
++      pr_trace_msg(trace_channel, 9,
++        "obtained unwise error value (%d %s) when authorizing user '%s', "
++        "using %s instead", res, get_authcode_str(res), name,
++        get_authcode_str(PR_AUTH_ERROR));
++      res = PR_AUTH_ERROR;
++    }
++
+     pr_trace_msg(trace_channel, 9,
+       "obtained ERROR (%s) for authorizing user '%s'", get_authcode_str(res),
+       name);
+@@ -1151,6 +1183,16 @@ int pr_auth_check(pool *p, const char *ciphertext_passwd, const char *name,
+ 
+         if (MODRET_ISERROR(mr)) {
+           res = MODRET_ERROR(mr);
++          if (res > 0) {
++            /* We KNOW that an error was returned, so make sure that this auth
++             * value is appropriately an error (Issue #2497).
++             */
++            pr_trace_msg(trace_channel, 9,
++              "module '%s' returned unwise error value (%d %s) when checking "
++              "user '%s', using %s instead", elt->name, res,
++              get_authcode_str(res), name, get_authcode_str(PR_AUTH_ERROR));
++            res = PR_AUTH_ERROR;
++          }
+ 
+           if (cmd->tmp_pool != NULL) {
+             destroy_pool(cmd->tmp_pool);
+@@ -1189,6 +1231,15 @@ int pr_auth_check(pool *p, const char *ciphertext_passwd, const char *name,
+     pr_trace_msg(trace_channel, 9,
+       "obtained HANDLED (%s) for checking user '%s'", get_authcode_str(res),
+       name);
++
++  } else if (MODRET_ISERROR(mr)) {
++    int err_code;
++
++    err_code = MODRET_ERROR(mr);
++    pr_trace_msg(trace_channel, 9,
++      "obtained ERROR (%d %s) for checking user '%s', returning "
++      "default ERROR (%d %s)", err_code, get_authcode_str(err_code), name,
++      res, get_authcode_str(res));
+   }
+ 
+   if (cmd->tmp_pool != NULL) {
+@@ -1218,6 +1269,16 @@ int pr_auth_requires_pass(pool *p, const char *name) {
+ 
+   } else if (MODRET_ISERROR(mr)) {
+     res = MODRET_ERROR(mr);
++    if (res != TRUE) {
++      /* We KNOW that an error was returned, so make sure this properly
++       * returns TRUE, regardless of the error value, which could be
++       * negative (Issue #2497).
++       */
++      pr_trace_msg(trace_channel, 9,
++        "obtained unwise error value (%d %s) when password requirements for "
++        "user '%s', using TRUE instead", res, get_authcode_str(res), name);
++      res = TRUE;
++    }
+   }
+ 
+   if (cmd->tmp_pool) {
+diff --git a/tests/api/auth.c b/tests/api/auth.c
+index d090145810..974273e66b 100644
+--- a/tests/api/auth.c
++++ b/tests/api/auth.c
+@@ -40,6 +40,9 @@
+ #define PR_TEST_AUTH_HOME		"/tmp"
+ #define PR_TEST_AUTH_SHELL		"/bin/bash"
+ #define PR_TEST_AUTH_PASSWD		"password"
++#define PR_TEST_AUTH_ERR_NAME		"testsuite_error_user"
++#define PR_TEST_AUTH_ERR_PASSWD		"SendErrorNoInt"
++#define PR_TEST_AUTH_INVALID_CODE	25
+ 
+ static pool *p = NULL;
+ static server_rec *test_server = NULL;
+@@ -354,7 +357,7 @@ MODRET handle_authn(cmd_rec *cmd) {
+ 
+   if (strcmp(user, PR_TEST_AUTH_NAME) == 0) {
+     if (strcmp(cleartext_passwd, PR_TEST_AUTH_PASSWD) == 0) {
+-      if (authn_rfc2228) {
++      if (authn_rfc2228 == TRUE) {
+         authn_rfc2228 = FALSE;
+         return mod_create_data(cmd, (void *) PR_AUTH_RFC2228_OK);
+       }
+@@ -362,6 +365,13 @@ MODRET handle_authn(cmd_rec *cmd) {
+       return PR_HANDLED(cmd);
+     }
+ 
++    if (strcmp(cleartext_passwd, PR_TEST_AUTH_ERR_PASSWD) == 0) {
++      /* Some modules do this; notice the difference between PR_ERROR() and
++       * PR_ERROR_INT().
++       */
++      return PR_ERROR(cmd);
++    }
++
+     return PR_ERROR_INT(cmd, PR_AUTH_BADPWD);
+   }
+ 
+@@ -377,6 +387,13 @@ MODRET handle_authz(cmd_rec *cmd) {
+     return PR_HANDLED(cmd);
+   }
+ 
++  if (strcmp(user, PR_TEST_AUTH_ERR_NAME) == 0) {
++    /* Some modules do this; notice the difference between PR_ERROR() and
++     * PR_ERROR_INT().
++     */
++    return PR_ERROR(cmd);
++  }
++
+   return PR_ERROR_INT(cmd, PR_AUTH_NOPWD);
+ }
+ 
+@@ -415,6 +432,13 @@ MODRET handle_requires_pass(cmd_rec *cmd) {
+     return mod_create_data(cmd, (void *) PR_AUTH_RFC2228_OK);
+   }
+ 
++  if (strcmp(name, PR_TEST_AUTH_ERR_NAME) == 0) {
++    /* We deliberately create an ERROR return value with a non-1 mr_error
++     * value, for our test case.
++     */
++    return PR_ERROR_INT(cmd, -1);
++  }
++
+   return PR_DECLINED(cmd);
+ }
+ 
+@@ -1542,11 +1566,22 @@ START_TEST (auth_authenticate_test) {
+     "Failed to authenticate user '%s' (expected %d, got %d)",
+     PR_TEST_AUTH_NAME, PR_AUTH_OK, res);
+ 
++  res = pr_auth_authenticate(p, PR_TEST_AUTH_NAME, PR_TEST_AUTH_ERR_PASSWD);
++  ck_assert_msg(res == PR_AUTH_ERROR,
++    "Authenticated user '%s' unexpectedly (expected %d, got %d)",
++    PR_TEST_AUTH_NAME, PR_AUTH_ERROR, res);
++
+   authtab.auth_flags |= PR_AUTH_FL_REQUIRED;
+   res = pr_auth_authenticate(p, PR_TEST_AUTH_NAME, PR_TEST_AUTH_PASSWD);
+   ck_assert_msg(res == PR_AUTH_OK,
+     "Failed to authenticate user '%s' (expected %d, got %d)",
+     PR_TEST_AUTH_NAME, PR_AUTH_OK, res);
++
++  res = pr_auth_authenticate(p, PR_TEST_AUTH_NAME, PR_TEST_AUTH_ERR_PASSWD);
++  ck_assert_msg(res == PR_AUTH_ERROR,
++    "Authenticated user '%s' unexpectedly (expected %d, got %d)",
++    PR_TEST_AUTH_NAME, PR_AUTH_ERROR, res);
++
+   authtab.auth_flags &= ~PR_AUTH_FL_REQUIRED;
+ 
+   (void) pr_auth_cache_set(TRUE, PR_AUTH_CACHE_FL_AUTH_MODULE);
+@@ -1575,6 +1610,11 @@ START_TEST (auth_authenticate_test) {
+     "Failed to authenticate user '%s' (expected %d, got %d)",
+     PR_TEST_AUTH_NAME, PR_AUTH_OK, res);
+ 
++  res = pr_auth_authenticate(p, PR_TEST_AUTH_NAME, PR_TEST_AUTH_ERR_PASSWD);
++  ck_assert_msg(res == PR_AUTH_ERROR,
++    "Authenticated user '%s' unexpectedly (expected %d, got %d)",
++    PR_TEST_AUTH_NAME, PR_AUTH_ERROR, res);
++
+   authn_rfc2228 = TRUE;
+   res = pr_auth_authenticate(p, PR_TEST_AUTH_NAME, PR_TEST_AUTH_PASSWD);
+   ck_assert_msg(res == PR_AUTH_RFC2228_OK,
+@@ -1610,7 +1650,7 @@ START_TEST (auth_authorize_test) {
+     strerror(errno), errno);
+ 
+   res = pr_auth_authorize(p, PR_TEST_AUTH_NAME);
+-  ck_assert_msg(res > 0, "Failed to handle missing handler");
++  ck_assert_msg(res < 0, "Failed to handle missing handler");
+ 
+   /* Load the appropriate AUTH symbol, and call it. */
+ 
+@@ -1632,6 +1672,11 @@ START_TEST (auth_authorize_test) {
+     "Failed to authorize user '%s' (expected %d, got %d)",
+     PR_TEST_AUTH_NAME, PR_AUTH_OK, res);
+ 
++  res = pr_auth_authorize(p, PR_TEST_AUTH_ERR_NAME);
++  ck_assert_msg(res == PR_AUTH_ERROR,
++    "Authorized user '%s' unexpectedly (expected %d, got %d)",
++    PR_TEST_AUTH_ERR_NAME, PR_AUTH_ERROR, res);
++
+   (void) pr_auth_cache_set(TRUE, PR_AUTH_CACHE_FL_AUTH_MODULE);
+ 
+   res = pr_auth_add_auth_only_module("foo.bar");
+@@ -1645,6 +1690,11 @@ START_TEST (auth_authorize_test) {
+     "Failed to authorize user '%s' (expected %d, got %d)",
+     PR_TEST_AUTH_NAME, PR_AUTH_OK, res);
+ 
++  res = pr_auth_authorize(p, PR_TEST_AUTH_ERR_NAME);
++  ck_assert_msg(res == PR_AUTH_ERROR,
++    "Authorized user '%s' unexpectedly (expected %d, got %d)",
++    PR_TEST_AUTH_ERR_NAME, PR_AUTH_ERROR, res);
++
+   (void) pr_auth_clear_auth_only_modules();
+ }
+ END_TEST
+@@ -1652,6 +1702,13 @@ END_TEST
+ static int test_check_errorcode = PR_AUTH_BADPWD;
+ 
+ MODRET handle_check_error(cmd_rec *cmd) {
++  if (test_check_errorcode == PR_TEST_AUTH_INVALID_CODE) {
++    /* Some modules do this; notice the difference between PR_ERROR() and
++     * PR_ERROR_INT().
++     */
++    return PR_ERROR(cmd);
++  }
++
+   return PR_ERROR_INT(cmd, test_check_errorcode);
+ }
+ 
+@@ -1728,8 +1785,18 @@ START_TEST (auth_check_errors_test) {
+   mark_point();
+   test_check_errorcode = PR_AUTH_OK_NO_PASS;
+   res = pr_auth_check(p, "", name, cleartext_passwd);
+-  ck_assert_msg(res == test_check_errorcode, "Expected %d, got %d",
+-    test_check_errorcode, res);
++
++  /* Since our test handler ALWAYS returns an error, we should not expect
++   * a positive code, like PR_AUTH_OK_NO_PASS, here.
++   */
++  ck_assert_msg(res == PR_AUTH_ERROR, "Expected %d, got %d", PR_AUTH_ERROR,
++    res);
++
++  mark_point();
++  test_check_errorcode = PR_TEST_AUTH_INVALID_CODE;
++  res = pr_auth_check(p, "", name, cleartext_passwd);
++  ck_assert_msg(res == PR_AUTH_ERROR, "Expected %d, got %d", PR_AUTH_ERROR,
++    res);
+ 
+   res = pr_module_unload(&testsuite_module);
+   ck_assert_msg(res == 0, "Failed to unload module: %s", strerror(errno));
+@@ -1802,16 +1869,19 @@ START_TEST (auth_requires_pass_test) {
+   authtable authtab;
+   char *sym_name = "requires_pass";
+ 
++  mark_point();
+   res = pr_auth_requires_pass(NULL, NULL);
+   ck_assert_msg(res < 0, "Failed to handle null arguments");
+   ck_assert_msg(errno == EINVAL, "Expected EINVAL (%d), got %s (%d)", EINVAL,
+     strerror(errno), errno);
+ 
++  mark_point();
+   res = pr_auth_requires_pass(p, NULL);
+   ck_assert_msg(res < 0, "Failed to handle null name");
+   ck_assert_msg(errno == EINVAL, "Expected EINVAL (%d), got %s (%d)", EINVAL,
+     strerror(errno), errno);
+ 
++  mark_point();
+   name = "other";
+   res = pr_auth_requires_pass(p, name);
+   ck_assert_msg(res == TRUE, "Unknown users should require passwords (got %d)",
+@@ -1827,14 +1897,22 @@ START_TEST (auth_requires_pass_test) {
+   ck_assert_msg(res == 0, "Failed to add '%s' AUTH symbol: %s", sym_name,
+     strerror(errno));
+ 
++  mark_point();
+   res = pr_auth_requires_pass(p, name);
+   ck_assert_msg(res == TRUE, "Unknown users should require passwords (got %d)",
+     res);
+ 
++  mark_point();
+   name = PR_TEST_AUTH_NAME;
+   res = pr_auth_requires_pass(p, name);
+-  ck_assert_msg(res == FALSE, "Known users should NOT require passwords (got %d)",
+-    res);
++  ck_assert_msg(res == FALSE,
++    "Known users should NOT require passwords (got %d)", res);
++
++  mark_point();
++  name = PR_TEST_AUTH_ERR_NAME;
++  res = pr_auth_requires_pass(p, name);
++  ck_assert_msg(res == TRUE,
++    "Erroring users SHOULD require passwords (got %d)", res);
+ }
+ END_TEST
+ 

diff --git a/2f687819.patch b/2f687819.patch
new file mode 100644
index 0000000..1578479
--- /dev/null
+++ b/2f687819.patch
@@ -0,0 +1,191 @@
+From 2f68781966b8d3170e4ab72984caddf28599fba5 Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Thu, 19 Nov 2026 19:52:58 -0800
+Subject: [PATCH] Issue #2484: When modules register custom OpenSSL providers,
+ they must do so with a custom "library context", so that the custom providers
+ are not used by the rest of the default OpenSSL machinery.
+
+---
+ contrib/mod_digest.c        | 34 ++++++++++++++++++++++---------
+ contrib/mod_sftp/provider.c | 40 ++++++++++++++++++++++++++-----------
+ 2 files changed, 53 insertions(+), 21 deletions(-)
+
+diff --git a/contrib/mod_digest.c b/contrib/mod_digest.c
+index 1fd1743a1c..16d51664a1 100644
+--- a/contrib/mod_digest.c
++++ b/contrib/mod_digest.c
+@@ -190,6 +190,7 @@ static int digest_hash_free_md = FALSE;
+ #endif
+ 
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++static OSSL_LIB_CTX *digest_libctx = NULL;
+ static OSSL_PROVIDER *crc32_provider = NULL;
+ #endif /* OpenSSL 4.x and later */
+ 
+@@ -379,12 +380,6 @@ static int crc32_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   return 1;
+ }
+ 
+-static const OSSL_PARAM crc32_params[] = {
+-  OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, NULL),
+-  OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
+-  OSSL_PARAM_END
+-};
+-
+ static int crc32_get_params(void *provctx, OSSL_PARAM params[]) {
+   OSSL_PARAM *p;
+   int ok = 1;
+@@ -408,7 +403,13 @@ static int crc32_get_params(void *provctx, OSSL_PARAM params[]) {
+   return ok;
+ }
+ 
+-static const OSSL_PARAM *crc32_gettable_params(void) {
++static const OSSL_PARAM *crc32_gettable_params(void *provctx) {
++  static const OSSL_PARAM crc32_params[] = {
++    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, NULL),
++    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
++    OSSL_PARAM_END
++  };
++
+   return crc32_params;
+ }
+ 
+@@ -2990,6 +2991,11 @@ static void digest_mod_unload_ev(const void *event_data, void *user_data) {
+     OSSL_PROVIDER_unload(crc32_provider);
+     crc32_provider = NULL;
+   }
++
++  if (digest_libctx != NULL) {
++    OSSL_LIB_CTX_free(digest_libctx);
++    digest_libctx = NULL;
++  }
+ # endif /* OpenSSL 4.x and later */
+ }
+ #endif /* PR_SHARED_MODULE */
+@@ -3024,6 +3030,11 @@ static void digest_shutdown_ev(const void *event_data, void *user_data) {
+     OSSL_PROVIDER_unload(crc32_provider);
+     crc32_provider = NULL;
+   }
++
++  if (digest_libctx != NULL) {
++    OSSL_LIB_CTX_free(digest_libctx);
++    digest_libctx = NULL;
++  }
+ #endif /* HAVE_OSSL_PROVIDER_LOAD_OPENSSL */
+ }
+ 
+@@ -3041,7 +3052,12 @@ static int digest_init(void) {
+   pr_event_register(&digest_module, "core.shutdown", digest_shutdown_ev, NULL);
+ 
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-  if (OSSL_PROVIDER_add_builtin(NULL, "crc32", crc32_provider_init) != 1) {
++  /* Allocate a custom library context for our provider, so that no one else
++   * uses our providers.
++   */
++  digest_libctx = OSSL_LIB_CTX_new();
++  if (OSSL_PROVIDER_add_builtin(digest_libctx, "crc32",
++      crc32_provider_init) != 1) {
+     pr_log_debug(DEBUG1, MOD_DIGEST_VERSION
+       ": error registering 'crc32' OpenSSL provider: %s", get_errors());
+ 
+@@ -3050,7 +3066,7 @@ static int digest_init(void) {
+   }
+ 
+   /* Load our custom "crc32" OpenSSL algorithm provider. */
+-  crc32_provider = OSSL_PROVIDER_load(NULL, "crc32");
++  crc32_provider = OSSL_PROVIDER_load(digest_libctx, "crc32");
+   if (crc32_provider == NULL) {
+     pr_log_pri(PR_LOG_NOTICE, MOD_DIGEST_VERSION
+       ": error loading 'crc32' OpenSSL provider: %s", get_errors());
+diff --git a/contrib/mod_sftp/provider.c b/contrib/mod_sftp/provider.c
+index b99d4ad24a..3848c163c9 100644
+--- a/contrib/mod_sftp/provider.c
++++ b/contrib/mod_sftp/provider.c
+@@ -33,6 +33,7 @@
+ # include <openssl/params.h>
+ # include <openssl/provider.h>
+ 
++static OSSL_LIB_CTX *sftp_libctx = NULL;
+ static OSSL_PROVIDER *umac_provider = NULL;
+ 
+ static const char *trace_channel = "ssh2";
+@@ -73,12 +74,6 @@ static int umac_md_init(void *vctx) {
+   return 1;
+ }
+ 
+-static const OSSL_PARAM umac_params[] = {
+-  OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, NULL),
+-  OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
+-  OSSL_PARAM_END
+-};
+-
+ /* UMAC64 */
+ 
+ static int umac64_md_update(void *vctx, const unsigned char *data, size_t len) {
+@@ -145,8 +140,14 @@ static int umac64_get_params(void *provctx, OSSL_PARAM params[]) {
+   return ok;
+ }
+ 
+-static const OSSL_PARAM *umac64_gettable_params(void) {
+-  return umac_params;
++static const OSSL_PARAM *umac64_gettable_params(void *provctx) {
++  static const OSSL_PARAM umac64_params[] = {
++    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, NULL),
++    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
++    OSSL_PARAM_END
++  };
++
++  return umac64_params;
+ }
+ 
+ static const OSSL_DISPATCH umac64_functions[] = {
+@@ -228,8 +229,14 @@ static int umac128_get_params(void *provctx, OSSL_PARAM params[]) {
+   return ok;
+ }
+ 
+-static const OSSL_PARAM *umac128_gettable_params(void) {
+-  return umac_params;
++static const OSSL_PARAM *umac128_gettable_params(void *provctx) {
++  static const OSSL_PARAM umac128_params[] = {
++    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, NULL),
++    OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL),
++    OSSL_PARAM_END
++  };
++
++  return umac128_params;
+ }
+ 
+ static const OSSL_DISPATCH umac128_functions[] = {
+@@ -280,7 +287,11 @@ static int umac_provider_init(const OSSL_CORE_HANDLE *core,
+ 
+ int sftp_provider_init(void) {
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-  if (OSSL_PROVIDER_add_builtin(NULL, "umac", umac_provider_init) != 1) {
++  /* Allocate a custom library context for our provider, so that no one else
++   * uses our providers.
++   */
++  sftp_libctx = OSSL_LIB_CTX_new();
++  if (OSSL_PROVIDER_add_builtin(sftp_libctx, "umac", umac_provider_init) != 1) {
+     pr_log_debug(DEBUG1, MOD_SFTP_VERSION
+       ": error registering 'umac' OpenSSL provider: %s",
+       sftp_crypto_get_errors());
+@@ -290,7 +301,7 @@ int sftp_provider_init(void) {
+   }
+ 
+   /* Load our custom OpenSSL algorithm provider. */
+-  umac_provider = OSSL_PROVIDER_load(NULL, "umac");
++  umac_provider = OSSL_PROVIDER_load(sftp_libctx, "umac");
+   if (umac_provider == NULL) {
+     pr_log_pri(PR_LOG_NOTICE, MOD_SFTP_VERSION
+       ": error loading 'umac' OpenSSL provider: %s", sftp_crypto_get_errors());
+@@ -309,5 +320,10 @@ void sftp_provider_free(void) {
+     OSSL_PROVIDER_unload(umac_provider);
+     umac_provider = NULL;
+   }
++
++  if (sftp_libctx != NULL) {
++    OSSL_LIB_CTX_free(sftp_libctx);
++    sftp_libctx = NULL;
++  }
+ #endif /* OpenSSL 4.x and later */
+ }

diff --git a/44088468.patch b/44088468.patch
new file mode 100644
index 0000000..9670163
--- /dev/null
+++ b/44088468.patch
@@ -0,0 +1,36 @@
+From 44088468911a253dbb91a65e9edb1b9b206a161f Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Fri, 20 Nov 2026 09:38:27 -0800
+Subject: [PATCH] Quell compiler warning about possibly unused nonce; the UMAC
+ algorithm generates a nonce, but the SSH implementation does not use it.
+
+---
+ contrib/mod_sftp/provider.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/mod_sftp/provider.c b/contrib/mod_sftp/provider.c
+index 448e70bd5..b468a5073 100644
+--- a/contrib/mod_sftp/provider.c
++++ b/contrib/mod_sftp/provider.c
+@@ -107,9 +107,9 @@ static int umac64_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   unsigned char nonce[8];
+ 
+   ctx = vctx;
+-
+   *out_len = outsz;
+ 
++  memset(nonce, 0, sizeof(nonce));
+   if (outsz != 0) {
+     res = umac_final(ctx, out, nonce);
+   }
+@@ -196,9 +196,9 @@ static int umac128_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   unsigned char nonce[8];
+ 
+   ctx = vctx;
+-
+   *out_len = outsz;
+ 
++  memset(nonce, 0, sizeof(nonce));
+   if (outsz != 0) {
+     res = umac128_final(ctx, out, nonce);
+   }

diff --git a/d16026d5.patch b/d16026d5.patch
new file mode 100644
index 0000000..4980a86
--- /dev/null
+++ b/d16026d5.patch
@@ -0,0 +1,222 @@
+From d16026d5ec1eded1787d39d3a1e6cbac63e27f68 Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Fri, 20 Nov 2026 10:05:33 -0800
+Subject: [PATCH] Ensure that our custom OpenSSL 4.x provider does not
+ interfere with the OpenSSL defaults.
+
+See https://github.com/proftpd/proftpd/issues/2484
+---
+ include/proxy/ssh/provider.h |  5 +++
+ lib/proxy/ssh/crypto.c       | 13 ++++++--
+ lib/proxy/ssh/provider.c     | 61 +++++++++++++++++++++---------------
+ 3 files changed, 52 insertions(+), 27 deletions(-)
+
+diff --git a/include/proxy/ssh/provider.h b/include/proxy/ssh/provider.h
+index 276db4b2..d868b594 100644
+--- a/include/proxy/ssh/provider.h
++++ b/include/proxy/ssh/provider.h
+@@ -26,6 +26,11 @@
+ 
+ #include "mod_proxy.h"
+ 
++/* Obtain the module-specific "library context" with which our custom
++ * UMAC providers are registered.
++ */
++void *proxy_ssh_provider_get_libctx(void);
++
+ int proxy_ssh_provider_init(void);
+ void proxy_ssh_provider_free(void);
+ 
+diff --git a/lib/proxy/ssh/crypto.c b/lib/proxy/ssh/crypto.c
+index 034b44bd..07cb09ac 100644
+--- a/lib/proxy/ssh/crypto.c
++++ b/lib/proxy/ssh/crypto.c
+@@ -23,6 +23,7 @@
+ 
+ #include "mod_proxy.h"
+ #include "proxy/ssh/crypto.h"
++#include "proxy/ssh/provider.h"
+ #include "proxy/ssh/umac.h"
+ 
+ #include <openssl/aes.h>
+@@ -893,11 +894,15 @@ static int delete_umac128(EVP_MD_CTX *ctx) {
+ 
+ static const EVP_MD *get_umac64_digest(int *free_md) {
+   EVP_MD *md = NULL;
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++  OSSL_LIB_CTX *proxy_libctx = NULL;
++#endif /* OpenSSL 4.x and later */
+ 
+   *free_md = FALSE;
+ 
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-  md = EVP_MD_fetch(NULL, "umac64", NULL);
++  proxy_libctx = proxy_ssh_provider_get_libctx();
++  md = EVP_MD_fetch(proxy_libctx, "umac64", "provider=umac");
+   if (md == NULL) {
+     pr_trace_msg(trace_channel, 4, "error fetching 'umac64' EVP_MD: %s",
+       proxy_ssh_crypto_get_errors());
+@@ -941,11 +946,15 @@ static const EVP_MD *get_umac64_digest(int *free_md) {
+ 
+ static const EVP_MD *get_umac128_digest(int *free_md) {
+   EVP_MD *md;
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++  OSSL_LIB_CTX *proxy_libctx = NULL;
++#endif /* OpenSSL 4.x and later */
+ 
+   *free_md = FALSE;
+ 
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-  md = EVP_MD_fetch(NULL, "umac128", NULL);
++  proxy_libctx = proxy_ssh_provider_get_libctx();
++  md = EVP_MD_fetch(proxy_libctx, "umac128", "provider=umac");
+   if (md == NULL) {
+     pr_trace_msg(trace_channel, 4, "error fetching 'umac64' EVP_MD: %s",
+       proxy_ssh_crypto_get_errors());
+diff --git a/lib/proxy/ssh/provider.c b/lib/proxy/ssh/provider.c
+index 055758e3..f54a99f0 100644
+--- a/lib/proxy/ssh/provider.c
++++ b/lib/proxy/ssh/provider.c
+@@ -26,22 +26,14 @@
+ #include "proxy/ssh/umac.h"
+ #include "proxy/ssh/provider.h"
+ 
+-/* The mod_sftp module in ProFTPD 1.3.10rc2 also registers a 'umac' provider
+- * with OpenSSL; see Issue #2120.
+- *
+- * So we only need our copy of that provider if using an older version of
+- * ProFTPD.  Otherwise, we can reuse the algorithms provided by mod_sftp's
+- * provider.
+- */
+-
+-#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL) && \
+-    PROFTPD_VERSION_NUMBER < 0x0001030A02
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+ # include <openssl/core.h>
+ # include <openssl/core_dispatch.h>
+ # include <openssl/core_names.h>
+ # include <openssl/params.h>
+ # include <openssl/provider.h>
+ 
++static OSSL_LIB_CTX *proxy_libctx = NULL;
+ static OSSL_PROVIDER *umac_provider = NULL;
+ 
+ static const char *trace_channel = "proxy.ssh.provider";
+@@ -121,9 +113,9 @@ static int umac64_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   unsigned char nonce[8];
+ 
+   ctx = vctx;
+-
+   *out_len = outsz;
+ 
++  memset(nonce, 0, sizeof(nonce));
+   if (outsz != 0) {
+     res = proxy_ssh_umac_final(ctx, out, nonce);
+   }
+@@ -131,7 +123,7 @@ static int umac64_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   return res;
+ }
+ 
+-static int umac64_get_params(void *provctx, OSSL_PARAM params[]) {
++static int umac64_get_params(OSSL_PARAM params[]) {
+   OSSL_PARAM *p;
+   int ok = 1;
+ 
+@@ -204,9 +196,9 @@ static int umac128_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   unsigned char nonce[8];
+ 
+   ctx = vctx;
+-
+   *out_len = outsz;
+ 
++  memset(nonce, 0, sizeof(nonce));
+   if (outsz != 0) {
+     res = proxy_ssh_umac128_final(ctx, out, nonce);
+   }
+@@ -214,7 +206,7 @@ static int umac128_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   return res;
+ }
+ 
+-static int umac128_get_params(void *provctx, OSSL_PARAM params[]) {
++static int umac128_get_params(OSSL_PARAM params[]) {
+   OSSL_PARAM *p;
+   int ok = 1;
+ 
+@@ -254,8 +246,8 @@ static const OSSL_DISPATCH umac128_functions[] = {
+ };
+ 
+ static const OSSL_ALGORITHM umac_digests[] = {
+-  { "umac64", NULL, umac64_functions },
+-  { "umac128", NULL, umac128_functions },
++  { "umac64", "provider=umac", umac64_functions },
++  { "umac128", "provider=umac", umac128_functions },
+ 
+   { NULL, NULL, NULL }
+ };
+@@ -284,12 +276,27 @@ static int umac_provider_init(const OSSL_CORE_HANDLE *core,
+ 
+   return 1;
+ }
+-#endif /* OpenSSL 4.x and later, ProFTPD before 1.3.10rc2 */
++#endif /* OpenSSL 4.x and later */
++
++void *proxy_ssh_provider_get_libctx(void) {
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++  if (proxy_libctx != NULL) {
++    return proxy_libctx;
++  }
++#endif /* OpenSSL 4.x and later */
++
++  return NULL;
++}
+ 
+ int proxy_ssh_provider_init(void) {
+-#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL) && \
+-    PROFTPD_VERSION_NUMBER < 0x0001030A02
+-  if (OSSL_PROVIDER_add_builtin(NULL, "umac", umac_provider_init) != 1) {
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++  /* Allocate a custom library context for our providers, so that no one else
++   * uses our providers.
++   */
++  proxy_libctx = OSSL_LIB_CTX_new();
++
++  if (OSSL_PROVIDER_add_builtin(proxy_libctx, "umac",
++      umac_provider_init) != 1) {
+     pr_log_debug(DEBUG1, MOD_PROXY_VERSION
+       ": error registering 'umac' OpenSSL provider: %s",
+       proxy_ssh_crypto_get_errors());
+@@ -299,7 +306,7 @@ int proxy_ssh_provider_init(void) {
+   }
+ 
+   /* Load our custom OpenSSL algorithm provider. */
+-  umac_provider = OSSL_PROVIDER_load(NULL, "umac");
++  umac_provider = OSSL_PROVIDER_load(proxy_libctx, "umac");
+   if (umac_provider == NULL) {
+     pr_log_pri(PR_LOG_NOTICE, MOD_PROXY_VERSION
+       ": error loading 'umac' OpenSSL provider: %s",
+@@ -308,17 +315,21 @@ int proxy_ssh_provider_init(void) {
+   } else {
+     pr_trace_msg(trace_channel, 9, "%s", "loaded 'umac' OpenSSL provider");
+   }
+-#endif /* OpenSSL 4.x and later, ProFTPD before 1.3.10rc2 */
++#endif /* OpenSSL 4.x and later */
+ 
+   return 0;
+ }
+ 
+ void proxy_ssh_provider_free(void) {
+-#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL) && \
+-    PROFTPD_VERSION_NUMBER < 0x0001030A02
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+   if (umac_provider != NULL) {
+     OSSL_PROVIDER_unload(umac_provider);
+     umac_provider = NULL;
+   }
+-#endif /* OpenSSL 4.x and later, ProFTPD before 1.3.10rc2 */
++
++  if (proxy_libctx != NULL) {
++    OSSL_LIB_CTX_free(proxy_libctx);
++    proxy_libctx = NULL;
++  }
++#endif /* OpenSSL 4.x and later */
+ }

diff --git a/d1fd858b.patch b/d1fd858b.patch
new file mode 100644
index 0000000..bca26b2
--- /dev/null
+++ b/d1fd858b.patch
@@ -0,0 +1,195 @@
+From d1fd858b50894388089a1d275c635bcef17f98a2 Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Fri, 20 Nov 2026 09:20:22 -0800
+Subject: [PATCH] Issue #2484: Now that we use custom library contexts for
+ registering custom OpenSSL 4.x providers, we need to _use_ those library
+ contexts when fetching the provided algorithms.
+
+---
+ contrib/mod_digest.c        |  2 +-
+ contrib/mod_sftp/crypto.c   | 12 ++++++++--
+ contrib/mod_sftp/provider.c | 45 ++++++++++++++++++++++++++-----------
+ contrib/mod_sftp/provider.h |  5 +++++
+ 4 files changed, 48 insertions(+), 16 deletions(-)
+
+diff --git a/contrib/mod_digest.c b/contrib/mod_digest.c
+index 16d51664a1..b02289d3cc 100644
+--- a/contrib/mod_digest.c
++++ b/contrib/mod_digest.c
+@@ -1356,7 +1356,7 @@ static const EVP_MD *get_algo_md(unsigned long algo, int *free_md) {
+   switch (algo) {
+     case DIGEST_ALGO_CRC32:
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-      md = EVP_MD_fetch(NULL, "crc32", NULL);
++      md = EVP_MD_fetch(digest_libctx, "crc32", NULL);
+       if (md == NULL) {
+         pr_trace_msg(trace_channel, 3, "error obtaining CRC32 EVP_MD: %s",
+           get_errors());
+diff --git a/contrib/mod_sftp/crypto.c b/contrib/mod_sftp/crypto.c
+index 736a7a8082..68de8da114 100644
+--- a/contrib/mod_sftp/crypto.c
++++ b/contrib/mod_sftp/crypto.c
+@@ -1018,11 +1018,15 @@ static int delete_umac128(EVP_MD_CTX *ctx) {
+ 
+ static const EVP_MD *get_umac64_digest(int *free_md) {
+   EVP_MD *md = NULL;
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++  OSSL_LIB_CTX *sftp_libctx = NULL;
++#endif /* OpenSSL 4.x and later */
+ 
+   *free_md = FALSE;
+ 
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-  md = EVP_MD_fetch(NULL, "umac64", NULL);
++  sftp_libctx = sftp_provider_get_libctx();
++  md = EVP_MD_fetch(sftp_libctx, "umac64", "provider=umac");
+   if (md == NULL) {
+     pr_trace_msg(trace_channel, 4, "error fetching 'umac64' EVP_MD: %s",
+       sftp_crypto_get_errors());
+@@ -1067,11 +1071,15 @@ static const EVP_MD *get_umac64_digest(int *free_md) {
+ 
+ static const EVP_MD *get_umac128_digest(int *free_md) {
+   EVP_MD *md = NULL;
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++  OSSL_LIB_CTX *sftp_libctx = NULL;
++#endif /* OpenSSL 4.x and later */
+ 
+   *free_md = FALSE;
+ 
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-  md = EVP_MD_fetch(NULL, "umac128", NULL);
++  sftp_libctx = sftp_provider_get_libctx();
++  md = EVP_MD_fetch(sftp_libctx, "umac128", "provider=umac");
+   if (md == NULL) {
+     pr_trace_msg(trace_channel, 4, "error fetching 'umac128' EVP_MD: %s",
+       sftp_crypto_get_errors());
+diff --git a/contrib/mod_sftp/provider.c b/contrib/mod_sftp/provider.c
+index 3848c163c9..448e70bd5d 100644
+--- a/contrib/mod_sftp/provider.c
++++ b/contrib/mod_sftp/provider.c
+@@ -117,7 +117,7 @@ static int umac64_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   return res;
+ }
+ 
+-static int umac64_get_params(void *provctx, OSSL_PARAM params[]) {
++static int umac64_get_params(OSSL_PARAM params[]) {
+   OSSL_PARAM *p;
+   int ok = 1;
+ 
+@@ -159,7 +159,7 @@ static const OSSL_DISPATCH umac64_functions[] = {
+   { OSSL_FUNC_DIGEST_GET_PARAMS, (void (*)(void)) umac64_get_params },
+   { OSSL_FUNC_DIGEST_GETTABLE_PARAMS, (void (*)(void)) umac64_gettable_params },
+ 
+-  { 0, NULL }
++  OSSL_DISPATCH_END
+ };
+ 
+ /* UMAC128 */
+@@ -206,7 +206,7 @@ static int umac128_md_final(void *vctx, unsigned char *out, size_t *out_len,
+   return res;
+ }
+ 
+-static int umac128_get_params(void *provctx, OSSL_PARAM params[]) {
++static int umac128_get_params(OSSL_PARAM params[]) {
+   OSSL_PARAM *p;
+   int ok = 1;
+ 
+@@ -248,14 +248,15 @@ static const OSSL_DISPATCH umac128_functions[] = {
+   { OSSL_FUNC_DIGEST_GET_PARAMS, (void (*)(void)) umac128_get_params },
+   { OSSL_FUNC_DIGEST_GETTABLE_PARAMS, (void (*)(void)) umac128_gettable_params },
+ 
+-  { 0, NULL }
++  OSSL_DISPATCH_END
+ };
+ 
+-static const OSSL_ALGORITHM umac_digests[] = {
+-  { "umac64", NULL, umac64_functions },
+-  { "umac128", NULL, umac128_functions },
++/* UMAC Provider tables */
+ 
+-  { NULL, NULL, NULL }
++static const OSSL_ALGORITHM umac_digests[] = {
++  { "umac64", "provider=umac", umac64_functions, "UMAC-64" },
++  { "umac128", "provider=umac", umac128_functions, "UMAC-128" },
++  { NULL, NULL, NULL, NULL }
+ };
+ 
+ static const OSSL_ALGORITHM *umac_provider_operations(void *provctx,
+@@ -272,7 +273,7 @@ static const OSSL_ALGORITHM *umac_provider_operations(void *provctx,
+ static const OSSL_DISPATCH umac_provider_functions[] = {
+   { OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void)) umac_provider_operations },
+ 
+-  { 0, NULL }
++  OSSL_DISPATCH_END
+ };
+ 
+ static int umac_provider_init(const OSSL_CORE_HANDLE *core,
+@@ -282,30 +283,48 @@ static int umac_provider_init(const OSSL_CORE_HANDLE *core,
+ 
+   return 1;
+ }
++#endif /* OpenSSL 4.x and later */
+ 
++void *sftp_provider_get_libctx(void) {
++#if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
++  if (sftp_libctx != NULL) {
++    return sftp_libctx;
++  }
+ #endif /* OpenSSL 4.x and later */
+ 
++  return NULL;
++}
++
+ int sftp_provider_init(void) {
+ #if OPENSSL_VERSION_NUMBER >= 0x40000000L && !defined(HAVE_LIBRESSL)
+-  /* Allocate a custom library context for our provider, so that no one else
++  /* Allocate a custom library context for our providers, so that no one else
+    * uses our providers.
+    */
+   sftp_libctx = OSSL_LIB_CTX_new();
++  if (sftp_libctx == NULL) {
++    pr_log_debug(DEBUG1, MOD_SFTP_VERSION
++      ": error allocating custom OpenSSL library context: %s",
++      sftp_crypto_get_errors());
++    return -1;
++  }
++
+   if (OSSL_PROVIDER_add_builtin(sftp_libctx, "umac", umac_provider_init) != 1) {
+     pr_log_debug(DEBUG1, MOD_SFTP_VERSION
+       ": error registering 'umac' OpenSSL provider: %s",
+       sftp_crypto_get_errors());
+ 
+   } else {
+-    pr_trace_msg(trace_channel, 9, "%s", "registered 'umac' OpenSSL provider");
++    pr_trace_msg(trace_channel, 9, "%s",
++      "registered 'umac' OpenSSL provider");
+   }
+ 
+   /* Load our custom OpenSSL algorithm provider. */
+   umac_provider = OSSL_PROVIDER_load(sftp_libctx, "umac");
+   if (umac_provider == NULL) {
+     pr_log_pri(PR_LOG_NOTICE, MOD_SFTP_VERSION
+-      ": error loading 'umac' OpenSSL provider: %s", sftp_crypto_get_errors());
+- 
++      ": error loading 'umac' OpenSSL provider: %s",
++      sftp_crypto_get_errors());
++
+   } else {
+     pr_trace_msg(trace_channel, 9, "%s", "loaded 'umac' OpenSSL provider");
+   }
+diff --git a/contrib/mod_sftp/provider.h b/contrib/mod_sftp/provider.h
+index eeaaf246e9..4fcb75febc 100644
+--- a/contrib/mod_sftp/provider.h
++++ b/contrib/mod_sftp/provider.h
+@@ -26,6 +26,11 @@
+ 
+ #include "mod_sftp.h"
+ 
++/* Obtain the module-specific "library context" with which our custom
++ * UMAC providers are registered.
++ */
++void *sftp_provider_get_libctx(void);
++
+ int sftp_provider_init(void);
+ void sftp_provider_free(void);
+ 

diff --git a/proftpd.spec b/proftpd.spec
index 0193e71..ad98d91 100644
--- a/proftpd.spec
+++ b/proftpd.spec
@@ -17,7 +17,7 @@
 %undefine _strict_symbol_defs_build
 
 #global prever rc4
-%global baserelease 4
+%global baserelease 5
 %global mod_procfs_version 0.3
 %global mod_proxy_version 0.9.7
 %global mod_vroot_version 0.9.12
@@ -50,6 +50,11 @@ Patch7:			proftpd-1.3.9e-gh2095.patch
 Patch8:			proftpd-1.3.9e-gh2374.patch
 Patch9:			https://github.com/proftpd/proftpd/commit/549f8174.patch
 Patch10:		https://github.com/proftpd/proftpd/commit/58c9a9cb.patch
+Patch11:		https://github.com/proftpd/proftpd/commit/2f687819.patch
+Patch12:		https://github.com/proftpd/proftpd/commit/d1fd858b.patch
+Patch13:		https://github.com/proftpd/proftpd/commit/44088468.patch
+Patch14:		https://github.com/Castaglia/proftpd-mod_proxy/commit/d16026d5.patch
+Patch15:		https://github.com/proftpd/proftpd/commit/18535936.patch
 
 BuildRequires:		coreutils
 BuildRequires:		gcc
@@ -254,6 +259,19 @@ mv contrib/README contrib/README.contrib
 # Further fixes from glibc glob(3)
 %patch -P10 -p1 -b .glob
 
+# ProFTPD modules use OpenSSL 4.x custom providers that collide with defaults, causing segfaults
+# https://github.com/proftpd/proftpd/issues/2484
+%patch -P11 -p1 -b .gh2484.1
+%patch -P12 -p1 -b .gh2484.2
+%patch -P13 -p1 -b .gh2484.3
+cd contrib/mod_proxy
+%patch -P14 -p1 -b .gh2484.4
+cd -
+
+# Address Auth API error mishandling/mismatch allowing for inadvertent authentication bypass
+# https://github.com/proftpd/proftpd/issues/2497
+%patch -P15 -p1 -b .gh2497
+
 # Tweak logrotate script for systemd compatibility (#802178)
 sed -i -e '/killall/s/test.*/systemctl try-reload-or-restart proftpd.service/' \
 	contrib/dist/rpm/proftpd.logrotate
@@ -493,6 +511,12 @@ fi
 %{_mandir}/man1/ftpwho.1*
 
 %changelog
+* Sun Nov 22 2026 Paul Howarth <paul@city-fan.org> - 1.3.9e-5
+- ProFTPD modules used OpenSSL 4.x custom providers that collide with defaults,
+  causing segfaults (GH#2484)
+- Address Auth API error mishandling/mismatch allowing for inadvertent
+  authentication bypass (GH#2497)
+
 * Thu Nov 19 2026 Paul Howarth <paul@city-fan.org> - 1.3.9e-4
 - Backport a fix from glibc glob(3) for handling unbalanced brace expansions,
   which could have lead to a stack overflow (GH#2473)

                 reply	other threads:[~2026-11-23 17:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179545349306.1.13957907155209634126.rpms-proftpd-04304e309eab@fedoraproject.org \
    --to=paul@city-fan.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox