Navigation


Changeset 1006:6ce8322f3b78 in freeDiameter


Ignore:
Timestamp:
Mar 22, 2013, 4:28:23 AM (11 years ago)
Author:
Thomas Klausner <tk@giga.or.at>
Branch:
default
Phase:
public
Message:

Report an error if a problem is big enough to break startup.

Location:
libfdcore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/config.c

    r994 r1006  
    274274                                        GNUTLS_X509_FMT_PEM),
    275275                                {
    276                                         TRACE_DEBUG(INFO, "Unable to use the local certificate as trusted security anchor (CA), please provide a valid TLS_CA='...' directive.");
     276                                        TRACE_ERROR("Unable to use the local certificate as trusted security anchor (CA), please provide a valid TLS_CA='...' directive.");
    277277                                        return EINVAL;
    278278                                } );
     
    362362                                        GNUTLS_DEFAULT_PRIORITY,
    363363                                        &err_pos),
    364                                  { TRACE_DEBUG(INFO, "Error in priority string at position : %s", err_pos); return EINVAL; } );
     364                                 { TRACE_ERROR("Error in priority string at position : %s", err_pos); return EINVAL; } );
    365365        }
    366366       
     
    400400                                ),
    401401                        {
    402                                 TRACE_DEBUG(INFO, "Failed to import the data from file '%s'", fd_g_config->cnf_sec_data.cert_file);
     402                                TRACE_ERROR("Failed to import the data from file '%s'", fd_g_config->cnf_sec_data.cert_file);
    403403                                free(certfile.data);
    404404                                return EINVAL;
     
    442442                                fd_log_debug("TLS: Local certificate chain '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
    443443                                if (output & GNUTLS_CERT_SIGNER_NOT_FOUND)
    444                                         fd_log_debug(" - The certificate hasn't got a known issuer.");
     444                                        TRACE_ERROR(" - The certificate hasn't got a known issuer.");
    445445                                if (output & GNUTLS_CERT_SIGNER_NOT_CA)
    446                                         fd_log_debug(" - The certificate signer is not a CA, or uses version 1, or 3 without basic constraints.");
     446                                        TRACE_ERROR(" - The certificate signer is not a CA, or uses version 1, or 3 without basic constraints.");
    447447                                if (output & GNUTLS_CERT_NOT_ACTIVATED)
    448                                         fd_log_debug(" - The certificate is not yet activated.");
     448                                        TRACE_ERROR(" - The certificate is not yet activated.");
    449449                                if (output & GNUTLS_CERT_EXPIRED)
    450                                         fd_log_debug(" - The certificate is expired.");
     450                                        TRACE_ERROR(" - The certificate is expired.");
    451451                                return EINVAL;
    452452                        }
     
    455455                        if (!gnutls_x509_crt_check_hostname (certs[0], fd_g_config->cnf_diamid))
    456456                        {
    457                                 fd_log_debug("TLS: The certificate owner does not match the hostname '%s'", fd_g_config->cnf_diamid);
     457                                TRACE_ERROR("TLS: The certificate owner does not match the hostname '%s'", fd_g_config->cnf_diamid);
    458458                                return EINVAL;
    459459                        }
     
    478478                        CHECK_GNUTLS_DO( gnutls_x509_crt_list_verify(certs, cert_max, CA_list, CA_list_length, CRL_list, CRL_list_length, 0, &verify),
    479479                                {
    480                                         TRACE_DEBUG(INFO, "Failed to verify the local certificate '%s' against local credentials. Please check your certificate is valid.", fd_g_config->cnf_sec_data.cert_file);
     480                                        TRACE_ERROR(INFO, "Failed to verify the local certificate '%s' against local credentials. Please check your certificate is valid.", fd_g_config->cnf_sec_data.cert_file);
    481481                                        return EINVAL;
    482482                                } );
     
    485485                                fd_log_debug("TLS: Local certificate chain '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
    486486                                if (verify & GNUTLS_CERT_INVALID)
    487                                         fd_log_debug(" - The certificate is not trusted (unknown CA? expired?)");
     487                                        TRACE_ERROR(" - The certificate is not trusted (unknown CA? expired?)");
    488488                                if (verify & GNUTLS_CERT_REVOKED)
    489                                         fd_log_debug(" - The certificate has been revoked.");
     489                                        TRACE_ERROR(" - The certificate has been revoked.");
    490490                                if (verify & GNUTLS_CERT_SIGNER_NOT_FOUND)
    491                                         fd_log_debug(" - The certificate hasn't got a known issuer.");
     491                                        TRACE_ERROR(" - The certificate hasn't got a known issuer.");
    492492                                if (verify & GNUTLS_CERT_SIGNER_NOT_CA)
    493                                         fd_log_debug(" - The certificate signer is not a CA, or uses version 1, or 3 without basic constraints.");
     493                                        TRACE_ERROR(" - The certificate signer is not a CA, or uses version 1, or 3 without basic constraints.");
    494494                                if (verify & GNUTLS_CERT_INSECURE_ALGORITHM)
    495                                         fd_log_debug(" - The certificate signature uses a weak algorithm.");
     495                                        TRACE_ERROR(" - The certificate signature uses a weak algorithm.");
    496496                                return EINVAL;
    497497                        }
     
    499499                        /* Check the local Identity is valid with the certificate */
    500500                        if (!gnutls_x509_crt_check_hostname (certs[0], fd_g_config->cnf_diamid)) {
    501                                 fd_log_debug("TLS: Local certificate '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
    502                                 fd_log_debug(" - The certificate hostname does not match '%s'", fd_g_config->cnf_diamid);
     501                                TRACE_ERROR("TLS: Local certificate '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
     502                                TRACE_ERROR(" - The certificate hostname does not match '%s'", fd_g_config->cnf_diamid);
    503503                                return EINVAL;
    504504                        }
     
    512512                                GNUTLS_TRACE( deadline = gnutls_x509_crt_get_expiration_time(certs[i]) );
    513513                                if ((deadline != (time_t)-1) && (deadline < now)) {
    514                                         fd_log_debug("TLS: Local certificate chain '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
    515                                         fd_log_debug(" - The certificate %d in the chain is expired", i);
     514                                        TRACE_ERROR("TLS: Local certificate chain '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
     515                                        TRACE_ERROR(" - The certificate %d in the chain is expired", i);
    516516                                        return EINVAL;
    517517                                }
     
    519519                                GNUTLS_TRACE( deadline = gnutls_x509_crt_get_activation_time(certs[i]) );
    520520                                if ((deadline != (time_t)-1) && (deadline > now)) {
    521                                         fd_log_debug("TLS: Local certificate chain '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
    522                                         fd_log_debug(" - The certificate %d in the chain is not yet activated", i);
     521                                        TRACE_ERROR("TLS: Local certificate chain '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
     522                                        TRACE_ERROR(" - The certificate %d in the chain is not yet activated", i);
    523523                                        return EINVAL;
    524524                                }
     
    582582                                        &dhparams,
    583583                                        GNUTLS_X509_FMT_PEM),
    584                                          { TRACE_DEBUG(INFO, "Error in DH bits value : %d", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS); return EINVAL; } );
     584                                         { TRACE_ERROR("Error in DH bits value : %d", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS); return EINVAL; } );
    585585                free(dhparams.data);
    586586               
     
    590590                                        fd_g_config->cnf_sec_data.dh_cache,
    591591                                        fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS),
    592                                          { TRACE_DEBUG(INFO, "Error in DH bits value : %d", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS); return EINVAL; } );
     592                                         { TRACE_ERROR("Error in DH bits value : %d", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS); return EINVAL; } );
    593593        }                       
    594594       
  • libfdcore/extensions.c

    r974 r1006  
    126126                if (li == &ext->chain) {
    127127                        /* the dependency was not found */
    128                         TRACE_DEBUG(NONE, "Error: extension [%s] depends on [%s] which was not loaded first. Please fix your configuration file.",
     128                        TRACE_ERROR("Error: extension [%s] depends on [%s] which was not loaded first. Please fix your configuration file.",
    129129                                ext->ext_name, ext->depends[i]);
    130130                        return ESRCH;
     
    162162                if (ext->handler == NULL) {
    163163                        /* An error occured */
    164                         TRACE_DEBUG( NONE, "Loading of extension %s failed: %s", ext->filename, dlerror());
     164                        TRACE_ERROR("Loading of extension %s failed: %s", ext->filename, dlerror());
    165165                        #ifdef DEBUG
    166166                        ext->handler = dlopen(ext->filename, RTLD_LAZY | RTLD_GLOBAL);
    167167                        if (ext->handler) {
    168168                                if (!check_dependencies(ext)) {
    169                                         TRACE_DEBUG( NONE, "In addition, all declared dependencies are satisfied (Internal Error!)");
     169                                        TRACE_ERROR("In addition, not all declared dependencies are satisfied (Internal Error!)");
    170170                                }
    171171                        }
     
    182182                if (fd_ext_init == NULL) {
    183183                        /* An error occured */
    184                         TRACE_DEBUG( NONE, "Unable to resolve symbol 'fd_ext_init' for extension %s: %s", ext->filename, dlerror());
     184                        TRACE_ERROR("Unable to resolve symbol 'fd_ext_init' for extension %s: %s", ext->filename, dlerror());
    185185                        return EINVAL;
    186186                }
     
    201201                if (ret != 0) {
    202202                        /* The extension was unable to load cleanly */
    203                         TRACE_DEBUG( NONE, "Extension %s returned an error during initialization: %s", ext->filename, strerror(ret));
     203                        TRACE_ERROR("Extension %s returned an error during initialization: %s", ext->filename, strerror(ret));
    204204                        return ret;
    205205                }
Note: See TracChangeset for help on using the changeset viewer.