Changeset 45b7b83 in mod_gnutls


Ignore:
Timestamp:
Jun 15, 2016, 6:02:00 PM (18 months ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
master, debian, upstream
Children:
eee1432
Parents:
db9ef68
Message:

Deinit PGP private key and keyring on config pool cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    rdb9ef68 r45b7b83  
    151151    }
    152152
     153    if (sc->privkey_pgp)
     154    {
     155        gnutls_privkey_deinit(sc->privkey_pgp);
     156        sc->privkey_pgp = NULL;
     157#if GNUTLS_VERSION_NUMBER < 0x030312
     158        gnutls_openpgp_privkey_deinit(sc->privkey_pgp_internal);
     159        sc->privkey_pgp_internal = NULL;
     160#endif
     161    }
     162
     163    if (sc->pgp_list)
     164    {
     165        gnutls_openpgp_keyring_deinit(sc->pgp_list);
     166        sc->pgp_list = NULL;
     167    }
     168
    153169    if (sc->priorities)
    154170    {
     
    497513
    498514    /* Load the PGP key file */
    499     if (sc->pgp_key_file) {
     515    if (sc->pgp_key_file && sc->privkey_pgp == NULL)
     516    {
    500517        if (load_datum_from_file(spool, sc->pgp_key_file, &data) != 0) {
    501518            ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, s,
     
    573590
    574591    /* Load the keyring file */
    575     if (sc->pgp_ring_file)
     592    if (sc->pgp_ring_file && sc->pgp_list == NULL)
    576593    {
    577594        if (load_datum_from_file(spool, sc->pgp_ring_file, &data) != 0) {
     
    10481065
    10491066    sc->privkey_x509 = NULL;
    1050     sc->privkey_pgp = NULL;
    10511067    sc->anon_creds = NULL;
    10521068#ifdef ENABLE_SRP
     
    10571073    sc->p11_modules = NULL;
    10581074    sc->pin = NULL;
     1075
     1076    sc->privkey_pgp = NULL;
     1077#if GNUTLS_VERSION_NUMBER < 0x030312
     1078    sc->privkey_pgp_internal = NULL;
     1079#endif
     1080    sc->pgp_list = NULL;
     1081
    10591082    sc->priorities_str = NULL;
    10601083    sc->cache_timeout = -1;     /* -1 means "unset" */
Note: See TracChangeset for help on using the changeset viewer.