Merge pull request #385 from darconeous/patch-2
Allow PKCS15 cache to work with PIV cards (if enabled)
This commit is contained in:
commit
58d1f1db3f
|
@ -735,11 +735,13 @@ static int sc_pkcs15emu_piv_init(sc_pkcs15_card_t *p15card)
|
||||||
ckis[i].cert_found = 1;
|
ckis[i].cert_found = 1;
|
||||||
/* cache it using the PKCS15 emulation objects */
|
/* cache it using the PKCS15 emulation objects */
|
||||||
/* as it does not change */
|
/* as it does not change */
|
||||||
if (cert_der.value) {
|
if (cert_der.value) {
|
||||||
cert_info.value.value = cert_der.value;
|
cert_info.value.value = cert_der.value;
|
||||||
cert_info.value.len = cert_der.len;
|
cert_info.value.len = cert_der.len;
|
||||||
cert_info.path.len = 0; /* use in mem cert from now on */
|
if (!p15card->opts.use_file_cache) {
|
||||||
}
|
cert_info.path.len = 0; /* use in mem cert from now on */
|
||||||
|
}
|
||||||
|
}
|
||||||
/* following will find the cached cert in cert_info */
|
/* following will find the cached cert in cert_info */
|
||||||
r = sc_pkcs15_read_certificate(p15card, &cert_info, &cert_out);
|
r = sc_pkcs15_read_certificate(p15card, &cert_info, &cert_out);
|
||||||
if (r < 0 || cert_out->key == NULL) {
|
if (r < 0 || cert_out->key == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue