Douglas E. Engert: The pkcs15-gemsafeV1.c code assumes that the key_ref is always 3. But that is not always the case. In our case it is 4. The patch tries to determine the key_ref by looking at what appears to be a table of allocated keys, and picking the first allocated key. 
Douglas E. Engert:
The pkcs15-gemsafeV1.c code assumes that the key_ref is always 3. But that is
not always the case. In our case it is 4. The patch tries to determine the
key_ref by looking at what appears to be a table of allocated keys, and picking
the first allocated key. 

In case this is not always true, the patch will also allow for the the
opensc.conf card flag = n to specify the key_ref as the low order 4 bits of the
flag.


git-svn-id: 444ed946b9c2220da791e84c3dd156a05f92db99@3557 c6295689-39f2-0310-b995-f0e70906c6a9

OpenSC/OpenSC,germanblanco/OpenSC,velter/OpenSC,ieugen/OpenSC,dirkx/OpenSC,CardContact/OpenSC,rickyepoderi/OpenSC,UIKit0/OpenSC,fabled/OpenSC,kasparsd/opensc-latvia-id,mouse07410/OpenSC,aobaid/OpenSC,germanblanco/OpenSC,marschap/pkg-opensc,dirkx/OpenSC.tokend,marschap/pkg-opensc,UIKit0/OpenSC,frankmorgner/OpenSC,dirkx/OpenSC.tokend,l1k/OpenSC,jpki/OpenSC,LudovicRousseau/OpenSC,rickyepoderi/OpenSC,gemini/OpenSC,adminmt/OpenSC,0x7678/myOpenSC,AktivCo/OpenSC,fabled/OpenSC,0x7678/OpenSC,jpki/OpenSC,carlhoerberg/OpenSC,UIKit0/OpenSC,0x7678/myOpenSC,frankmorgner/OpenSC,marschap/pkg-opensc,dirkx/OpenSC,martinpaljak/OpenSC,dengert/OpenSC,0x7678/myOpenSC,aobaid/OpenSC,ieugen/OpenSC,mtrojnar/OpenSC,martinpaljak/OpenSC,metsma/OpenSC,OpenSC/OpenSC,CardContact/OpenSC,gentoo/OpenSC,dengert/OpenSC,hhonkanen/OpenSC,gentoo/OpenSC,gemini/OpenSC,marschap/pkg-opensc,kasparsd/opensc-latvia-id,philipWendland/OpenSC,kasparsd/opensc-latvia-id,financeX/OpenSC,martinpaljak/OpenSC,0x7678/myOpenSC,l1k/OpenSC,velter/OpenSC,dengert/OpenSC,metsma/OpenSC,Jakuje/OpenSC,nmav/OpenSC,adminmt/OpenSC,tidatida/OpenSC,financeX/OpenSC,metsma/OpenSC,hongquan/OpenSC-main,germanblanco/OpenSC,gentoo/OpenSC,ieugen/OpenSC,Jakuje/OpenSC,philipWendland/OpenSC,nmav/OpenSC,rickyepoderi/OpenSC,mtrojnar/OpenSC,tidatida/OpenSC,financeX/OpenSC,dirkx/OpenSC.tokend,LudovicRousseau/OpenSC,mouse07410/OpenSC,adminmt/OpenSC,LudovicRousseau/OpenSC,carlhoerberg/OpenSC,financeX/OpenSC,viktorTarasov/OpenSC-SM,dirkx/OpenSC,hhonkanen/OpenSC,carlhoerberg/OpenSC,hongquan/OpenSC-main,gentoo/OpenSC,tidatida/OpenSC,velter/OpenSC,fabled/OpenSC,hongquan/OpenSC-main,OpenSC/OpenSC,gentoo/OpenSC,AktivCo/OpenSC,velter/OpenSC,frankmorgner/OpenSC,0x7678/OpenSC,gemini/OpenSC,hhonkanen/OpenSC,philipWendland/OpenSC,aobaid/OpenSC,UIKit0/OpenSC,carlhoerberg/OpenSC,ieugen/OpenSC,0x7678/OpenSC,0x7678/OpenSC,Jakuje/OpenSC,AktivCo/OpenSC,Jakuje/OpenSC,CardContact/OpenSC,mouse07410/OpenSC,aobaid/OpenSC,fabled/OpenSC,dirkx/OpenSC.tokend,0x7678/myOpenSC,carlhoerberg/OpenSC,kasparsd/opensc-latvia-id,l1k/OpenSC,dirkx/OpenSC,dirkx/OpenSC.tokend,viktorTarasov/OpenSC-SM,dirkx/OpenSC.tokend,adminmt/OpenSC,financeX/OpenSC,dirkx/OpenSC,nmav/OpenSC,frankmorgner/OpenSC,jpki/OpenSC,ieugen/OpenSC,tidatida/OpenSC,mtrojnar/OpenSC,viktorTarasov/OpenSC-SM