]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Do some cleanup of TLS cert expiration changes (Issue #1590) master
authorMichael R Sweet <msweet@msweet.org>
Tue, 28 Jul 2026 17:21:45 +0000 (13:21 -0400)
committerMichael R Sweet <msweet@msweet.org>
Tue, 28 Jul 2026 17:21:45 +0000 (13:21 -0400)
CHANGES.md
cups/tls-gnutls.c
cups/tls-openssl.c

index 8436359a9b2d4ac626bcbcccd70c4b0f4e0edd3a..c71cb2d086d2c67b9ef508b5b4cac4058494c2b3 100644 (file)
@@ -181,6 +181,7 @@ v2.5b1 - YYYY-MM-DD
 - Fixed A4 support in the `ippevepcl` program (Issue #1544)
 - Fixed issues with the environment variable support of CGI programs
   (Issue #1547)
+- Fixed renewal of expired self-signed certificates (Issue #1590)
 - Fixed potential crash bug in `cupsCheckDestSupported` function.
 - Removed hash support for SHA2-512-224 and SHA2-512-256.
 - Removed `mantohtml` script for generating html pages (use
index ed8fb1fb4046c5a387765b9f1d6fb54661d76eef..ceb46ddfce9e87ebcaebaa90aa103dccd3f89d52 100644 (file)
@@ -1847,7 +1847,7 @@ _httpTLSStart(http_t *http)               // I - Connection to server
         char   *creds = cupsCopyCredentials(tls_keypath, cn);
                                        // PEM-encoded certificate
 
-        have_creds = creds && cupsGetCredentialsExpiration(creds) > time(NULL);
+        have_creds = cupsGetCredentialsExpiration(creds) > time(NULL);
         free(creds);
       }
     }
@@ -2226,6 +2226,12 @@ gnutls_import_certs(
 
   DEBUG_printf("3gnutls_import_certs(credentials=\"%s\", num_certs=%p, certs=%p)", credentials, (void *)num_certs, (void *)certs);
 
+  if (!credentials)
+  {
+    *num_certs = 0;
+    return (NULL);
+  }
+
   // Import all certificates from the string...
   datum.data = (void *)credentials;
   datum.size = strlen(credentials);
index 1dd92028dee32fa72f37f5b98e412a7e4735eaae..c8fe57cf1531ad50973dd2b2d03283a97f728da0 100644 (file)
@@ -1929,7 +1929,7 @@ _httpTLSStart(http_t *http)               // I - Connection to server
         char   *creds = cupsCopyCredentials(tls_keypath, cn);
                                        // PEM-encoded certificate
 
-        have_creds = creds && cupsGetCredentialsExpiration(creds) > time(NULL);
+        have_creds = cupsGetCredentialsExpiration(creds) > time(NULL);
         free(creds);
       }
     }