e6b2ed6 Fix PKCS11 helper

Authored and Committed by mbasti 6 years ago
    Fix PKCS11 helper
    
    Slots in HSM are not assigned statically, we have to chose proper
    slot from token label.
    
    Softhsm i2.2.0 changed this behavior and now slots can change over
    time (it is allowed by pkcs11 standard).
    
    Changelog:
    * created method get_slot() that returns slot number from
      used label
    * replaces usage of slot in __init__ method of P11_Helper
      with label
    * slot is dynamically detected from token label before
      session is opened
    * pkcs11-util --init-token now uses '--free' instead '--slot'
      which uses first free slot (we don't care about slot numbers
      anymore)
    
    https://pagure.io/freeipa/issue/6692
    
    Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
    
        
file modified
+2 -0
file modified
+3 -2
file modified
+96 -10