Show
Ignore:
Timestamp:
03/06/08 15:04:29 (10 months ago)
Author:
alonbl
Message:

Convert constant SC_PKCS11_MAX_VIRTUAL_SLOTS to configuration option.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/pkcs11/slot.c

    r3086 r3404  
    6464                avail = sc_pkcs11_conf.num_slots; 
    6565 
    66         if (first_free_slot + avail > SC_PKCS11_MAX_VIRTUAL_SLOTS) 
    67                 avail = SC_PKCS11_MAX_VIRTUAL_SLOTS - first_free_slot; 
     66        if (first_free_slot + avail > sc_pkcs11_conf.pkcs11_max_virtual_slots) 
     67                avail = sc_pkcs11_conf.pkcs11_max_virtual_slots - first_free_slot; 
    6868        card->first_slot = first_free_slot; 
    6969        card->max_slots = avail; 
     
    166166                CK_SLOT_ID id; 
    167167 
    168                 for (id = 0; id < SC_PKCS11_MAX_VIRTUAL_SLOTS; id++) 
     168                for (id = 0; id < sc_pkcs11_conf.pkcs11_max_virtual_slots; id++) 
    169169                        virtual_slots[id].events = 0; 
    170170        } 
     
    185185        sc_debug(context, "%d: smart card removed\n", reader); 
    186186 
    187         for (i=0; i<SC_PKCS11_MAX_VIRTUAL_SLOTS; i++) { 
     187        for (i=0; i<sc_pkcs11_conf.pkcs11_max_virtual_slots; i++) { 
    188188                if (virtual_slots[i].card && 
    189189                    virtual_slots[i].card->reader == reader) 
     
    246246                return CKR_CRYPTOKI_NOT_INITIALIZED; 
    247247 
    248         if (id < 0 || id >= SC_PKCS11_MAX_VIRTUAL_SLOTS) 
     248        if (id < 0 || id >= sc_pkcs11_conf.pkcs11_max_virtual_slots) 
    249249                return CKR_SLOT_ID_INVALID; 
    250250                 
     
    325325 
    326326        card_detect_all(); 
    327         for (id = 0; id < SC_PKCS11_MAX_VIRTUAL_SLOTS; id++) { 
     327        for (id = 0; id < sc_pkcs11_conf.pkcs11_max_virtual_slots; id++) { 
    328328                slot = &virtual_slots[id]; 
    329329                if ((slot->events & SC_EVENT_CARD_INSERTED)