Changeset b077bdd in mod_gnutls


Ignore:
Timestamp:
Dec 3, 2007, 4:09:43 PM (12 years ago)
Author:
Nokis Mavrogiannopoulos <nmav@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, msva, upstream
Children:
3b83e00
Parents:
8e2a483
git-author:
Nikos Mavrogiannopoulos <nmav@…> (12/03/07 16:09:43)
git-committer:
Nokis Mavrogiannopoulos <nmav@…> (12/03/07 16:09:43)
Message:

added more error checks.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r8e2a483 rb077bdd  
    7373    }
    7474
    75     gnutls_dh_params_init(&sc->dh_params);
     75    ret = gnutls_dh_params_init(&sc->dh_params);
     76    if (ret < 0) {
     77        return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize"
     78                            ": (%d) %s", ret, gnutls_strerror(ret));
     79    }
     80
    7681    ret =
    7782        gnutls_dh_params_import_pkcs3(sc->dh_params, &data, GNUTLS_X509_FMT_PEM);
    78     if (ret != 0) {
     83    if (ret < 0) {
    7984        return apr_psprintf(parms->pool, "GnuTLS: Failed to Import "
    8085                            "DH params '%s': (%d) %s", file, ret,
     
    108113    }
    109114
    110     gnutls_rsa_params_init(&sc->rsa_params);
     115    ret = gnutls_rsa_params_init(&sc->rsa_params);
     116    if (ret < 0) {
     117        return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize"
     118                            ": (%d) %s", ret, gnutls_strerror(ret));
     119    }
     120
    111121    ret =
    112122        gnutls_rsa_params_import_pkcs1(sc->rsa_params, &data, GNUTLS_X509_FMT_PEM);
     
    142152    }
    143153
    144     gnutls_x509_crt_init(&sc->cert_x509);
     154    ret = gnutls_x509_crt_init(&sc->cert_x509);
     155    if (ret < 0) {
     156        return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize"
     157                            ": (%d) %s", ret, gnutls_strerror(ret));
     158    }
     159
    145160    ret =
    146161        gnutls_x509_crt_import(sc->cert_x509, &data, GNUTLS_X509_FMT_PEM);
     
    175190    }
    176191
    177     gnutls_x509_privkey_init(&sc->privkey_x509);
     192    ret = gnutls_x509_privkey_init(&sc->privkey_x509);
     193    if (ret < 0) {
     194        return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize"
     195                            ": (%d) %s", ret, gnutls_strerror(ret));
     196    }
     197
    178198    ret =
    179199        gnutls_x509_privkey_import(sc->privkey_x509, &data,
     
    396416{
    397417    mgs_srvconf_rec *sc = apr_pcalloc(p, sizeof(*sc));
    398 
     418    int ret;
     419   
    399420    sc->enabled = GNUTLS_ENABLED_FALSE;
    400421
    401     gnutls_certificate_allocate_credentials(&sc->certs);
    402     gnutls_anon_allocate_server_credentials(&sc->anon_creds);
    403     gnutls_srp_allocate_server_credentials(&sc->srp_creds);
     422    ret = gnutls_certificate_allocate_credentials(&sc->certs);
     423    if (ret < 0) {
     424        return apr_psprintf(p, "GnuTLS: Failed to initialize"
     425                            ": (%d) %s", ret, gnutls_strerror(ret));
     426    }
     427
     428    ret = gnutls_anon_allocate_server_credentials(&sc->anon_creds);
     429    if (ret < 0) {
     430        return apr_psprintf(p, "GnuTLS: Failed to initialize"
     431                            ": (%d) %s", ret, gnutls_strerror(ret));
     432    }
     433
     434    ret = gnutls_srp_allocate_server_credentials(&sc->srp_creds);
     435    if (ret < 0) {
     436        return apr_psprintf(p, "GnuTLS: Failed to initialize"
     437                            ": (%d) %s", ret, gnutls_strerror(ret));
     438    }
    404439
    405440    sc->srp_tpasswd_conf_file = NULL;
  • src/gnutls_hooks.c

    r8e2a483 rb077bdd  
    5858                    apr_pool_t * plog, apr_pool_t * ptemp)
    5959{
     60int ret;
    6061
    6162#if APR_HAS_THREADS
     
    6869#endif
    6970
    70     gnutls_global_init();
    71 
     71    ret = gnutls_global_init();
     72    if (ret < 0) /* FIXME: can we print here? */
     73        exit(ret);
     74                                           
    7275    apr_pool_cleanup_register(pconf, NULL, mgs_cleanup_pre_config,
    7376                              apr_pool_cleanup_null);
Note: See TracChangeset for help on using the changeset viewer.