Changeset e86847d in mod_gnutls for src/gnutls_config.c


Ignore:
Timestamp:
Jan 11, 2013, 12:56:02 AM (8 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports
Children:
0ab45ea
Parents:
9a9f943 (diff), 2a2272d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge tag 'upstream/0.4.2'

Upstream version 0.4.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r9a9f943 re86847d  
    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    sc->certs_x509_num = MAX_CHAIN_SIZE;
    145155    ret =
    146         gnutls_x509_crt_import(sc->cert_x509, &data, GNUTLS_X509_FMT_PEM);
    147     if (ret != 0) {
     156        gnutls_x509_crt_list_import(sc->certs_x509, &sc->certs_x509_num, &data, GNUTLS_X509_FMT_PEM, 0);
     157    if (ret < 0) {
    148158        return apr_psprintf(parms->pool, "GnuTLS: Failed to Import "
    149159                            "Certificate '%s': (%d) %s", file, ret,
     
    175185    }
    176186
    177     gnutls_x509_privkey_init(&sc->privkey_x509);
     187    ret = gnutls_x509_privkey_init(&sc->privkey_x509);
     188    if (ret < 0) {
     189        return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize"
     190                            ": (%d) %s", ret, gnutls_strerror(ret));
     191    }
     192
    178193    ret =
    179194        gnutls_x509_privkey_import(sc->privkey_x509, &data,
     
    396411{
    397412    mgs_srvconf_rec *sc = apr_pcalloc(p, sizeof(*sc));
    398 
     413    int ret;
     414   
    399415    sc->enabled = GNUTLS_ENABLED_FALSE;
    400416
    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);
     417    ret = gnutls_certificate_allocate_credentials(&sc->certs);
     418    if (ret < 0) {
     419        return apr_psprintf(p, "GnuTLS: Failed to initialize"
     420                            ": (%d) %s", ret, gnutls_strerror(ret));
     421    }
     422
     423    ret = gnutls_anon_allocate_server_credentials(&sc->anon_creds);
     424    if (ret < 0) {
     425        return apr_psprintf(p, "GnuTLS: Failed to initialize"
     426                            ": (%d) %s", ret, gnutls_strerror(ret));
     427    }
     428
     429    ret = gnutls_srp_allocate_server_credentials(&sc->srp_creds);
     430    if (ret < 0) {
     431        return apr_psprintf(p, "GnuTLS: Failed to initialize"
     432                            ": (%d) %s", ret, gnutls_strerror(ret));
     433    }
    404434
    405435    sc->srp_tpasswd_conf_file = NULL;
    406436    sc->srp_tpasswd_file = NULL;
    407437    sc->privkey_x509 = NULL;
    408     sc->cert_x509 = NULL;
     438    memset( sc->certs_x509, 0, sizeof(sc->certs_x509));
     439    sc->certs_x509_num = 0;
    409440    sc->cache_timeout = apr_time_from_sec(300);
    410441    sc->cache_type = mgs_cache_dbm;
Note: See TracChangeset for help on using the changeset viewer.