Changeset 792a93b for conf.c


Ignore:
Timestamp:
2011-12-23T12:44:08Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
200e151
Parents:
2d93a51e (diff), 41658da (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:

Merging SSL certificate verification for GnuTLS, with help from AopicieR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    r2d93a51e r792a93b  
    6767        conf->ft_listen = NULL;
    6868        conf->protocols = NULL;
     69        conf->cafile = NULL;
    6970        proxytype = 0;
    7071       
     
    177178                fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", global.conf_file );
    178179       
     180        if( conf->cafile && access( conf->cafile, R_OK ) != 0 )
     181        {
     182                /* Let's treat this as a serious problem so people won't think
     183                   they're secure when in fact they're not. */
     184                fprintf( stderr, "Error: Could not read CA file %s: %s\n", conf->cafile, strerror( errno ) );
     185                return NULL;
     186        }
     187       
    179188        return conf;
    180189}
     
    340349                                conf->protocols = g_strsplit_set( ini->value, " \t,;", -1 );
    341350                        }
     351                        else if( g_strcasecmp( ini->key, "cafile" ) == 0 )
     352                        {
     353                                g_free( conf->cafile );
     354                                conf->cafile = g_strdup( ini->value );
     355                        }
    342356                        else
    343357                        {
Note: See TracChangeset for help on using the changeset viewer.