Changeset 358


Ignore:
Timestamp:
11/06/08 14:28:46 (4 years ago)
Author:
ludovic.rousseau
Message:

remove trailing tab and space characters

Location:
trunk/src
Files:
58 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/common/NSPRerrs.h

    r244 r358  
    6262ER2( PR_LOAD_LIBRARY_ERROR,     "Failure to load dynamic library." ) 
    6363ER2( PR_UNLOAD_LIBRARY_ERROR,   "Failure to unload dynamic library." ) 
    64 ER2( PR_FIND_SYMBOL_ERROR,       
     64ER2( PR_FIND_SYMBOL_ERROR,  
    6565"Symbol not found in any of the loaded dynamic libraries." ) 
    6666ER2( PR_INSUFFICIENT_RESOURCES_ERROR, "Insufficient system resources." ) 
    67 ER2( PR_DIRECTORY_LOOKUP_ERROR,          
     67ER2( PR_DIRECTORY_LOOKUP_ERROR,  
    6868"A directory lookup on a network address has failed." ) 
    69 ER2( PR_TPD_RANGE_ERROR,                 
     69ER2( PR_TPD_RANGE_ERROR,  
    7070"Attempt to access a TPD key that is out of range." ) 
    7171ER2( PR_PROC_DESC_TABLE_FULL_ERROR, "Process open FD table is full." ) 
    7272ER2( PR_SYS_DESC_TABLE_FULL_ERROR, "System open FD table is full." ) 
    73 ER2( PR_NOT_SOCKET_ERROR,        
     73ER2( PR_NOT_SOCKET_ERROR,  
    7474"Network operation attempted on non-network file descriptor." ) 
    75 ER2( PR_NOT_TCP_SOCKET_ERROR,    
     75ER2( PR_NOT_TCP_SOCKET_ERROR,  
    7676"TCP-specific function attempted on a non-TCP file descriptor." ) 
    7777ER2( PR_SOCKET_ADDRESS_IS_BOUND_ERROR, "TCP file descriptor is already bound." ) 
    7878ER2( PR_NO_ACCESS_RIGHTS_ERROR, "Access Denied." ) 
    79 ER2( PR_OPERATION_NOT_SUPPORTED_ERROR,  
     79ER2( PR_OPERATION_NOT_SUPPORTED_ERROR, 
    8080"The requested operation is not supported by the platform." ) 
    81 ER2( PR_PROTOCOL_NOT_SUPPORTED_ERROR,  
     81ER2( PR_PROTOCOL_NOT_SUPPORTED_ERROR, 
    8282"The host operating system does not support the protocol requested." ) 
    8383ER2( PR_REMOTE_FILE_ERROR,      "Access to the remote file has been severed." ) 
    84 ER2( PR_BUFFER_OVERFLOW_ERROR,   
     84ER2( PR_BUFFER_OVERFLOW_ERROR,  
    8585"The value requested is too large to be stored in the data buffer provided." ) 
    8686ER2( PR_CONNECT_RESET_ERROR,    "TCP connection reset by peer." ) 
     
    8888ER2( PR_DEADLOCK_ERROR,         "The operation would have deadlocked." ) 
    8989ER2( PR_FILE_IS_LOCKED_ERROR,   "The file is already locked." ) 
    90 ER2( PR_FILE_TOO_BIG_ERROR,      
     90ER2( PR_FILE_TOO_BIG_ERROR,  
    9191"Write would result in file larger than the system allows." ) 
    9292ER2( PR_NO_DEVICE_SPACE_ERROR,  "The device for storing the file is full." ) 
    9393ER2( PR_PIPE_ERROR,             "Unused." ) 
    9494ER2( PR_NO_SEEK_DEVICE_ERROR,   "Unused." ) 
    95 ER2( PR_IS_DIRECTORY_ERROR,      
     95ER2( PR_IS_DIRECTORY_ERROR,  
    9696"Cannot perform a normal file operation on a directory." ) 
    9797ER2( PR_LOOP_ERROR,             "Symbolic link loop." ) 
    9898ER2( PR_NAME_TOO_LONG_ERROR,    "File name is too long." ) 
    9999ER2( PR_FILE_NOT_FOUND_ERROR,   "File not found." ) 
    100 ER2( PR_NOT_DIRECTORY_ERROR,     
     100ER2( PR_NOT_DIRECTORY_ERROR,  
    101101"Cannot perform directory operation on a normal file." ) 
    102 ER2( PR_READ_ONLY_FILESYSTEM_ERROR,  
     102ER2( PR_READ_ONLY_FILESYSTEM_ERROR, 
    103103"Cannot write to a read-only file system." ) 
    104 ER2( PR_DIRECTORY_NOT_EMPTY_ERROR,  
     104ER2( PR_DIRECTORY_NOT_EMPTY_ERROR, 
    105105"Cannot delete a directory that is not empty." ) 
    106 ER2( PR_FILESYSTEM_MOUNTED_ERROR,  
     106ER2( PR_FILESYSTEM_MOUNTED_ERROR, 
    107107"Cannot delete or rename a file object while the file system is busy." ) 
    108 ER2( PR_NOT_SAME_DEVICE_ERROR,   
     108ER2( PR_NOT_SAME_DEVICE_ERROR,  
    109109"Cannot rename a file to a file system on another device." ) 
    110 ER2( PR_DIRECTORY_CORRUPTED_ERROR,  
     110ER2( PR_DIRECTORY_CORRUPTED_ERROR, 
    111111"The directory object in the file system is corrupted." ) 
    112 ER2( PR_FILE_EXISTS_ERROR,       
     112ER2( PR_FILE_EXISTS_ERROR,  
    113113"Cannot create or rename a filename that already exists." ) 
    114 ER2( PR_MAX_DIRECTORY_ENTRIES_ERROR,  
     114ER2( PR_MAX_DIRECTORY_ENTRIES_ERROR, 
    115115"Directory is full.  No additional filenames may be added." ) 
    116 ER2( PR_INVALID_DEVICE_STATE_ERROR,  
     116ER2( PR_INVALID_DEVICE_STATE_ERROR, 
    117117"The required device was in an invalid state." ) 
    118118ER2( PR_DEVICE_IS_LOCKED_ERROR, "The device is locked." ) 
  • trunk/src/common/SECerrs.h

    r244 r358  
    148148ER3(SEC_ERROR_CA_CERT_INVALID,                  (SEC_ERROR_BASE + 36), 
    149149"Issuer certificate is invalid.") 
    150     
     150 
    151151ER3(SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID,      (SEC_ERROR_BASE + 37), 
    152152"Certificate path length constraint is invalid.") 
     
    376376ER3(SEC_ERROR_OLD_KRL,                          (SEC_ERROR_BASE + 110), 
    377377"New KRL is not later than the current one.") 
    378   
     378 
    379379ER3(SEC_ERROR_CKL_CONFLICT,                     (SEC_ERROR_BASE + 111), 
    380380"New CKL has different issuer than current CKL.  Delete current CKL.") 
  • trunk/src/common/algorithm.c

    r244 r358  
    2828ALGORITHM_TYPE Alg_get_alg_from_string(const char *hashString) 
    2929{ 
    30     /* sigh, we don't have any string to out conversion  
     30    /* sigh, we don't have any string to out conversion 
    3131     * it would be nice to at least search the oid table by 
    3232     * description */ 
  • trunk/src/common/base64.h

    r233 r358  
    11/* 
    2  * BASE64 Encoding funtions  
     2 * BASE64 Encoding funtions 
    33 * Copyright (C) 2001, 2002  Juha Yrj\uffffl\uffff <juha.yrjola@iki.fi> 
    44 * Copyright (C) 2003-2004 Mario Strasser <mast@gmx.net> 
  • trunk/src/common/cert_info.c

    r344 r358  
    3636/* 
    3737 * NSS dynamic oid support. 
    38  *  NSS is able to understand new oid tags provided by the application,  
     38 *  NSS is able to understand new oid tags provided by the application, 
    3939 *  including 
    4040 *  understanding new cert extensions that NSS previously did not understand. 
     
    4646SECOidTag CERT_KerberosPN_OID = SEC_OID_UNKNOWN; 
    4747static const unsigned char kerberosOID[] =  { 0x2b, 0x6, 0x1, 0x5, 0x2, 0x2 }; 
    48 static const SECOidData kerberosPN_Entry =  
    49        { TO_ITEM(kerberosOID), SEC_OID_UNKNOWN,  
     48static const SECOidData kerberosPN_Entry = 
     49       { TO_ITEM(kerberosOID), SEC_OID_UNKNOWN, 
    5050       "Kerberos Priniciple", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }; 
    5151 
    5252SECOidTag CERT_MicrosoftUPN_OID = SEC_OID_UNKNOWN; 
    5353/* { 1.3.6.1.4.1.311 } */ 
    54 static const unsigned char microsoftUPNOID[] =   
     54static const unsigned char microsoftUPNOID[] = 
    5555        { 0x2b, 0x6, 0x1, 0x4, 0x1, 0x82, 0x37, 0x14, 0x2, 0x3 }; 
    56 static const SECOidData microsoftUPN_Entry =  
    57         { TO_ITEM(microsoftUPNOID), SEC_OID_UNKNOWN,  
    58         "Microsoft Universal Priniciple", CKM_INVALID_MECHANISM,  
     56static const SECOidData microsoftUPN_Entry = 
     57        { TO_ITEM(microsoftUPNOID), SEC_OID_UNKNOWN, 
     58        "Microsoft Universal Priniciple", CKM_INVALID_MECHANISM, 
    5959        INVALID_CERT_EXTENSION }; 
    6060 
     
    148148        goto no_upn; 
    149149    } 
    150      
     150 
    151151    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); 
    152152    if (!arena) { 
     
    252252      if ( !algorithm ) { 
    253253        DBG("Must specify digest algorithm"); 
    254         return NULL;             
     254        return NULL; 
    255255      } 
    256256      return cert_info_digest(x509,algorithm); 
     
    431431                if (OBJ_cmp(name->d.otherName->type_id, krb5PrincipalName)) continue; /* object is not a UPN */ 
    432432                else { 
    433                     /* NOTE:  
     433                    /* NOTE: 
    434434                    from PKINIT RFC, I deduce that stored format for kerberos 
    435435                    Principal Name is ASN1_STRING, but not sure at 100% 
     
    613613        } 
    614614        pt=key2pem(pubk); 
    615         if (!pt) {  
     615        if (!pt) { 
    616616            DBG("key2pem() failed"); 
    617617            EVP_PKEY_free(pubk); 
     
    630630        *pt++= (n&0x0000ff00) >>8; 
    631631        *pt++= (n&0x000000ff) >>0; 
    632         return 4;        
     632        return 4; 
    633633} 
    634634 
     
    696696                        res= BN_append(pt, pubk->pkey.dsa->pub_key); pt+=res; 
    697697                        break; 
    698                 case EVP_PKEY_RSA:  
     698                case EVP_PKEY_RSA: 
    699699                        if (!pubk->pkey.rsa) { 
    700700                                DBG("No data for public RSA key"); 
     
    702702                        } 
    703703                        /* dump key into a byte array */ 
    704                         type="ssh-rsa";  
     704                        type="ssh-rsa"; 
    705705                        res= int_append(pt,strlen(type)); pt+=res; 
    706706                        res= str_append(pt,type,strlen(type)); pt+=res; 
     
    826826 
    827827        len = i2c_ASN1_INTEGER(serial, NULL); 
    828          
     828 
    829829        if (len < 0) { 
    830830                return NULL; 
     
    883883                if ( !algorithm ) { 
    884884                    DBG("Must specify digest algorithm"); 
    885                     return NULL;                 
     885                    return NULL; 
    886886                } 
    887887                return cert_info_digest(x509,algorithm); 
  • trunk/src/common/cert_info.h

    r238 r358  
    2323 
    2424/** Certificate Common Name */ 
    25 #define CERT_CN         1        
     25#define CERT_CN         1 
    2626/** Certificate subject */ 
    2727#define CERT_SUBJECT    2 
    2828/** Kerberos principal name */ 
    29 #define CERT_KPN        3        
     29#define CERT_KPN        3 
    3030/** Certificate e-mail */ 
    31 #define CERT_EMAIL      4        
     31#define CERT_EMAIL      4 
    3232/** Microsoft's Universal Principal Name */ 
    33 #define CERT_UPN        5        
     33#define CERT_UPN        5 
    3434/** Certificate Unique Identifier */ 
    35 #define CERT_UID        6        
     35#define CERT_UID        6 
    3636/** Certificate Public Key (PEM Format)*/ 
    37 #define CERT_PUK        7        
     37#define CERT_PUK        7 
    3838/** Certificate Digest */ 
    39 #define CERT_DIGEST     8        
     39#define CERT_DIGEST     8 
    4040/** Certificate Public key in OpenSSH format */ 
    41 #define CERT_SSHPUK     9        
     41#define CERT_SSHPUK     9 
    4242/** Certificate in PEM format */ 
    43 #define CERT_PEM        10       
     43#define CERT_PEM        10 
    4444/** Certificate issuer */ 
    4545#define CERT_ISSUER     11 
     
    5252#define CERT_INFO_SIZE 16 
    5353/** Max number of entries to find from certificate */ 
    54 #define CERT_INFO_MAX_ENTRIES ( CERT_INFO_SIZE - 1 )  
     54#define CERT_INFO_MAX_ENTRIES ( CERT_INFO_SIZE - 1 ) 
    5555 
    5656#ifndef __CERT_INFO_C_ 
  • trunk/src/common/cert_vfy.c

    r348 r358  
    7171} 
    7272 
    73 #else  
     73#else 
    7474 
    7575#define __CERT_VFY_C_ 
     
    255255            DBG1("downloading crl from %s", name->d.ia5->data); 
    256256            crl = download_crl((const char *)name->d.ia5->data); 
    257              
     257 
    258258            /*crl = download_crl("file:///home/mario/projects/pkcs11_login/tests/ca_crl_0.pem"); */ 
    259259            /*crl = download_crl("http://www-t.zhwin.ch/ca/root_ca.crl"); */ 
     
    394394 
    395395/* 
    396 * @return -1 on error, 0 on verify failed, 1 on verify sucess  
     396* @return -1 on error, 0 on verify failed, 1 on verify sucess 
    397397*/ 
    398398int verify_certificate(X509 * x509, cert_policy *policy) 
     
    429429  if (rv != 1) { 
    430430    X509_STORE_CTX_free(ctx); 
    431     X509_STORE_free(store);  
     431    X509_STORE_free(store); 
    432432    set_error("certificate is invalid: %s", X509_verify_cert_error_string(ctx->error)); 
    433     return 0;   
     433    return 0; 
    434434  } else { 
    435435    DBG("certificate is valid"); 
  • trunk/src/common/cert_vfy.h

    r238 r358  
    3030#include "cert_st.h" 
    3131 
    32 typedef enum {  
     32typedef enum { 
    3333        /** Do not perform any CRL verification */ 
    34         CRLP_NONE,  
     34        CRLP_NONE, 
    3535        /** Retrieve CRL from CA site */ 
    36         CRLP_ONLINE,  
     36        CRLP_ONLINE, 
    3737        /** Retrieve CRL from local filesystem */ 
    3838        CRLP_OFFLINE, 
    3939        /** Try CRL check online, else ofline, else fail */ 
    40         CRLP_AUTO  
     40        CRLP_AUTO 
    4141        } crl_policy_t; 
    4242 
    43 typedef enum {  
    44         OCSP_NONE,  
    45         OCSP_ON  
     43typedef enum { 
     44        OCSP_NONE, 
     45        OCSP_ON 
    4646        } ocsp_policy_t; 
    4747 
  • trunk/src/common/debug.c

    r305 r358  
    1 /*  
     1/* 
    22 * PKCS #11 PAM Login Module 
    33 * Copyright (C) 2003 Mario Strasser <mast@gmx.net>, 
     
    6060      vsnprintf(buf, sizeof(buf), format, ap); 
    6161      va_end(ap); 
    62        
     62 
    6363      syslog(LOG_INFO, buf); 
    6464    } 
  • trunk/src/common/debug.h

    r246 r358  
    6363#ifndef __DEBUG_C_ 
    6464#define DEBUG_EXTERN extern 
    65 #else  
     65#else 
    6666#define DEBUG_EXTERN 
    6767#endif 
     
    8080 
    8181/** 
    82  * debug_print() prints the given message  
     82 * debug_print() prints the given message 
    8383 
    84  * if the current debug-level  
     84 * if the current debug-level 
    8585 * is greater or equal to the defined level. The format string as well as all 
    86  * further arguments are interpreted as by the printf() function.  
     86 * further arguments are interpreted as by the printf() function. 
    8787 *@param level Debug level of message 
    8888 *@param file Name of the file where message is generated 
  • trunk/src/common/error.h

    r247 r358  
    3131 
    3232/** Default error message buffer size */ 
    33 #define ERROR_BUFFER_SIZE 512  
     33#define ERROR_BUFFER_SIZE 512 
    3434 
    3535#ifndef __ERROR_C_ 
  • trunk/src/common/pkcs11_lib.c

    r352 r358  
    213213 
    214214 
    215 static SECMODModule *find_module_by_library(char *pkcs11_module)  
     215static SECMODModule *find_module_by_library(char *pkcs11_module) 
    216216{ 
    217217  SECMODModule *module = NULL; 
     
    236236 * NSS allows you to load a specific module. If the user specified a module 
    237237 * to load, load it, otherwize select on of the standard modules from the 
    238  * secmod.db list.  
     238 * secmod.db list. 
    239239 */ 
    240240int load_pkcs11_module(char *pkcs11_module, pkcs11_handle_t **hp) 
     
    261261  } 
    262262 
    263   /* specified module is not already loaded, load it now */      
     263  /* specified module is not already loaded, load it now */ 
    264264  moduleSpec = (char *)malloc(sizeof(SPEC_TEMPLATE) + strlen(pkcs11_module)); 
    265265  if (!moduleSpec) { 
     
    298298  int i; 
    299299 
    300   /* if module is null,  
     300  /* if module is null, 
    301301   * any of the PKCS #11 modules specified in the system config 
    302302   * is available, find one */ 
     
    364364 * slot is ok. 
    365365 */ 
    366 int find_slot_by_number_and_label(pkcs11_handle_t *h,  
     366int find_slot_by_number_and_label(pkcs11_handle_t *h, 
    367367                                  int wanted_slot_id, 
    368368                                  const char *wanted_token_label, 
     
    385385    token_label = PK11_GetTokenName(h->slot); 
    386386 
    387     if ((token_label != NULL) &&  
     387    if ((token_label != NULL) && 
    388388        (strcmp (wanted_token_label, token_label) == 0)) { 
    389389      return 0; 
     
    413413} 
    414414 
    415 int wait_for_token(pkcs11_handle_t *h,  
     415int wait_for_token(pkcs11_handle_t *h, 
    416416                   int wanted_slot_id, 
    417417                   const char *wanted_token_label, 
     
    450450} 
    451451 
    452 /*  
     452/* 
    453453 * This function will search the slot list to find a slot based on the slot 
    454454 * label.  If the wanted_slot_label is "none", then we will return the first 
    455455 * slot with the token presented. 
    456  *  
     456 * 
    457457 * This function return 0 if it found a matching slot; otherwise, it returns 
    458458 * -1. 
     
    481481 
    482482        slot = PK11_ReferenceSlot(module->slots[i]); 
    483         slot_label = PK11_GetSlotName(slot);     
     483        slot_label = PK11_GetSlotName(slot); 
    484484        if (memcmp_pad_max((void *)slot_label, strlen(slot_label), 
    485485            (void *)wanted_slot_label, strlen(wanted_slot_label), 64) == 0) { 
     
    509509    return (-1); 
    510510 
    511   if (wanted_token_label == NULL){  
     511  if (wanted_token_label == NULL){ 
    512512    rv = find_slot_by_slotlabel(h, wanted_slot_label, slot_num); 
    513513    return (rv); 
     
    515515 
    516516  /* wanted_token_label != NULL */ 
    517   if (strcmp(wanted_slot_label, "none") == 0) {  
     517  if (strcmp(wanted_slot_label, "none") == 0) { 
    518518    for (i = 0; i < module->slotCount; i++) { 
    519519      if (module->slots[i] && PK11_IsPresent(module->slots[i])) { 
     
    554554} 
    555555 
    556 int wait_for_token_by_slotlabel(pkcs11_handle_t *h,  
     556int wait_for_token_by_slotlabel(pkcs11_handle_t *h, 
    557557                   const char *wanted_slot_label, 
    558558                   const char *wanted_token_label, 
     
    566566    rv = find_slot_by_slotlabel_and_tokenlabel (h, wanted_slot_label, 
    567567        wanted_token_label, slot_num); 
    568    
     568 
    569569    if (rv !=  0) { 
    570570      PK11SlotInfo *slot; 
     
    593593 
    594594 
    595 void release_pkcs11_module(pkcs11_handle_t *h)  
     595void release_pkcs11_module(pkcs11_handle_t *h) 
    596596{ 
    597597  SECStatus rv; 
     
    715715  if (rv != SECSuccess) { 
    716716      CERT_DestroyCertList(certList); 
    717       DBG1("Couldn't filter out email certs: %s",  
     717      DBG1("Couldn't filter out email certs: %s", 
    718718                                SECU_Strerror(PR_GetError())); 
    719719      return NULL; 
     
    729729 
    730730  /* convert the link list from NSS to the array used by pam_pkcs11 */ 
    731   for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node,certList);  
     731  for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node,certList); 
    732732                                                node = CERT_LIST_NEXT(node)) { 
    733733        if (node->cert) { 
     
    749749  } 
    750750 
    751   for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node,certList);  
     751  for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node,certList); 
    752752                                         node = CERT_LIST_NEXT(node)) { 
    753753    if (node->cert) { 
     
    812812} 
    813813 
    814 int get_random_value(unsigned char *data, int length)  
     814int get_random_value(unsigned char *data, int length) 
    815815{ 
    816816  SECStatus rv = PK11_GenerateRandom(data,length); 
     
    848848 */ 
    849849const char * 
    850 SECU_Strerror(PRErrorCode errNum)  
     850SECU_Strerror(PRErrorCode errNum) 
    851851{ 
    852852  PRInt32 low  = 0; 
     
    864864      num = errStrings[i].errNum; 
    865865      if (num <= lastNum) { 
    866         fprintf(stderr,  
     866        fprintf(stderr, 
    867867                "sequence error in error strings at item %d\n" 
    868868                "error %d (%s)\n" 
    869869                "should come after \n" 
    870870                "error %d (%s)\n", 
    871                 i, lastNum, errStrings[i-1].errString,  
     871                i, lastNum, errStrings[i-1].errString, 
    872872                num, errStrings[i].errString); 
    873873      } 
     
    881881    i = (low + high) / 2; 
    882882    num = errStrings[i].errNum; 
    883     if (errNum == num)  
     883    if (errNum == num) 
    884884      return errStrings[i].errString; 
    885885    if (errNum < num) 
    886886      high = i; 
    887     else  
     887    else 
    888888      low = i; 
    889889  } 
     
    949949  DBG1("PKCS #11 module = [%s]", module); 
    950950  /* reset pkcs #11 handle */ 
    951    
     951 
    952952  h = (pkcs11_handle_t *)calloc(sizeof(pkcs11_handle_t), 1); 
    953953  if (h == NULL) { 
     
    10491049  CK_INFO info; 
    10501050  CK_C_INITIALIZE_ARGS initArgs; 
    1051   /*  
    1052    Set up arguments to allow native threads  
     1051  /* 
     1052   Set up arguments to allow native threads 
    10531053   According with pkcs#11v2.20, must set all pointers to null 
    10541054   and flags CKF_OS_LOCKING_OK 
     
    11411141   /* zero means find the best slot */ 
    11421142   if (slot_num == 0) { 
    1143         for (slot_num = 0; slot_num < h->slot_count &&  
     1143        for (slot_num = 0; slot_num < h->slot_count && 
    11441144                                !h->slots[slot_num].token_present; slot_num++); 
    11451145   } else { 
     
    11541154   return 0; 
    11551155} 
    1156          
    1157 int find_slot_by_number_and_label(pkcs11_handle_t *h,  
     1156 
     1157int find_slot_by_number_and_label(pkcs11_handle_t *h, 
    11581158                                  int wanted_slot_id, 
    11591159                                  const char *wanted_token_label, 
     
    11761176    token_label = h->slots[*slot_num].label; 
    11771177 
    1178     if ((token_label != NULL) &&  
     1178    if ((token_label != NULL) && 
    11791179        (strcmp (wanted_token_label, token_label) == 0)) { 
    11801180      return 0; 
     
    11871187    if (h->slots[slot_index].token_present) { 
    11881188      token_label = h->slots[slot_index].label; 
    1189       if ((token_label != NULL) &&  
     1189      if ((token_label != NULL) && 
    11901190          (strcmp (wanted_token_label, token_label) == 0)) { 
    11911191        *slot_num = slot_index; 
     
    11981198 
    11991199 
    1200 /*  
     1200/* 
    12011201 * This function will search the slot list to find a slot based on the slot 
    12021202 * label.  If the wanted_slot_label is "none", then we will return the first 
    12031203 * slot with the token presented. 
    1204  *  
     1204 * 
    12051205 * This function return 0 if it found a matching slot; otherwise, it returns 
    12061206 * -1. 
     
    12571257 
    12581258  /* wanted_token_label != NULL */ 
    1259   if (strcmp(wanted_slot_label, "none") == 0) {  
     1259  if (strcmp(wanted_slot_label, "none") == 0) { 
    12601260    for (i= 0; i < h->slot_count; i++) { 
    12611261      if (h->slots[i].token_present && 
     
    12861286} 
    12871287 
    1288 int wait_for_token_by_slotlabel(pkcs11_handle_t *h,  
     1288int wait_for_token_by_slotlabel(pkcs11_handle_t *h, 
    12891289                   const char *wanted_slot_label, 
    12901290                   const char *wanted_token_label, 
     
    13091309} 
    13101310 
    1311 int wait_for_token(pkcs11_handle_t *h,  
     1311int wait_for_token(pkcs11_handle_t *h, 
    13121312                   int wanted_slot_id, 
    13131313                   const char *wanted_token_label, 
     
    13401340    set_error("invalid slot number %d", slot); 
    13411341    return -1; 
    1342   }  
     1342  } 
    13431343  /* open a readonly user-session */ 
    13441344  rv = h->fl->C_OpenSession(h->slots[slot].id, CKF_SERIAL_SESSION, NULL, NULL, &h->session); 
     
    14081408 
    14091409/* get a list of certificates */ 
    1410 cert_object_t **get_certificate_list(pkcs11_handle_t *h, int *ncerts)  
     1410cert_object_t **get_certificate_list(pkcs11_handle_t *h, int *ncerts) 
    14111411{ 
    14121412  CK_BYTE *id_value; 
     
    14171417  cert_object_t **certs = NULL; 
    14181418  int rv; 
    1419    
     1419 
    14201420  CK_OBJECT_CLASS cert_class = CKO_CERTIFICATE; 
    14211421  CK_CERTIFICATE_TYPE cert_type = CKC_X_509; 
     
    16401640} 
    16411641 
    1642 int sign_value(pkcs11_handle_t *h, cert_object_t *cert, CK_BYTE *data,  
     1642int sign_value(pkcs11_handle_t *h, cert_object_t *cert, CK_BYTE *data, 
    16431643        CK_ULONG length, CK_BYTE **signature, CK_ULONG *signature_length) 
    16441644{ 
     
    16521652    set_error("Couldn't find private key for certificate"); 
    16531653    return -1; 
    1654   }  
     1654  } 
    16551655 
    16561656  /* set mechanism */ 
  • trunk/src/common/pkcs11_lib.h

    r346 r358  
    2525#ifndef __PKCS11_LIB_C__ 
    2626#define PKCS11_EXTERN extern 
    27 #else  
     27#else 
    2828#define PKCS11_EXTERN 
    2929#endif 
     
    3939PKCS11_EXTERN const char *get_slot_tokenlabel(pkcs11_handle_t *h); 
    4040PKCS11_EXTERN int wait_for_token(pkcs11_handle_t *h, 
    41                                  int wanted_slot_num,  
     41                                 int wanted_slot_num, 
    4242                                 const char *wanted_token_label, 
    4343                                 unsigned int *slot); 
     
    5050                                 unsigned int *slot); 
    5151PKCS11_EXTERN int wait_for_token_by_slotlabel(pkcs11_handle_t *h, 
    52                                  const char *wanted_slot_label,  
     52                                 const char *wanted_slot_label, 
    5353                                 const char *wanted_token_label, 
    5454                                 unsigned int *slot); 
     
    5959PKCS11_EXTERN int pkcs11_login(pkcs11_handle_t *h, char *password); 
    6060PKCS11_EXTERN int pkcs11_pass_login(pkcs11_handle_t *h, int nullok); 
    61 PKCS11_EXTERN cert_object_t **get_certificate_list(pkcs11_handle_t *h,  
     61PKCS11_EXTERN cert_object_t **get_certificate_list(pkcs11_handle_t *h, 
    6262                                                  int *ncert); 
    6363PKCS11_EXTERN int get_private_key(pkcs11_handle_t *h, cert_object_t *); 
  • trunk/src/common/rsaref/PKCS11_README

    r200 r358  
    44 
    55License to copy and use this software is granted provided that it is identified 
    6 as "RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki)"  
    7 in all material mentioning or referencing this software or this function.  
     6as "RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki)" 
     7in all material mentioning or referencing this software or this function. 
    88 
    99License is also granted to make and use derivative works provided that such 
    1010works are identified as "derived from the RSA Security Inc. PKCS #11 
    1111Cryptographic Token Interface (Cryptoki)" in all material mentioning or 
    12 referencing the derived work.   
     12referencing the derived work. 
    1313 
    1414This software is provided AS IS and RSA Security, Inc. disclaims all warranties 
  • trunk/src/common/rsaref/pkcs11.h

    r233 r358  
    4242 * License is also granted to make and use derivative works provided that 
    4343 * such works are identified as "derived from the RSA Security Inc. PKCS #11 
    44  * Cryptographic Token Interface (Cryptoki)" in all material mentioning or  
     44 * Cryptographic Token Interface (Cryptoki)" in all material mentioning or 
    4545 * referencing the derived work. 
    4646 
    47  * RSA Security Inc. makes no representations concerning either the  
     47 * RSA Security Inc. makes no representations concerning either the 
    4848 * merchantability of this software or the suitability of this software for 
    4949 * any particular purpose. It is provided "as is" without express or implied 
  • trunk/src/common/rsaref/pkcs11f.h

    r199 r358  
    88 * License is also granted to make and use derivative works provided that 
    99 * such works are identified as "derived from the RSA Security Inc. PKCS #11 
    10  * Cryptographic Token Interface (Cryptoki)" in all material mentioning or  
     10 * Cryptographic Token Interface (Cryptoki)" in all material mentioning or 
    1111 * referencing the derived work. 
    1212 
    13  * RSA Security Inc. makes no representations concerning either the  
     13 * RSA Security Inc. makes no representations concerning either the 
    1414 * merchantability of this software or the suitability of this software for 
    1515 * any particular purpose. It is provided "as is" without express or implied 
     
    521521 
    522522/* C_SignUpdate continues a multiple-part signature operation, 
    523  * where the signature is (will be) an appendix to the data,  
     523 * where the signature is (will be) an appendix to the data, 
    524524 * and plaintext cannot be recovered from the signature. */ 
    525525CK_PKCS11_FUNCTION_INFO(C_SignUpdate) 
     
    532532 
    533533 
    534 /* C_SignFinal finishes a multiple-part signature operation,  
     534/* C_SignFinal finishes a multiple-part signature operation, 
    535535 * returning the signature. */ 
    536536CK_PKCS11_FUNCTION_INFO(C_SignFinal) 
     
    582582 
    583583 
    584 /* C_Verify verifies a signature in a single-part operation,  
     584/* C_Verify verifies a signature in a single-part operation, 
    585585 * where the signature is an appendix to the data, and plaintext 
    586586 * cannot be recovered from the signature. */ 
     
    597597 
    598598/* C_VerifyUpdate continues a multiple-part verification 
    599  * operation, where the signature is an appendix to the data,  
     599 * operation, where the signature is an appendix to the data, 
    600600 * and plaintext cannot be recovered from the signature. */ 
    601601CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) 
     
    714714 
    715715 
    716 /* C_GenerateKeyPair generates a public-key/private-key pair,  
     716/* C_GenerateKeyPair generates a public-key/private-key pair, 
    717717 * creating new key objects. */ 
    718718CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair) 
  • trunk/src/common/rsaref/pkcs11t.h

    r199 r358  
    88 * License is also granted to make and use derivative works provided that 
    99 * such works are identified as "derived from the RSA Security Inc. PKCS #11 
    10  * Cryptographic Token Interface (Cryptoki)" in all material mentioning or  
     10 * Cryptographic Token Interface (Cryptoki)" in all material mentioning or 
    1111 * referencing the derived work. 
    1212 
    13  * RSA Security Inc. makes no representations concerning either the  
     13 * RSA Security Inc. makes no representations concerning either the 
    1414 * merchantability of this software or the suitability of this software for 
    1515 * any particular purpose. It is provided "as is" without express or implied 
     
    171171 
    172172/* The flags parameter is defined as follows: 
    173  *      Bit Flag                    Mask        Meaning  
     173 *      Bit Flag                    Mask        Meaning 
    174174 */ 
    175175#define CKF_RNG                     0x00000001  /* has random # 
     
    207207 
    208208/* CKF_TOKEN_INITIALIZED if new for v2.10. If it is true, the 
    209  * token has been initialized using C_InitializeToken or an  
     209 * token has been initialized using C_InitializeToken or an 
    210210 * equivalent mechanism outside the scope of PKCS #11. 
    211  * Calling C_InitializeToken when this flag is set will cause  
     211 * Calling C_InitializeToken when this flag is set will cause 
    212212 * the token to be reinitialized. */ 
    213213#define CKF_TOKEN_INITIALIZED       0x00000400 
    214214 
    215 /* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is  
    216  * true, the token supports secondary authentication for  
     215/* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is 
     216 * true, the token supports secondary authentication for 
    217217 * private key objects. */ 
    218218#define CKF_SECONDARY_AUTHENTICATION  0x00000800 
    219219 
    220 /* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an  
    221  * incorrect user login PIN has been entered at least once  
     220/* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an 
     221 * incorrect user login PIN has been entered at least once 
    222222 * since the last successful authentication. */ 
    223223#define CKF_USER_PIN_COUNT_LOW       0x00010000 
     
    227227#define CKF_USER_PIN_FINAL_TRY       0x00020000 
    228228 
    229 /* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the  
    230  * user PIN has been locked. User login to the token is not  
     229/* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the 
     230 * user PIN has been locked. User login to the token is not 
    231231 * possible. */ 
    232232#define CKF_USER_PIN_LOCKED          0x00040000 
    233233 
    234 /* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true,  
    235  * the user PIN value is the default value set by token  
     234/* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true, 
     235 * the user PIN value is the default value set by token 
    236236 * initialization or manufacturing, or the PIN has been 
    237237 * expired by the card. */ 
    238238#define CKF_USER_PIN_TO_BE_CHANGED   0x00080000 
    239239 
    240 /* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an  
    241  * incorrect SO login PIN has been entered at least once since  
     240/* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an 
     241 * incorrect SO login PIN has been entered at least once since 
    242242 * the last successful authentication. */ 
    243243#define CKF_SO_PIN_COUNT_LOW         0x00100000 
     
    247247#define CKF_SO_PIN_FINAL_TRY         0x00200000 
    248248 
    249 /* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO  
     249/* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO 
    250250 * PIN has been locked. SO login to the token is not possible. 
    251251 */ 
    252252#define CKF_SO_PIN_LOCKED            0x00400000 
    253253 
    254 /* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true,  
    255  * the SO PIN value is the default value set by token  
     254/* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true, 
     255 * the SO PIN value is the default value set by token 
    256256 * initialization or manufacturing, or the PIN has been 
    257257 * expired by the card. */ 
     
    421421#define CKA_SERIAL_NUMBER      0x00000082 
    422422 
    423 /* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new  
     423/* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new 
    424424 * for v2.10 */ 
    425425#define CKA_AC_ISSUER          0x00000083 
     
    487487#define CKA_EC_POINT           0x00000181 
    488488 
    489 /* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS,  
     489/* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS, 
    490490 * CKA_HW_FEATURE_TYPE, CKA_RESET_ON_INIT, and CKA_HAS_RESET 
    491491 * are new for v2.10 */ 
     
    622622#define CKM_SHA_1_HMAC_GENERAL         0x00000222 
    623623 
    624 /* CKM_RIPEMD128, CKM_RIPEMD128_HMAC,  
     624/* CKM_RIPEMD128, CKM_RIPEMD128_HMAC, 
    625625 * CKM_RIPEMD128_HMAC_GENERAL, CKM_RIPEMD160, CKM_RIPEMD160_HMAC, 
    626626 * and CKM_RIPEMD160_HMAC_GENERAL are new for v2.10 */ 
     
    10401040#define CKF_DONT_BLOCK     1 
    10411041 
    1042 /* CK_RSA_PKCS_OAEP_MGF_TYPE is new for v2.10.  
    1043  * CK_RSA_PKCS_OAEP_MGF_TYPE  is used to indicate the Message  
    1044  * Generation Function (MGF) applied to a message block when  
    1045  * formatting a message block for the PKCS #1 OAEP encryption  
     1042/* CK_RSA_PKCS_OAEP_MGF_TYPE is new for v2.10. 
     1043 * CK_RSA_PKCS_OAEP_MGF_TYPE  is used to indicate the Message 
     1044 * Generation Function (MGF) applied to a message block when 
     1045 * formatting a message block for the PKCS #1 OAEP encryption 
    10461046 * scheme. */ 
    10471047typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE; 
     
    10521052#define CKG_MGF1_SHA1         0x00000001 
    10531053 
    1054 /* CK_RSA_PKCS_OAEP_SOURCE_TYPE is new for v2.10.  
     1054/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is new for v2.10. 
    10551055 * CK_RSA_PKCS_OAEP_SOURCE_TYPE  is used to indicate the source 
    1056  * of the encoding parameter when formatting a message block  
     1056 * of the encoding parameter when formatting a message block 
    10571057 * for the PKCS #1 OAEP encryption scheme. */ 
    10581058typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE; 
     
    10641064 
    10651065/* CK_RSA_PKCS_OAEP_PARAMS is new for v2.10. 
    1066  * CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the  
     1066 * CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the 
    10671067 * CKM_RSA_PKCS_OAEP mechanism. */ 
    10681068typedef struct CK_RSA_PKCS_OAEP_PARAMS { 
     
    11271127typedef CK_ECDH2_DERIVE_PARAMS CK_PTR CK_ECDH2_DERIVE_PARAMS_PTR; 
    11281128 
    1129 /* Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the  
     1129/* Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the 
    11301130 * CKM_X9_42_DH_PARAMETER_GEN mechanisms (new for PKCS #11 v2.11) */ 
    11311131typedef CK_ULONG CK_X9_42_DH_KDF_TYPE; 
     
    11381138 
    11391139/* CK_X9_42_DH1_DERIVE_PARAMS is new for v2.11. 
    1140  * CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the  
     1140 * CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the 
    11411141 * CKM_X9_42_DH_DERIVE key derivation mechanism, where each party 
    11421142 * contributes one key pair */ 
     
    11521152 
    11531153/* CK_X9_42_DH2_DERIVE_PARAMS is new for v2.11. 
    1154  * CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the  
     1154 * CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the 
    11551155 * CKM_X9_42_DH_HYBRID_DERIVE and CKM_X9_42_MQV_DERIVE key derivation 
    11561156 * mechanisms, where each party contributes two key pairs */ 
     
    13861386 
    13871387/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is new for v2.10. 
    1388  * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to  
    1389  * indicate the Pseudo-Random Function (PRF) used to generate  
     1388 * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to 
     1389 * indicate the Pseudo-Random Function (PRF) used to generate 
    13901390 * key bits using PKCS #5 PBKDF2. */ 
    13911391typedef CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; 
     
    13991399 
    14001400/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is new for v2.10. 
    1401  * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the  
    1402  * source of the salt value when deriving a key using PKCS #5  
     1401 * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the 
     1402 * source of the salt value when deriving a key using PKCS #5 
    14031403 * PBKDF2. */ 
    14041404typedef CK_ULONG CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; 
     
    14101410 
    14111411/* CK_PKCS5_PBKD2_PARAMS is new for v2.10. 
    1412  * CK_PKCS5_PBKD2_PARAMS is a structure that provides the  
     1412 * CK_PKCS5_PBKD2_PARAMS is a structure that provides the 
    14131413 * parameters to the CKM_PKCS5_PBKD2 mechanism. */ 
    14141414typedef struct CK_PKCS5_PBKD2_PARAMS { 
  • trunk/src/common/secutil.h

    r244 r358  
    6969 
    7070#ifdef SECUTIL_NEW 
    71 typedef int (*SECU_PPFunc)(PRFileDesc *out, SECItem *item,  
     71typedef int (*SECU_PPFunc)(PRFileDesc *out, SECItem *item, 
    7272                           char *msg, int level); 
    7373#else 
     
    102102 
    103103/* 
    104 ** Blind check of a password. Complement to SEC_CheckPassword which  
     104** Blind check of a password. Complement to SEC_CheckPassword which 
    105105** ignores length and content type, just retuning DSTrue is the password 
    106106** exists, DSFalse if NULL 
     
    144144 
    145145/* 
    146 ** Should be called once during initialization to set the default  
     146** Should be called once during initialization to set the default 
    147147**    directory for looking for cert.db, key.db, and cert-nameidx.db files 
    148 ** Removes trailing '/' in 'base'  
     148** Removes trailing '/' in 'base' 
    149149** If 'base' is NULL, defaults to set to .netscape in home directory. 
    150150*/ 
    151151extern char *SECU_ConfigDirectory(const char* base); 
    152152 
    153 /*  
     153/* 
    154154** Basic callback function for SSL_GetClientAuthDataHook 
    155155*/ 
     
    171171/* print information about cert verification failure */ 
    172172extern void 
    173 SECU_printCertProblems(FILE *outfile, CERTCertDBHandle *handle,  
    174         CERTCertificate *cert, PRBool checksig,  
     173SECU_printCertProblems(FILE *outfile, CERTCertDBHandle *handle, 
     174        CERTCertificate *cert, PRBool checksig, 
    175175        SECCertificateUsage certUsage, void *pinArg, PRBool verbose); 
    176176 
     
    180180 
    181181/* Read in a DER from a file, may be ascii  */ 
    182 extern SECStatus  
     182extern SECStatus 
    183183SECU_ReadDERFromFile(SECItem *der, PRFileDesc *inFile, PRBool ascii); 
    184184 
     
    229229/* Dump all certificate nicknames in a database */ 
    230230extern SECStatus 
    231 SECU_PrintCertificateNames(CERTCertDBHandle *handle, PRFileDesc* out,  
     231SECU_PrintCertificateNames(CERTCertDBHandle *handle, PRFileDesc* out, 
    232232                           PRBool sortByName, PRBool sortByTrust); 
    233233 
     
    258258 
    259259/* Pretty-print any PKCS7 thing */ 
    260 extern int SECU_PrintPKCS7ContentInfo(FILE *out, SECItem *der, char *m,  
     260extern int SECU_PrintPKCS7ContentInfo(FILE *out, SECItem *der, char *m, 
    261261                                      int level); 
    262262 
     
    319319** encodes the result. 
    320320**      "arena" is the memory arena to use to allocate data from 
    321 **      "sd" returned CERTSignedData  
     321**      "sd" returned CERTSignedData 
    322322**      "result" the final der encoded data (memory is allocated) 
    323323**      "buf" the input data to sign 
     
    365365 
    366366/* Encodes and adds extensions to the CRL or CRL entries. */ 
    367 SECStatus  
    368 SECU_EncodeAndAddExtensionValue(PRArenaPool *arena, void *extHandle,  
    369                                 void *value, PRBool criticality, int extenType,  
     367SECStatus 
     368SECU_EncodeAndAddExtensionValue(PRArenaPool *arena, void *extHandle, 
     369                                void *value, PRBool criticality, int extenType, 
    370370                                EXTEN_EXT_VALUE_ENCODER EncodeValueFn); 
    371371 
     
    373373/* 
    374374 * 
    375  *  Utilities for parsing security tools command lines  
     375 *  Utilities for parsing security tools command lines 
    376376 * 
    377377 */ 
     
    396396 
    397397/*  fill the "arg" and "activated" fields for each flag  */ 
    398 SECStatus  
     398SECStatus 
    399399SECU_ParseCommandLine(int argc, char **argv, char *progName, secuCommand *cmd); 
    400400char * 
  • trunk/src/common/strings.h

    r233 r358  
    8484 
    8585/** 
    86  * Convert a colon-separated hexadecimal data into a byte array,  
     86 * Convert a colon-separated hexadecimal data into a byte array, 
    8787 * store result into a previously allocated space 
    8888 *@param str String to be parsed 
     
    108108 * using dest as pre-allocated destination memory for the resulting array 
    109109 * 
    110  * To free() memory used by this call, just call free result pointer  
     110 * To free() memory used by this call, just call free result pointer 
    111111 *@param str String to be parsed 
    112112 *@param sep Character to be used as separator 
     
    118118 
    119119/** 
    120  * Remove all extra spaces from a string.  
     120 * Remove all extra spaces from a string. 
    121121 * a char is considered space if trues isspace() 
    122122 * 
  • trunk/src/common/uri.c

    r264 r358  
    2727#include "strings.h" 
    2828 
    29 static const char *valid_urls[]=  
     29static const char *valid_urls[]= 
    3030                {"file:///","http://","https://","ftp://","ldap://",NULL}; 
    31 /*  
    32 comodity functions  
     31/* 
     32comodity functions 
    3333Analize provided pathname and check type 
    3434Returns 1 on true, 0 on false, -1 on error 
  • trunk/src/mappers/cn_mapper.c

    r238 r358  
    4242/* 
    4343* This mapper uses the common name (CN) entry on the certificate to 
    44 * find user name.  
     44* find user name. 
    4545* When a mapfile is specified, try to map CN entry to a user login 
    4646*/ 
  • trunk/src/mappers/cn_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of cn_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/digest_mapper.c

    r256 r358  
    110110        mapper_module *pt; 
    111111        const char *hash_alg_string = NULL; 
    112         if (blk) {  
     112        if (blk) { 
    113113        debug = scconf_get_bool( blk,"debug",0); 
    114114        hash_alg_string = scconf_get_str( blk,"algorithm","sha1"); 
  • trunk/src/mappers/digest_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of digest_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/generic_mapper.c

    r257 r358  
    5252                return NULL; 
    5353        } 
    54         return cert_info(x509, id_type, ALGORITHM_NULL);  
     54        return cert_info(x509, id_type, ALGORITHM_NULL); 
    5555} 
    5656 
     
    131131            DBG2("Trying to match generic_mapped entry '%s' with login '%s'",str,login); 
    132132            if (ignorecase) { 
    133                 if (! strcasecmp(str,login) ) return 1;  
     133                if (! strcasecmp(str,login) ) return 1; 
    134134            } else { 
    135                 if (! strcmp(str,login) ) return 1;  
     135                if (! strcmp(str,login) ) return 1; 
    136136            } 
    137137        } 
     
    167167        mapper_module *pt; 
    168168        const char *item="cn"; 
    169         if (blk) {  
     169        if (blk) { 
    170170        debug = scconf_get_bool( blk,"debug",0); 
    171171        ignorecase = scconf_get_bool( blk,"ignorecase",0); 
     
    173173        mapfile= scconf_get_str(blk,"mapfile",mapfile); 
    174174        item= scconf_get_str(blk,"cert_item","cn"); 
    175         } else {  
     175        } else { 
    176176                /* should not occurs, but... */ 
    177177                DBG1("No block declaration for mapper '%s'",name); 
  • trunk/src/mappers/generic_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of generic_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/krb_mapper.c

    r238 r358  
    3737 
    3838/* 
    39 * This mapper uses (if available) the optional Kerberos Principal Name  
     39* This mapper uses (if available) the optional Kerberos Principal Name 
    4040* entry on the certificate to find user name. 
    4141*/ 
  • trunk/src/mappers/krb_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of krb_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/ldap_mapper.c

    r357 r358  
    6464 
    6565/* 
    66  * TODO:  
     66 * TODO: 
    6767 * - Support for SASL-AUTH not included yet, I can't test it 
    68  *   
     68 * 
    6969 * - ldap_unbind (*ld) crash if you connect to a SSL port but have set TLS intead SSL 
    7070 *   - no idea why!? 
    7171 *   - you got no error-massage from your application 
    7272 *   - believe skip ldap_unbind (*ld) for a bind handle isn't a good solution 
    73  *  
     73 * 
    7474 * - implement searchtimeout 
    7575 * - implement ignorecase 
     
    8888#ifndef LDAPS_PORT 
    8989#define LDAPS_PORT 636 
    90 #endif  
     90#endif 
    9191 
    9292 
     
    117117static int tls_checkpeer=-1; 
    118118static const char *tls_ciphers=""; 
    119 static const char *tls_cert="";  
     119static const char *tls_cert=""; 
    120120static const char *tls_key=""; 
    121121#endif 
    122122 
    123 static int ldapVersion = 3;              
     123static int ldapVersion = 3; 
    124124#ifdef HAVE_LDAP_SET_OPTION 
    125125static int timeout = 8;                 /* 8 seconds */ 
     
    128128 
    129129static const int sscope[] = { 
    130         LDAP_SCOPE_BASE,  
    131         LDAP_SCOPE_ONELEVEL,  
     130        LDAP_SCOPE_BASE, 
     131        LDAP_SCOPE_ONELEVEL, 
    132132        LDAP_SCOPE_SUBTREE}; 
    133133 
     
    141141        char uribuf[512]; 
    142142        char *p; 
    143          
     143 
    144144        DBG("do_init():"); 
    145145 
     
    174174    { 
    175175                size_t urilen = (p - uri); 
    176                  
     176 
    177177                if (urilen >= sizeof (uribuf)) 
    178178                { 
    179179                        return LDAP_UNAVAILABLE; 
    180180                } 
    181                  
     181 
    182182                memcpy (uribuf, uri, urilen); 
    183183                uribuf[urilen] = '\0'; 
    184                  
     184 
    185185                ldapdefport = atoi (p + 1); 
    186186                uri = uribuf; 
     
    205205 
    206206#if defined HAVE_LDAP_START_TLS_S || (defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)) 
    207 /*  
     207/* 
    208208 * Set the ssl option 
    209209 */ 
     
    280280        if (strncmp(tls_cert,"",1)) 
    281281    { 
    282             rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_CERTFILE,  
     282            rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_CERTFILE, 
    283283                tls_cert); 
    284284            if (rc != LDAP_SUCCESS) 
     
    292292        if (strncmp(tls_key,"",1)) 
    293293        { 
    294                 rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_KEYFILE,  
     294                rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_KEYFILE, 
    295295                        tls_key); 
    296296                if (rc != LDAP_SUCCESS) 
     
    314314 
    315315        /* 
    316          * set timelimit in ld for select() call in ldap_pvt_connect()  
     316         * set timelimit in ld for select() call in ldap_pvt_connect() 
    317317         * function implemented in libldap2's os-ip.c 
    318318         */ 
     
    322322DBG2("do_bind(): bind DN=\"%s\" pass=\"%s\"",binddn,passwd); 
    323323 
    324         /* LDAPv3 doesn't need bind at all,  
     324        /* LDAPv3 doesn't need bind at all, 
    325325         * nevertheless, if no binddn is given than bind anonymous */ 
    326326        if ( ! strncmp(binddn,"",1) ) { 
     
    333333        { 
    334334DBG("do_bind: rv < 0"); 
    335                  
     335 
    336336#if defined(HAVE_LDAP_GET_OPTION) && defined(LDAP_OPT_ERROR_NUMBER) 
    337337                if (ldap_get_option (ldap_connection, LDAP_OPT_ERROR_NUMBER, &rc) != 
     
    362362        { 
    363363DBG("do_bind rc=0"); 
    364                  
     364 
    365365                ldap_abandon (ldap_connection, rv); 
    366366        } 
     
    376376static int do_open (LDAP **ld, const char* uri, int defport, ldap_ssl_options_t ssl_on_local) 
    377377{ 
    378          
    379 #if defined(LDAP_OPT_NETWORK_TIMEOUT) || defined(HAVE_LDAP_START_TLS)    
     378 
     379#if defined(LDAP_OPT_NETWORK_TIMEOUT) || defined(HAVE_LDAP_START_TLS) 
    380380        struct timeval tv; 
    381381#endif 
     
    384384        LDAPMessage *res = NULL; 
    385385        int msgid; 
    386 #endif   
     386#endif 
    387387        int rc; 
    388388 
    389389        rc = do_init (ld, uri, defport); 
    390          
     390 
    391391        if (rc != LDAP_SUCCESS) 
    392392        { 
     
    533533                        return LDAP_UNAVAILABLE; 
    534534                } 
    535 #endif           
     535#endif 
    536536    } 
    537          
     537 
    538538        rc = do_bind (*ld, bind_timelimit); 
    539539        if (rc != LDAP_SUCCESS) 
     
    619619 
    620620        /* Put the login to the %s in Filterstring */ 
    621         snprintf(filter_str, sizeof(filter_str), filter, login);  
     621        snprintf(filter_str, sizeof(filter_str), filter, login); 
    622622 
    623623        DBG1("ldap_get_certificate(): filter_str = %s", filter_str); 
    624          
     624 
    625625        /* parse and split URI config entry */ 
    626626        buffer = uribuf; 
     
    637637                        if (q != NULL) 
    638638                                *q = '\0'; 
    639                          
     639 
    640640                        if( strlen(p) > 1 ) /* SAW: don't add spaces */ 
    641641                                rv = ldap_add_uri (uris, p, &buffer, &buflen); 
    642                          
     642 
    643643                        p = (q != NULL) ? ++q : NULL; 
    644                          
     644 
    645645                        if (rv) 
    646646                                break; 
     
    663663        { 
    664664                /* No port specified in URI and non-default port specified */ 
    665                 snprintf (uri, sizeof (uri), "%s%s:%d",  
     665                snprintf (uri, sizeof (uri), "%s%s:%d", 
    666666                       ssl_on == SSL_LDAPS ? "ldaps://" : "ldap://", 
    667667                       ldaphost, ldapport); 
     
    674674                return(-1); 
    675675    } 
    676          
     676 
    677677        /* Attempt to connect to specified URI in order until do_open succeed */ 
    678678        start_uri = current_uri; 
     
    686686                        break; 
    687687                current_uri++; 
    688                  
     688 
    689689                if (uris[current_uri] == NULL) 
    690690                        current_uri = 0; 
    691691        } 
    692692        while (current_uri != start_uri); 
    693          
     693 
    694694        if( rv != LDAP_SUCCESS ) 
    695695        { 
     
    706706 
    707707        rv = ldap_search_s( 
    708                                 ldap_connection,  
    709                                 base,  
    710                                 sscope[scope],  
    711                                 filter_str,  
    712                                 attrs,  
    713                                 0,  
     708                                ldap_connection, 
     709                                base, 
     710                                sscope[scope], 
     711                                filter_str, 
     712                                attrs, 
     713                                0, 
    714714                                &res); 
    715715        if ( rv != LDAP_SUCCESS ) { 
     
    722722 
    723723                if( entries > 1 ) { 
    724                         DBG("!  Warning, more than one entry found. Please choose \"filter\" and");  
     724                        DBG("!  Warning, more than one entry found. Please choose \"filter\" and"); 
    725725                        DBG("!  \"attribute\" in ldap mapper config section of your config,"); 
    726726                        DBG("!  that only one entry with one attribute is matched"); 
     
    728728                        DBG("!  entries in your LDAP server."); 
    729729                } 
    730                                  
    731                 /* Only first entry is used. "filter" and "attribute"  
     730 
     731                /* Only first entry is used. "filter" and "attribute" 
    732732                 *  should be choosen, so that only one entry with 
    733733                 * one attribute is returned */ 
     
    750750 
    751751                DBG1("number of user certificates = %d", certcnt); 
    752          
     752 
    753753                ldap_x509 = malloc(sizeof(X509*) * certcnt ); 
    754754                if (NULL == ldap_x509) 
     
    757757                        return(-7); 
    758758                } 
    759                  
     759 
    760760                rv = 0; 
    761761                while(rv < certcnt ) 
     
    766766                        if (NULL == ldap_x509[rv]) { 
    767767                                DBG1("d2i_X509() failed for certificate %d", rv); 
    768                                 free(ldap_x509);                                 
     768                                free(ldap_x509); 
    769769                                certcnt=0; 
    770770                                ldap_msgfree(res); 
     
    807807 
    808808        ssltls =  scconf_get_str(blk,"ssl","off"); 
    809         if (! strncasecmp (ssltls, "tls", 3))  
     809        if (! strncasecmp (ssltls, "tls", 3)) 
    810810                ssl_on = SSL_START_TLS; 
    811811        else if( ! strncasecmp (ssltls, "on", 2)) 
     
    813813        else if( ! strncasecmp (ssltls, "ssl", 3)) 
    814814                ssl_on = SSL_LDAPS; 
    815                  
     815 
    816816#if defined HAVE_LDAP_START_TLS_S || (defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)) 
    817817        /* TLS specific options */ 
     
    821821        tls_checkpeer=scconf_get_int(blk,"tls_checkpeer",tls_checkpeer); 
    822822        tls_ciphers = scconf_get_str(blk,"tls_ciphers",tls_ciphers); 
    823         tls_cert = scconf_get_str(blk,"tls_cert",tls_cert);  
     823        tls_cert = scconf_get_str(blk,"tls_cert",tls_cert); 
    824824        tls_key = scconf_get_str(blk,"tls_key",tls_key); 
    825825#endif 
     
    849849        DBG1("tls_checkpeer = %d", tls_checkpeer); 
    850850        DBG1("tls_ciphers   = %s", tls_ciphers); 
    851         DBG1("tls_cert      = %s", tls_cert);  
    852         DBG1("tls_key       = %s", tls_key);     
     851        DBG1("tls_cert      = %s", tls_cert); 
     852        DBG1("tls_key       = %s", tls_key); 
    853853#endif 
    854854        return 1; 
     
    884884                                DBG1("Certificate %d is matching", i); 
    885885                                match_found = 1; 
    886                         } else {  
     886                        } else { 
    887887                                DBG1("Certificate %d is NOT matching", i); 
    888888                        } 
    889889                        i++; 
    890890                } 
    891                 if (certcnt)  
     891                if (certcnt) 
    892892                        free(ldap_x509); 
    893893                certcnt=0; 
     
    915915 
    916916#ifdef false 
    917         int res;         
     917        int res; 
    918918        res= ldap_mapper_match_user(x509,"wefel",context); 
    919919        if (res) { 
     
    924924        } 
    925925#endif 
    926          
     926 
    927927        return found; 
    928928} 
  • trunk/src/mappers/ldap_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of ldap_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/mail_mapper.c

    r265 r358  
    3838 
    3939/* 
    40 * This mapper uses (if available) the optional email entry on the certificate  
     40* This mapper uses (if available) the optional email entry on the certificate 
    4141* to find user name. 
    4242*/ 
  • trunk/src/mappers/mail_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of mail_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/mapper.c

    r233 r358  
    4747* load url and store into mapfile 
    4848* returns struct or NULL on error 
    49 */  
     49*/ 
    5050struct mapfile *set_mapent(const char *url) { 
    5151        int res; 
     
    127127        if (!mfile) return; 
    128128        /* don't free uri: is a scconf provided "const char *" */; 
    129         /* free (mfile->uri); */  
     129        /* free (mfile->uri); */ 
    130130        /* don't free key/value: they are pointers to somewhere in buffer */ 
    131131        /* free (mfile->value); */ 
  • trunk/src/mappers/mapper.h

    r238 r358  
    3636 
    3737/** 
    38 * Structure to be filled on mapper module initialization  
     38* Structure to be filled on mapper module initialization 
    3939*/ 
    4040typedef struct mapper_module_st { 
    4141    /** mapper name */ 
    42     const char *name;    
     42    const char *name;  
    4343    /** mapper configuration block */ 
    44     scconf_block *block;  
     44    scconf_block *block; 
    4545    /** debug level to set before call entry points */ 
    46     int  dbg_level;      
     46    int  dbg_level;  
    4747    /** pointer to mapper local data */ 
    48     void *context;       
     48    void *context;  
    4949    /** cert. entries enumerator */ 
    50     char **(*entries)(X509 *x509, void *context);  
     50    char **(*entries)(X509 *x509, void *context); 
    5151    /** cert. login finder */ 
    52     char *(*finder)(X509 *x509, void *context);  
     52    char *(*finder)(X509 *x509, void *context); 
    5353    /** cert-to-login matcher*/ 
    54     int (*matcher)(X509 *x509, const char *login, void *context);  
     54    int (*matcher)(X509 *x509, const char *login, void *context); 
    5555    /** module de-initialization */ 
    56     void (*deinit)( void *context);      
     56    void (*deinit)( void *context);  
    5757} mapper_module; 
    5858 
     
    6565        const char *uri; 
    6666        /** buffer to content of mapfile */ 
    67         char *buffer;    
     67        char *buffer; 
    6868        /** lenght of buffer */ 
    69         size_t length;   
     69        size_t length; 
    7070        /** pointer to last readed entry in buffer */ 
    71         char *pt;        
     71        char *pt; 
    7272        /** key entry in current buffer */ 
    73         char *key;       
     73        char *key; 
    7474        /** value assigned to key */ 
    75         char *value;     
     75        char *value; 
    7676}; 
    7777 
     
    124124* Try to map "key" to provided mapfile 
    125125*@param file URL of map file 
    126 *@param key String to be mapped  
     126*@param key String to be mapped 
    127127*@param ignorecase Flag to indicate upper/lowercase ignore in string compare 
    128128*@return key on no match, else a clone_str()'d of found mapping 
     
    182182*@param x509 X509 Certificate 
    183183*@param context Mapper context 
    184 *@return Found user, or NULL  
     184*@return Found user, or NULL 
    185185*/ 
    186186#define _DEFAULT_MAPPER_FIND_USER                                       \ 
     
    210210} 
    211211 
    212 /**  
     212/** 
    213213* Macro for de-initialization routine 
    214214*@param context Mapper context 
  • trunk/src/mappers/mapperlist.h

    r233 r358  
    4141extern mapper_list static_mapper_list[]; 
    4242#endif 
    43          
     43 
    4444/* End of mapperlist.h */ 
    4545#endif 
  • trunk/src/mappers/ms_mapper.c

    r338 r358  
    3737 
    3838/* 
    39 * This mapper uses (if available) the optional MS's Universal Principal Name  
     39* This mapper uses (if available) the optional MS's Universal Principal Name 
    4040* entry on the certificate to find user name. 
    4141* According with MS documentation, UPN has following structure: 
     
    4343* UPN OtherName: user@domain.com 
    4444* UPN encoding:ASN1 UTF8 
    45 *  
     45* 
    4646* As UPN has in-built login and domain, No mapping file is used: login 
    4747* is implicit. 
     
    146146        /* parse list of uids until match */ 
    147147        for (str=*entries; str && (match_found==0); str=*++entries) { 
    148             char *login;  
     148            char *login; 
    149149            if (ignorecase) login= check_upn(tolower_str(str)); 
    150150            else            login= check_upn(clone_str(str)); 
  • trunk/src/mappers/ms_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of ms_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/null_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of null_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/opensc_mapper.c

    r350 r358  
    5151/** 
    5252* This mapper try to locate user by comparing authorized certificates 
    53 * from each $HOME/.eid/authorized_certificates user entry,  
     53* from each $HOME/.eid/authorized_certificates user entry, 
    5454* as stored by OpenSC package 
    5555*/ 
  • trunk/src/mappers/opensc_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of opensc_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/openssh_mapper.c

    r320 r358  
    5353#include "openssh_mapper.h" 
    5454 
    55 /* TODO  
     55/* TODO 
    5656Not sure on usage of authorized keys map file... 
    57 So the first version, will use getpwent() to navigate across all users  
     57So the first version, will use getpwent() to navigate across all users 
    5858and parsing ${userhome}/.ssh/authorized_keys 
    5959*/ 
     
    173173 
    174174        /* now: key_from_blob */ 
    175         if (strncmp((char *)&decoded[i], "ssh-rsa", 7) != 0) return NULL;  
     175        if (strncmp((char *)&decoded[i], "ssh-rsa", 7) != 0) return NULL; 
    176176        i += len; 
    177177 
     
    317317 
    318318/* 
    319 parses the certificate and return the _first_ user that matches public key  
     319parses the certificate and return the _first_ user that matches public key 
    320320*/ 
    321321static char * openssh_mapper_find_user(X509 *x509, void *context) { 
  • trunk/src/mappers/openssh_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of openssh_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/pwent_mapper.c

    r238 r358  
    4141* This mapper search the common name (CN) of the certificate in 
    4242* getpwent() passwd entries by trying to match login or gecos fields 
    43 *  
     43* 
    4444* note: nss implementations use /etc/nsswitch.conf as indicator to 
    4545* where to retrieve pw entries ( see man 5 nsswitch.conf ) 
     
    9898static int pwent_mapper_match_user(X509 *x509, const char *login, void *context) { 
    9999        char *str; 
    100         struct passwd *pw = getpwnam(login);  
     100        struct passwd *pw = getpwnam(login); 
    101101        char **entries  = cert_info(x509,CERT_CN,ALGORITHM_NULL); 
    102102        if (!entries) { 
  • trunk/src/mappers/pwent_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of pwent_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/subject_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of subject_mapper.h */ 
    4747#endif 
  • trunk/src/mappers/uid_mapper.c

    r238 r358  
    3838/* 
    3939* This mapper uses the Unique ID (UID) entry on the certificate to 
    40 * find user name.  
     40* find user name. 
    4141*/ 
    4242 
     
    4747/** 
    4848* Return the list of UID's on this certificate 
    49 */  
     49*/ 
    5050static char ** uid_mapper_find_entries(X509 *x509, void *context) { 
    5151        char **entries= cert_info(x509,CERT_UID,ALGORITHM_NULL); 
  • trunk/src/mappers/uid_mapper.h

    r233 r358  
    4343/* end of static (if any) declarations */ 
    4444#endif 
    45          
     45 
    4646/* End of uid_mapper.h */ 
    4747#endif 
  • trunk/src/pam_pkcs11/mapper_mgr.c

    r238 r358  
    8787                res->dbg_level=get_debug_level(); 
    8888                set_debug_level(old_level); 
    89             }  
     89            } 
    9090            if ( !mapper_init ) { 
    9191                DBG1("Static mapper '%s' not found",name); 
     
    9999                return NULL; 
    100100            } 
    101             mapper_init = ( mapper_module * (*)(scconf_block *blk, const char *mapper_name) )  
     101            mapper_init = ( mapper_module * (*)(scconf_block *blk, const char *mapper_name) ) 
    102102                dlsym(handler,"mapper_module_init"); 
    103103            if ( !mapper_init) { 
     
    131131 
    132132void unload_module( struct mapper_instance *module ) { 
    133         if (!module) {  
     133        if (!module) { 
    134134                DBG("Trying to unmap empty module"); 
    135135                return; 
     
    142142                set_debug_level(old_level); 
    143143        } 
    144         if (module->module_handler) {  
     144        if (module->module_handler) { 
    145145                DBG1("unloading module %s",module->module_name); 
    146146                dlclose(module->module_handler); 
     
    186186            struct mapper_instance *module = load_module(ctx,name); 
    187187            if (module) { 
    188                 struct mapper_listitem *item=  
     188                struct mapper_listitem *item= 
    189189                    (struct mapper_listitem *) malloc(sizeof(struct mapper_listitem)); 
    190190                if (!item) { 
     
    201201                } else { /* insert at end of list */ 
    202202                        last->next= item; 
    203                         last = item;     
     203                        last = item; 
    204204                } 
    205205            } 
     
    244244                item=item->next; 
    245245                continue; 
    246             }  
     246            } 
    247247            printf("Printing data for mapper %s:\n",item->module->module_name); 
    248248            for (str=*data; str; str=*++data) 
  • trunk/src/pam_pkcs11/mapper_mgr.h

    r238 r358  
    9292* This funcions goest throught the mapper list 
    9393* and trying to get the certificate strings to be used on each 
    94 * module to perform find/match functions.  
     94* module to perform find/match functions. 
    9595* No map / match are done: just print found strings on stdout. 
    9696* This function is mostly used in pkcert_view toool 
  • trunk/src/pam_pkcs11/pam_config.c

    r343 r358  
    114114           return; 
    115115        } 
    116         configuration.nullok =  
     116        configuration.nullok = 
    117117            scconf_get_bool(root,"nullok",configuration.nullok); 
    118         configuration.debug =  
     118        configuration.debug = 
    119119            scconf_get_bool(root,"debug",configuration.debug); 
    120120        /*if (configuration.debug) set_debug_level(1); 
    121121        else set_debug_level(0); */ 
    122         configuration.use_first_pass =  
     122        configuration.use_first_pass = 
    123123            scconf_get_bool(root,"use_first_pass",configuration.use_first_pass); 
    124         configuration.try_first_pass =  
     124        configuration.try_first_pass = 
    125125            scconf_get_bool(root,"try_first_pass",configuration.try_first_pass); 
    126         configuration.use_authok =  
     126        configuration.use_authok = 
    127127            scconf_get_bool(root,"use_authok",configuration.use_authok); 
    128         configuration.card_only =  
     128        configuration.card_only = 
    129129            scconf_get_bool(root,"card_only",configuration.card_only); 
    130         configuration.wait_for_card =  
     130        configuration.wait_for_card = 
    131131            scconf_get_bool(root,"wait_for_card",configuration.wait_for_card); 
    132132        configuration.pkcs11_module = ( char * ) 
     
    153153                        scconf_get_str(pkcs11_mblk,"slot_description",configuration.slot_description); 
    154154 
    155             configuration.slot_num =  
     155            configuration.slot_num = 
    156156                scconf_get_int(pkcs11_mblk,"slot_num",configuration.slot_num); 
    157157 
     
    166166            } 
    167167 
    168             configuration.support_threads =  
     168            configuration.support_threads = 
    169169                scconf_get_bool(pkcs11_mblk,"support_threads",configuration.support_threads); 
    170170            policy_list= scconf_find_list(pkcs11_mblk,"cert_policy"); 
     
    202202           for (count=0, tmp=screen_saver_list; tmp ; tmp=tmp->next, count++); 
    203203 
    204            configuration.screen_savers =  
     204           configuration.screen_savers = 
    205205                                (char **) malloc((count+1)*sizeof(char *)); 
    206206           for (i=0, tmp=screen_saver_list; tmp; tmp=tmp->next, i++) { 
  • trunk/src/pam_pkcs11/pam_pkcs11.c

    r341 r358  
    103103} 
    104104 
    105 static void  
     105static void 
    106106pam_syslog(pam_handle_t *pamh, int priority, const char *fmt, ...) 
    107107{ 
     
    222222          { 
    223223                ERR1("Remote login (from %s) is not (yet) supported", display); 
    224                 pam_syslog(pamh, LOG_ERR,  
     224                pam_syslog(pamh, LOG_ERR, 
    225225                        "Remote login (from %s) is not (yet) supported", 
    226226                        display); 
     
    234234  textdomain(PACKAGE); 
    235235#endif 
    236    
     236 
    237237  /* init openssl */ 
    238238  rv = crypto_init(&configuration->policy); 
     
    254254   *  2) if logged in, block in pam conversation until the token used for login 
    255255   *     is inserted 
    256    *  3) if not logged in, block until a token that could be used for logging in  
     256   *  3) if not logged in, block until a token that could be used for logging in 
    257257   *     is inserted 
    258258   * right now, logged in means PKC11_LOGIN_TOKEN_NAME is set, 
     
    274274 
    275275        pkcs11_pam_fail = PAM_CRED_INSUFFICIENT; 
    276          
     276 
    277277        /* look to see if username is already set */ 
    278278        rv = pam_get_item(pamh, PAM_USER, (const void **) &user); 
    279279        if (user) { 
    280280            DBG1("explicit username = [%s]", user); 
    281         }  
     281        } 
    282282  } else { 
    283283        sprintf(password_prompt, 
     
    289289 
    290290        if (rv != PAM_SUCCESS) { 
    291           pam_syslog(pamh, LOG_ERR,  
     291          pam_syslog(pamh, LOG_ERR, 
    292292                     "pam_get_user() failed %s", pam_strerror(pamh, rv)); 
    293293          return PAM_USER_UNKNOWN; 
     
    420420  if (rv != PAM_SUCCESS) { 
    421421    release_pkcs11_module(ph); 
    422     pam_syslog(pamh, LOG_ERR,  
     422    pam_syslog(pamh, LOG_ERR, 
    423423               "pam_get_pwd() failed: %s", pam_strerror(pamh, rv)); 
    424424    return pkcs11_pam_fail; 
     
    433433    memset(password, 0, strlen(password)); 
    434434    free(password); 
    435     pam_syslog(pamh, LOG_ERR,  
     435    pam_syslog(pamh, LOG_ERR, 
    436436         "password length is zero but the 'nullok' argument was not defined."); 
    437437    return PAM_AUTH_ERR; 
    438438  } 
    439439 
    440   /* call pkcs#11 login to ensure that the user is the real owner of the card  
     440  /* call pkcs#11 login to ensure that the user is the real owner of the card 
    441441   * we need to do thise before get_certificate_list because some tokens 
    442442   * can not read their certificates until the token is authenticated */ 
     
    444444  /* erase and free in-memory password data asap */ 
    445445  memset(password, 0, strlen(password)); 
    446   free(password);  
     446  free(password); 
    447447  if (rv != 0) { 
    448448    ERR1("open_pkcs11_login() failed: %s", get_error()); 
     
    471471      if (rv < 0) { 
    472472        ERR1("verify_certificate() failed: %s", get_error()); 
    473         pam_syslog(pamh, LOG_ERR,  
     473        pam_syslog(pamh, LOG_ERR, 
    474474                   "verify_certificate() failed: %s", get_error()); 
    475475        goto auth_failed_nopw; 
     
    482482 
    483483    if ( is_spaced_str(user) ) { 
    484       /*  
     484      /* 
    485485        if provided user is null or empty extract and set user 
    486486        name from certificate 
     
    499499          if (rv != PAM_SUCCESS) { 
    500500            ERR1("pam_set_item() failed %s", pam_strerror(pamh, rv)); 
    501             pam_syslog(pamh, LOG_ERR,  
     501            pam_syslog(pamh, LOG_ERR, 
    502502                       "pam_set_item() failed %s", pam_strerror(pamh, rv)); 
    503503            goto auth_failed_nopw; 
     
    528528  if (!chosen_cert) { 
    529529    ERR("no valid certificate which meets all requirements found"); 
    530     pam_syslog(pamh, LOG_ERR,  
     530    pam_syslog(pamh, LOG_ERR, 
    531531               "no valid certificate which meets all requirements found"); 
    532532    goto auth_failed_nopw; 
     
    541541    if (rv != 0) { 
    542542      ERR1("get_private_key() failed: %s", get_error()); 
    543       pam_syslog(pamh, LOG_ERR,  
     543      pam_syslog(pamh, LOG_ERR, 
    544544                 "get_private_key() failed: %s", get_error()); 
    545545      goto auth_failed_nopw; 
     
    557557    /* sign random value */ 
    558558    signature = NULL; 
    559     rv = sign_value(ph, chosen_cert, random_value, sizeof(random_value),  
     559    rv = sign_value(ph, chosen_cert, random_value, sizeof(random_value), 
    560560                    &signature, &signature_length); 
    561561    if (rv != 0) { 
     
    588588   */ 
    589589  snprintf(env_temp, sizeof(env_temp) - 1, 
    590            "PKCS11_LOGIN_TOKEN_NAME=%.*s",  
     590           "PKCS11_LOGIN_TOKEN_NAME=%.*s", 
    591591           (sizeof(env_temp) - 1) - strlen("PKCS11_LOGIN_TOKEN_NAME="), 
    592592           get_slot_tokenlabel(ph)); 
     
    595595  if (rv != PAM_SUCCESS) { 
    596596    ERR1("could not put token name in environment: %s", 
    597          pam_strerror(pamh, rv));  
     597         pam_strerror(pamh, rv)); 
    598598    pam_syslog(pamh, LOG_ERR, "could not put token name in environment: %s", 
    599            pam_strerror(pamh, rv));  
     599           pam_strerror(pamh, rv)); 
    600600  } 
    601601 
     
    604604  if (issuer) { 
    605605    snprintf(env_temp, sizeof(env_temp) - 1, 
    606            "PKCS11_LOGIN_CERT_ISSUER=%.*s",  
     606           "PKCS11_LOGIN_CERT_ISSUER=%.*s", 
    607607           (sizeof(env_temp) - 1) - strlen("PKCS11_LOGIN_CERT_ISSUER="), 
    608608           issuer[0]); 
     
    615615  if (rv != PAM_SUCCESS) { 
    616616    ERR1("could not put cert issuer in environment: %s", 
    617          pam_strerror(pamh, rv));  
     617         pam_strerror(pamh, rv)); 
    618618    pam_syslog(pamh, LOG_ERR, "could not put cert issuer in environment: %s", 
    619            pam_strerror(pamh, rv));  
     619           pam_strerror(pamh, rv)); 
    620620  } 
    621621 
     
    624624  if (serial) { 
    625625    snprintf(env_temp, sizeof(env_temp) - 1, 
    626            "PKCS11_LOGIN_CERT_SERIAL=%.*s",  
     626           "PKCS11_LOGIN_CERT_SERIAL=%.*s", 
    627627           (sizeof(env_temp) - 1) - strlen("PKCS11_LOGIN_CERT_SERIAL="), 
    628628           serial[0]); 
     
    635635  if (rv != PAM_SUCCESS) { 
    636636    ERR1("could not put cert serial in environment: %s", 
    637          pam_strerror(pamh, rv));  
     637         pam_strerror(pamh, rv)); 
    638638    pam_syslog(pamh, LOG_ERR, "could not put cert serial in environment: %s", 
    639            pam_strerror(pamh, rv));  
     639           pam_strerror(pamh, rv)); 
    640640  } 
    641641 
     
    677677{ 
    678678  ERR("Warning: Function pm_sm_acct_mgmt() is not implemented in this module"); 
    679   pam_syslog(pamh, LOG_WARNING,  
     679  pam_syslog(pamh, LOG_WARNING, 
    680680             "Function pm_sm_acct_mgmt() is not implemented in this module"); 
    681681  return PAM_SERVICE_ERR; 
     
    685685{ 
    686686  ERR("Warning: Function pam_sm_open_session() is not implemented in this module"); 
    687   pam_syslog(pamh, LOG_WARNING,  
     687  pam_syslog(pamh, LOG_WARNING, 
    688688             "Function pm_sm_open_session() is not implemented in this module"); 
    689689  return PAM_SERVICE_ERR; 
     
    693693{ 
    694694  ERR("Warning: Function pam_sm_close_session() is not implemented in this module"); 
    695   pam_syslog(pamh, LOG_WARNING,  
     695  pam_syslog(pamh, LOG_WARNING, 
    696696           "Function pm_sm_close_session() is not implemented in this module"); 
    697697  return PAM_SERVICE_ERR; 
     
    703703 
    704704  ERR("Warning: Function pam_sm_chauthtok() is not implemented in this module"); 
    705   pam_syslog(pamh, LOG_WARNING,  
     705  pam_syslog(pamh, LOG_WARNING, 
    706706             "Function pam_sm_chauthtok() is not implemented in this module"); 
    707707 
  • trunk/src/scconf/README.scconf

    r2 r358  
    1919  - anything else but data. No locking, no threads etc. 
    2020 
    21 It has heirarchical data blocks, it has lists.  
     21It has heirarchical data blocks, it has lists. 
    2222 
    2323Similar, but different: 
     
    217217                         * block has an item with this key. Run the block 
    218218                         * or blocks found against the rest of this entry 
    219                          * Stop after the first one, unless  
    220                          * SCCONF_ALL_BLOCKS is set in flags  
     219                         * Stop after the first one, unless 
     220                         * SCCONF_ALL_BLOCKS is set in flags 
    221221        unsigned int type; 
    222222                         * SCCONF_CALLBACK 
     
    227227                         *              int depth); 
    228228                         *      run the callback with the block found 
    229                          *  
     229                         * 
    230230                         * SCCONF_BLOCK 
    231231                         *      param contains a pointer to another entry table 
     
    270270                         *                   can be stored 
    271271                         * 
    272                          *  
     272                         * 
    273273        unsigned int flags; 
    274274                         * SCCONF_PRESENT 
     
    299299 
    300300typedef struct _scconf_entry { 
    301         const char *name;                
    302                          * key value for blocks and items *  
     301        const char *name; 
     302                         * key value for blocks and items * 
    303303        unsigned int type; 
    304304                         * SCCONF_CALLBACK 
     
    308308                         *              scconf_entry* entry, 
    309309                         *              int depth); 
    310                          *  
     310                         * 
    311311                         * SCCONF_BLOCK 
    312312                         *      param contains a pointer to another entry table 
    313313                         *      the entry table is added as a block to the 
    314314                         *      current block, with name as the key, and 
    315                          *      arg is a list of names  
     315                         *      arg is a list of names 
    316316                         * 
    317317                         * SCCONF_LIST 
     
    321321                         *      these add key=value pairs to the current 
    322322                         *      block. The value is in parm. 
    323                          *  
     323                         * 
    324324        unsigned int flags; 
    325325                         * SCCONF_PRESENT 
  • trunk/src/scconf/parse.c

    r233 r358  
    7272        parser->warnings = 1; 
    7373 
    74         snprintf(parser->emesg, sizeof(parser->emesg),  
     74        snprintf(parser->emesg, sizeof(parser->emesg), 
    7575                "Line %d: missing '%s', ignoring\n", 
    7676                parser->line, token); 
     
    355355                        break; 
    356356                default: 
    357                         snprintf(parser->emesg, sizeof(parser->emesg),  
     357                        snprintf(parser->emesg, sizeof(parser->emesg), 
    358358                                "Line %d: bad token ignoring\n", 
    359359                                parser->line); 
  • trunk/src/tools/card_eventmgr.c

    r323 r358  
    129129                DBG1("No action list for event '%s'",action); 
    130130                return 0; 
    131         }  
     131        } 
    132132        DBG1("Onerror is set to: '%s'",onerrorstr); 
    133133        while (actionlist) { 
     
    136136                DBG1("Executiong action: '%s'",action_cmd); 
    137137                /* 
    138                 there are some security issues on using system() in  
     138                there are some security issues on using system() in 
    139139                setuid/setgid programs. so we will use an alternate function 
    140                 */  
     140                */ 
    141141                /* res=system(action_cmd); */ 
    142142                res = my_system(action_cmd); 
     
    149149                    case ONERROR_RETURN: return 0; 
    150150                    case ONERROR_QUIT:  thats_all_folks(); 
    151                                         exit(0);  
     151                                        exit(0); 
    152152                    default:            DBG("Invalid onerror value"); 
    153                                         return -1;                  
     153                                        return -1; 
    154154                } 
    155155        } 
     
    347347        return 1; 
    348348    } 
    349      
     349 
    350350    /* put my self into background if flag is set */ 
    351351    if (daemonize) { 
  • trunk/src/tools/pkcs11_eventmgr.c

    r349 r358  
    8484  int current_slot; 
    8585}; 
    86   
     86 
    8787#endif 
    8888 
     
    107107      return; 
    108108    } 
    109   
     109 
    110110    /* release pkcs #11 module */ 
    111111    DBG("releasing pkcs #11 module..."); 
     
    166166                DBG1("No action list for event '%s'",action); 
    167167                return 0; 
    168         }  
     168        } 
    169169        DBG1("Onerror is set to: '%s'",onerrorstr); 
    170170        while (actionlist) { 
     
    173173                DBG1("Executiong action: '%s'",action_cmd); 
    174174                /* 
    175                 there are some security issues on using system() in  
     175                there are some security issues on using system() in 
    176176                setuid/setgid programs. so we will use an alternate function 
    177                 */  
     177                */ 
    178178                /* res=system(action_cmd); */ 
    179179                res = my_system(action_cmd); 
     
    186186                    case ONERROR_RETURN: return 0; 
    187187                    case ONERROR_QUIT:  thats_all_folks(); 
    188                                         exit(0);  
     188                                        exit(0); 
    189189                    default:            DBG("Invalid onerror value"); 
    190                                         return -1;                  
     190                                        return -1; 
    191191                } 
    192192        } 
     
    313313    struct SlotStatusStr *tmp; 
    314314    tmp = (struct SlotStatusStr *) 
    315             realloc(slotStatus,  
     315            realloc(slotStatus, 
    316316                (maxEntries+ENTRY_STEP)*sizeof(struct SlotStatusStr)); 
    317317    if (!tmp) { 
     
    391391    } 
    392392 
    393     /* acquire the module before we daemonize so we can return an error  
     393    /* acquire the module before we daemonize so we can return an error 
    394394     * to the user if it fails */ 
    395395    DBG("loading the module ..."); 
    396396    if (pkcs11_module) { 
    397397#define SPEC_TEMPLATE "library=\"%s\" name=\"SmartCard\"" 
    398         char *moduleSpec =  
     398        char *moduleSpec = 
    399399                (char *)malloc(sizeof(SPEC_TEMPLATE) + strlen(pkcs11_module)); 
    400400        if (!moduleSpec) { 
     
    403403        } 
    404404        sprintf(moduleSpec,SPEC_TEMPLATE, pkcs11_module); 
    405         DBG2("loading Module explictly, moduleSpec=<%s> module=%s\n",  
     405        DBG2("loading Module explictly, moduleSpec=<%s> module=%s\n", 
    406406                                                moduleSpec, pkcs11_module); 
    407407        module = SECMOD_LoadUserModule(moduleSpec, NULL, 0); 
     
    415415        } 
    416416    } else { 
    417         /* no module specified? look for one in the our of NSS's  
     417        /* no module specified? look for one in the our of NSS's 
    418418         * secmod.db */ 
    419419        SECMODModuleList *modList = SECMOD_GetDefaultModuleList(); 
    420420 
    421         /* threaded applications should also acquire the  
     421        /* threaded applications should also acquire the 
    422422         * DefaultModuleListLock */ 
    423423        DBG("Looking up new module\n"); 
     
    447447#endif 
    448448 
    449     /*  
     449    /* 
    450450     * Wait endlessly for all events in the list of readers 
    451451     * We only stop in case of an error 
     
    457457         * otherwise it polls by hand*/ 
    458458        struct SlotStatusStr *slotStatus; 
    459         PK11SlotInfo *slot = SECMOD_WaitForAnyTokenEvent(module, 0,  
     459        PK11SlotInfo *slot = SECMOD_WaitForAnyTokenEvent(module, 0, 
    460460                        PR_SecondsToInterval(polling_time)); 
    461461 
     
    475475           if (series != slotStatus->series) { 
    476476#ifdef notdef 
    477                 /* if one was already present, remove it  
     477                /* if one was already present, remove it 
    478478                 * This can happen if you pull the token and insert it 
    479479                 * before the PK11_IsPresent call above */ 
     
    542542    ph->should_finalize = 1; 
    543543 
    544     /*  
     544    /* 
    545545     * Wait endlessly for all events in the list of readers 
    546546     * We only stop in case of an error 
     
    584584                    DBG("Card removed, "); 
    585585                    execute_event("card_remove"); 
    586                 /*  
     586                /* 
    587587                some pkcs11's fails on reinsert card. To avoid this 
    588                 re-initialize library on card removal  
    589                 */       
     588                re-initialize library on card removal 
     589                */     
    590590                DBG("Re-initialising pkcs #11 module..."); 
    591591                rv = ph->fl->C_Finalize(NULL); 
  • trunk/src/tools/pkcs11_listcerts.c

    r332 r358  
    8686  if (configuration->slot_description != NULL) { 
    8787    rv = find_slot_by_slotlabel(ph,configuration->slot_description, &slot_num); 
    88   } else {  
     88  } else { 
    8989    rv = find_slot_by_number(ph,configuration->slot_num, &slot_num); 
    9090  } 
     
    124124    char **name; 
    125125    X509 *cert=get_X509_certificate(certs[i]); 
    126      
     126 
    127127    DBG1("Certificate #%d:", i+1); 
    128128    name = cert_info(cert, CERT_SUBJECT, ALGORITHM_NULL); 
  • trunk/src/tools/pkcs11_setup.c

    r320 r358  
    6767    char *lstitem = NULL; 
    6868    char *next; 
    69      
     69 
    7070    while (value != NULL) { 
    7171        if ((next=strchr(value, ',')) != NULL) { 
     
    8282        free(lstitem); 
    8383    } 
    84          
     84 
    8585    item = scconf_item_add(NULL, block, NULL, SCCONF_ITEM_TYPE_VALUE, option, list); 
    8686 
     
    121121    for (i=0; pkcs11_blocks[i]; i++) { 
    122122        void *libhandle; 
    123         const char *path =  
     123        const char *path = 
    124124                scconf_get_str(pkcs11_blocks[i], "module", NULL); 
    125125        /* check to see if the module exists on the system */ 
     
    136136        } 
    137137    } 
    138      
     138 
    139139    result = 0; 
    140140 
    141 bail:  
     141bail: 
    142142    if (ctx) { 
    143143        scconf_free(ctx); 
     
    169169    result = 0; 
    170170 
    171     bail:  
     171    bail: 
    172172    if (ctx) { 
    173173        scconf_free(ctx); 
     
    231231        result = scconf_write(ectx, NULL); 
    232232 
    233 bail:  
     233bail: 
    234234        if (modules) { 
    235235                free(modules); 
     
    241241                scconf_free(ectx); 
    242242        } 
    243          
     243 
    244244        return result; 
    245245} 
     
    267267                goto bail; 
    268268        } 
    269         event_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr, "event",  
     269        event_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr, "event", 
    270270                                                "card_insert"); 
    271271        if (!event_blocks || !event_blocks[0]) { 
     
    315315                goto bail; 
    316316        } 
    317         insert_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr,  
     317        insert_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr, 
    318318                                                "event", "card_insert"); 
    319319        if (!insert_blocks || !insert_blocks[0]) { 
     
    357357                goto bail; 
    358358        } 
    359         event_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr, "event",  
     359        event_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr, "event", 
    360360                                                "card_remove"); 
    361361        if (!event_blocks || !event_blocks[0]) { 
     
    405405                goto bail; 
    406406        } 
    407         insert_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr,  
     407        insert_blocks = scconf_find_blocks(ctx, pkcs11_eventmgr, 
    408408                                                "event", "card_remove"); 
    409409        if (!insert_blocks || !insert_blocks[0]) { 
     
    430430    unsigned int pname; 
    431431    const char *params[NUM_PARAMS]; 
    432      
     432 
    433433    memset(params, '\0', sizeof(params)); 
    434      
     434 
    435435    for (i = 1; i < argc; i++) { 
    436436        for (pname = 0; pname < NUM_PARAMS; pname++) { 
     
    448448                        params[pname] = (void *)1; 
    449449                    } 
    450                 }  
    451         } 
    452     } 
    453      
     450                } 
     451        } 
     452    } 
     453 
    454454    for (pname = 0; pname < NUM_PARAMS; pname++) { 
    455455            if (params[pname] != NULL) 
    456456                break; 
    457457    } 
    458      
     458 
    459459    if (pname == NUM_PARAMS) { 
    460460        DBG("No correct parameter specified"); 
     
    463463               "                    [rm_action[=<executable,executable,...>]]\n"); 
    464464    } 
    465      
     465 
    466466    if (params[LIST_MODULES] != NULL) { 
    467467        DBG("List modules:"); 
    468468        return list_modules(); 
    469     }  
     469    } 
    470470    else { 
    471471        if (params[USE_MODULE] == (void *)1) { 
     
    491491            } 
    492492            return 0; 
    493         }        
     493        } 
    494494        else if (params[INS_ACTION] != NULL) { 
    495495            DBG1("Set card insert action: %s", params[INS_ACTION]); 
     
    506506            } 
    507507            return 0; 
    508         }         
     508        } 
    509509        else if (params[RM_ACTION] != NULL) { 
    510510            DBG1("Set card remove action: %s", params[RM_ACTION]); 
     
    513513                return i; 
    514514            } 
    515         }         
     515        } 
    516516    } 
    517517    DBG("Process completed"); 
  • trunk/src/tools/pklogin_finder.c

    r332 r358  
    8888  if (configuration->slot_description != NULL) { 
    8989    rv = find_slot_by_slotlabel(ph,configuration->slot_description, &slot_num); 
    90   } else {  
     90  } else { 
    9191    rv = find_slot_by_number(ph,configuration->slot_num, &slot_num); 
    9292  } 
Note: See TracChangeset for help on using the changeset viewer.