Changeset 8365

Show
Ignore:
Timestamp:
06/08/10 11:55:08 (4 years ago)
Author:
nlmills
Message:

more work to allow robust security to be disabled

Location:
branches/cu-security-branch/src
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/cu-security-branch/src/apps/admin/pvfs2-gencred.c

    r8354 r8365  
    1818#include <unistd.h> 
    1919 
     20#ifdef ENABLE_SECURITY 
    2021#include <openssl/err.h> 
    2122#include <openssl/evp.h> 
    2223#include <openssl/pem.h> 
     24#endif 
    2325 
    2426#define __PINT_REQPROTO_ENCODE_FUNCS_C 
     
    132134} 
    133135 
     136#ifdef ENABLE_SECURITY 
     137 
    134138static int sign_credential(PVFS_credential *cred, time_t timeout, 
    135139    const char *keypath) 
     
    222226} 
    223227 
     228#else /* !ENABLE_SECURITY */ 
     229 
     230static int sign_credential(PVFS_credential *cred, time_t timeout, 
     231    const char *keypath) 
     232{ 
     233    cred->timeout = (PVFS_time)(time(NULL) + timeout); 
     234    cred->sig_size = 0; 
     235    cred->signature = NULL; 
     236 
     237    return 0; 
     238} 
     239 
     240#endif /* ENABLE_SECURITY */ 
     241 
    224242static int write_credential(const PVFS_credential *cred,  
    225243    const struct passwd *pwd) 
     
    261279    } 
    262280     
     281#ifdef ENABLE_SECURITY 
    263282    OpenSSL_add_all_algorithms(); 
    264283    ERR_load_crypto_strings(); 
     284#endif 
    265285     
    266286    pwd = opts.user ? getpwnam(opts.user) : getpwuid(getuid()); 
  • branches/cu-security-branch/src/apps/admin/pvfs2-migrate-collection.c

    r7941 r8365  
    174174    } 
    175175 
     176    memset(&server_config, 0, sizeof(server_config)); 
    176177    ret = PINT_parse_config(&server_config, opts.fs_conf, server_alias); 
    177178    if(ret < 0) 
  • branches/cu-security-branch/src/client/sysint/pint-sysint-utils.c

    r8354 r8365  
    77#include <unistd.h> 
    88#include <sys/types.h> 
    9  
    10 #include <openssl/crypto.h> 
    11 #include <openssl/err.h> 
    12 #include <openssl/evp.h> 
    139 
    1410#include "pvfs2-sysint.h" 
     
    2622 
    2723 
     24#ifdef HAVE_OPENSSL 
     25 
     26#include <openssl/crypto.h> 
     27#include <openssl/err.h> 
     28#include <openssl/evp.h> 
     29 
     30 
    2831static gen_mutex_t security_init_mutex = GEN_MUTEX_INITIALIZER; 
    2932static gen_mutex_t *openssl_mutexes = NULL; 
     
    4649                                 int); 
    4750 
     51#endif /* HAVE_OPENSSL */ 
     52 
    4853 
    4954/* 
     
    105110    return 0; 
    106111} 
     112 
     113/* Certain functions outside of the security code use OpenSSL 
     114 * (e.g. src/common/misc/digest.c) 
     115 */ 
     116#ifdef HAVE_OPENSSL 
    107117 
    108118/* nlmills: TODO: document me */ 
     
    293303    free(l); 
    294304} 
     305 
     306#else /* !HAVE_OPENSSL */ 
     307 
     308int PINT_client_security_initialize(void) 
     309{ 
     310    return 0; 
     311} 
     312 
     313int PINT_client_security_finalize(void) 
     314{ 
     315    return 0; 
     316} 
     317 
     318#endif /* HAVE_OPENSSL */ 
    295319    
    296320 
  • branches/cu-security-branch/src/common/misc/server-config.c

    r8332 r8365  
    10381038    } 
    10391039 
     1040#ifdef ENABLE_SECURITY 
    10401041    if (server_alias_name && !config_s->keystore_path) 
    10411042    { 
     
    10501051        return 1; 
    10511052    } 
     1053#endif /* ENABLE_SECURITY */ 
    10521054 
    10531055    return 0;