@@ -898,20 +898,24 @@ cupsGetCredentialsTrust(
898898 _cups_globals_t * cg = _cupsGlobals (); // Per-thread globals
899899
900900
901+ DEBUG_printf ("cupsGetCredentialsTrust(path=\"%s\", common_name=\"%s\", credentials=%p, require_ca=%s)" , path , common_name , (void * )credentials , require_ca ? "true" : "false" );
902+
901903 // Range check input...
902904 if (!path )
903905 path = http_default_path (defpath , sizeof (defpath ));
904906
905907 if (!path || !credentials || !common_name )
906908 {
907909 _cupsSetError (IPP_STATUS_ERROR_INTERNAL , strerror (EINVAL ), false);
910+ DEBUG_printf ("1cupsGetCredentialsTrust: Returning %d." , HTTP_TRUST_UNKNOWN );
908911 return (HTTP_TRUST_UNKNOWN );
909912 }
910913
911914 // Load the credentials...
912915 if ((certs = openssl_load_x509 (credentials )) == NULL )
913916 {
914917 _cupsSetError (IPP_STATUS_ERROR_CUPS_PKI , _ ("Unable to import credentials." ), true);
918+ DEBUG_printf ("1cupsGetCredentialsTrust: Returning %d." , HTTP_TRUST_UNKNOWN );
915919 return (HTTP_TRUST_UNKNOWN );
916920 }
917921
@@ -1021,6 +1025,9 @@ cupsGetCredentialsTrust(
10211025 time_t curtime ; // Current date/time
10221026
10231027 time (& curtime );
1028+
1029+ DEBUG_printf ("1cupsGetCredentialsTrust: curtime=%ld, notBefore=%ld, notAfter=%ld" , (long )curtime , (long )openssl_get_date (cert , 0 ), (long )openssl_get_date (cert , 1 ));
1030+
10241031 if (curtime < openssl_get_date (cert , 0 ) || curtime > openssl_get_date (cert , 1 ))
10251032 {
10261033 _cupsSetError (IPP_STATUS_ERROR_CUPS_PKI , _ ("Credentials have expired." ), true);
@@ -1030,6 +1037,8 @@ cupsGetCredentialsTrust(
10301037
10311038 sk_X509_free (certs );
10321039
1040+ DEBUG_printf ("1cupsGetCredentialsTrust: Returning %d." , trust );
1041+
10331042 return (trust );
10341043}
10351044
0 commit comments