Show
Ignore:
Timestamp:
07/21/08 16:35:21 (4 months ago)
Author:
aj
Message:

Chaskiel Grundman:
Nowhere in pkcs15init/pkcs15-cardos.c is the user pin ever
requested or presented to the card.
Since the update acl for the key object uses the user pin, the GENERATE
KEY operation fails when it isn't logged in.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/pkcs15init/pkcs15-cardos.c

    r3517 r3537  
    309309        int             algorithm, r, delete_it = 0, use_ext_rsa = 0; 
    310310        size_t          keybits, rsa_max_size; 
    311          
     311        int             pin_id = -1; 
     312 
    312313        if (obj->type != SC_PKCS15_TYPE_PRKEY_RSA) 
    313314                return SC_ERROR_NOT_SUPPORTED; 
     
    334335                                "for key generation."); 
    335336                return SC_ERROR_NOT_SUPPORTED; 
     337        } 
     338       pin_id = sc_keycache_find_named_pin(&key_info->path, SC_PKCS15INIT_USER_PIN); 
     339       if (pin_id > 0) { 
     340                r = sc_pkcs15init_verify_key(profile, card, NULL, SC_AC_CHV, pin_id); 
     341                if (r < 0) 
     342                        return r; 
    336343        } 
    337344        if (use_ext_rsa == 0)