performance: sc_read_record and file caching

Martin Vogt <[email protected]> Wed, 15 Jul 2026 15:18:35 +0200
Newsgroups gmane.comp.encryption.opensc.devel
Message-ID <CAOE8yMA=StV_ihgCNC8GSzvvK7r-sEdCOnz+ujiqUc6Jk8Z5vg@mail.gmail.com>
--===============3161346644359792420==
Content-Type: multipart/alternative; boundary="000000000000de68750656a62931"

--000000000000de68750656a62931
Content-Type: text/plain; charset="UTF-8"

Hello,

I'm seeing with use_file_caching some files which can't be cached.
Over a remote connection (RDP) these APDU calls accumulate, so I checked
what can be the problem.

Maybe there is something missing in my card driver? (card-jcop.c)
It's pretty obvious in the debug log, why it won't get cached, of course,
but the implementation
is not not used, at all, for all card-drivers.c, except one.

This makes me ask myself how important this implementation really is,
because
my card driver overall works. (--test, de/encrypt..)


Here is the sequence, which ends up that the file "4408" does not get
cached:

Start: pkcs15 wants to read 4408:

P:12866; T:0x140494969562752 14:35:34.208 [opensc-pkcs11]
pkcs15-cache.c:132:sc_pkcs15_read_cached_file: try to read cache for
3f0050154408
[...] messages which turns out to end in:
P:12866; T:0x140494969562752 14:35:34.209 [opensc-pkcs11]
card.c:836:sc_select_file: called; type=2, path=3f0050154408
[...]
Outgoing APDU (18 bytes):
00 A4 04 00 0C A0 00 00 00 63 50 4B 43 53 2D 31 .........cPKCS-1
35 00                                           5.
[...] here the APUD for 4408
Outgoing APDU (8 bytes):
00 A4 00 00 02 44 08 00 .....D..
Incoming APDU (28 bytes):
6F 18 80 02 00 50 82 06 05 21 00 FE 00 04 83 02 o....P...!......
44 08 86 06 00 64 64 FF FF FF 90 00             D....dd.....


And now it parses the fci, which looks ok.
P:13178; T:0x140715934025344 14:42:49.010 [opensc-pkcs11]
apdu.c:382:sc_single_transmit: returning with: 0 (Success)
P:13178; T:0x140715934025344 14:42:49.010 [opensc-pkcs11]
apdu.c:539:sc_transmit: returning with: 0 (Success)
P:13178; T:0x140715934025344 14:42:49.010 [opensc-pkcs11]
card.c:515:sc_unlock: called
P:13178; T:0x140715934025344 14:42:49.010 [opensc-pkcs11]
iso7816.c:471:iso7816_process_fci:   bytes in file: 80
P:13178; T:0x140715934025344 14:42:49.010 [opensc-pkcs11]
iso7816.c:480:iso7816_process_fci:   shareable: no
P:13178; T:0x140715934025344 14:42:49.010 [opensc-pkcs11]
iso7816.c:500:iso7816_process_fci:   type: working EF
P:13178; T:0x140715934025344 14:42:49.010 [opensc-pkcs11]
iso7816.c:501:iso7816_process_fci:   EF structure: 5
P:13178; T:0x140715934025344 14:42:49.011 [opensc-pkcs11]
iso7816.c:502:iso7816_process_fci:   tag 0x82: 0x05
P:13178; T:0x140715934025344 14:42:49.011 [opensc-pkcs11]
iso7816.c:511:iso7816_process_fci:   record length: 254
P:13178; T:0x140715934025344 14:42:49.011 [opensc-pkcs11]
iso7816.c:520:iso7816_process_fci:   records: 4
P:13178; T:0x140715934025344 14:42:49.011 [opensc-pkcs11]
iso7816.c:533:iso7816_process_fci:   file identifier: 0x4408
P:13178; T:0x140715934025344 14:42:49.011 [opensc-pkcs11]
card.c:871:sc_select_file: returning with: 0 (Success)

Now it calls sc_read_record, which fails, because its not implemented.
"NULL":

P:13178; T:0x140715934025344 14:42:49.012 [opensc-pkcs11]
card.c:948:sc_read_record: called
P:13178; T:0x140715934025344 14:42:49.012 [opensc-pkcs11]
card.c:953:sc_read_record: returning with: -1408 (Not supported)
P:13178; T:0x140715934025344 14:42:49.012 [opensc-pkcs11]
card.c:515:sc_unlock: called
P:13178; T:0x140715934025344 14:42:49.012 [opensc-pkcs11]
reader-pcsc.c:770:pcsc_unlock: called
P:13178; T:0x140715934025344 14:42:49.013 [opensc-pkcs11]
pkcs15.c:2646:sc_pkcs15_read_file: returning with: -1408 (Not supported)
P:13178; T:0x140715934025344 14:42:49.013 [opensc-pkcs11]
pkcs15.c:2178:sc_pkcs15_parse_df: pkcs15 read file failed: -1408 (Not
supported)


In the source code the sequence looks like this (start with EF "5"):

iso7816_process_fci:   EF structure: 5

src/libopensc/types.h:#define SC_FILE_EF_LINEAR_VARIABLE_TLV    0x05


pkcs15.c:2561:
if (file->ef_structure == SC_FILE_EF_LINEAR_VARIABLE_TLV) {
       unsigned int i;
       size_t l, record_len;
       unsigned char *head = data;
       for (i=1; ; i++) {
               l = len - (head - data);
               if (l > 256) {
                       l = 256;
               }
               r = sc_read_record(p15card->card, i, 0, head, l,
SC_RECORD_BY_REC_NR);
               if (r == SC_ERROR_RECORD_NOT_FOUND)
                       break;
               if (r < 0) {
                       goto fail_unlock;
               }

And then pkcs15-cache.c ends  int goto fail:

fail:
       free(data);
       sc_file_free(file);
       LOG_FUNC_RETURN(ctx, r);
}

P:13178; T:0x140715934025344 14:42:49.013 [opensc-pkcs11]
pkcs15.c:2646:sc_pkcs15_read_file: returning with: -1408 (Not supported)
P:13178; T:0x140715934025344 14:42:49.013 [opensc-pkcs11]
pkcs15.c:2178:sc_pkcs15_parse_df: pkcs15 read file failed: -1408 (Not
supported)
P:13178; T:0x140715934025344 14:42:49.013 [opensc-pkcs11]
misc.c:72:sc_to_cryptoki_error_common: libopensc return value: 0 (Success)


As a result :

/* no record oriented file services */
jcop_ops.read_record = NULL;

leads to -1408 (Not supported) and the file get not cached, pretty clear.

So it should be implemented, of course, but otherwise the driver
seems to work fine (it passed --test) and I can sign,de/encrypt etc..


$ grep "\.read_record" card*.c | grep "=" | grep -v NULL
card-oberthur.c:        auth_ops.read_record = auth_read_record;

==> There is only one card-driver of all which implements this call.


best regards,

Martin

--000000000000de68750656a62931
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div><br></div><div><span style=3D"font-family:monospa=
ce"><span style=3D"color:rgb(0,0,0)">Hello,</span><span style=3D"color:rgb(=
0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">I&#39;m seeing with use_file_caching s=
ome files which can&#39;t be cached.</span><span style=3D"color:rgb(0,0,0)"=
>
</span><br><span style=3D"color:rgb(0,0,0)">Over a remote connection (RDP) =
these APDU calls accumulate, so I checked what can be the problem.</span><s=
pan style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">Maybe there is something missing in my=
 card driver? (card-jcop.c)</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">It&#39;s pretty obvious in the =
debug log, why it won&#39;t get cached, of course, but the implementation</=
span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">is not not used, at all, for al=
l card-drivers.c, except one.</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">This makes me ask myself how important=
 this implementation really is, because</span><span style=3D"color:rgb(0,0,=
0)">
</span><br><span style=3D"color:rgb(0,0,0)">my card driver overall works. (=
--test, de/encrypt..)</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br>
<br><span style=3D"color:rgb(0,0,0)">Here is the sequence, which ends up th=
at the file &quot;4408&quot; does not get cached:</span><span style=3D"colo=
r:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">Start: pkcs15 wants to read 4408:</spa=
n><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">P:12866; T:0x140494969562752 14:35:34.=
208 [opensc-pkcs11] pkcs15-cache.c:132:sc_pkcs15_read_cached_file: try to r=
ead cache for 3f0050154408</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">[...] messages which turns out =
to end in:</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:12866; T:0x140494969562752 14=
:35:34.209 [opensc-pkcs11] card.c:836:sc_select_file: called; type=3D2, pat=
h=3D3f0050154408</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">[...]</span><span style=3D"colo=
r:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">Outgoing APDU (18 bytes):</span=
><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">00 A4 04 00 0C A0 00 00 00 63 5=
0 4B 43 53 2D 31 .........cPKCS-1</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">35 00</span><span style=3D"colo=
r:rgb(0,0,0)"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</span><span style=3D"color:rgb(0=
,0,0)">5.</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">[...] here the APUD for 4408</s=
pan><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">Outgoing APDU (8 bytes):</span>=
<span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">00 A4 00 00 02 44 08 00 .....D.=
.</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">Incoming APDU (28 bytes):</span=
><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">6F 18 80 02 00 50 82 06 05 21 0=
0 FE 00 04 83 02 o....P...!......</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">44 08 86 06 00 64 64 FF FF FF 9=
0 00</span><span style=3D"color:rgb(0,0,0)"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</span><span style=3D"color:rgb(0=
,0,0)">D....dd.....</span><span style=3D"color:rgb(0,0,0)">
</span><br><br>
</span><span style=3D"font-family:monospace"><span style=3D"color:rgb(0,0,0=
)">
</span><br><span style=3D"color:rgb(0,0,0)">And now it parses the fci, whic=
h looks ok.</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.010 [opensc-pkcs11] apdu.c:382:sc_single_transmit: returning with: 0=
 (Success)</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.010 [opensc-pkcs11] apdu.c:539:sc_transmit: returning with: 0 (Succe=
ss)</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.010 [opensc-pkcs11] card.c:515:sc_unlock: called</span><span style=
=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.010 [opensc-pkcs11] iso7816.c:471:iso7816_process_fci: =C2=A0=C2=A0b=
ytes in file: 80</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.010 [opensc-pkcs11] iso7816.c:480:iso7816_process_fci: =C2=A0=C2=A0s=
hareable: no</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.010 [opensc-pkcs11] iso7816.c:500:iso7816_process_fci: =C2=A0=C2=A0t=
ype: working EF</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.010 [opensc-pkcs11] iso7816.c:501:iso7816_process_fci: =C2=A0=C2=A0E=
F structure: 5</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.011 [opensc-pkcs11] iso7816.c:502:iso7816_process_fci: =C2=A0=C2=A0t=
ag 0x82: 0x05</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.011 [opensc-pkcs11] iso7816.c:511:iso7816_process_fci: =C2=A0=C2=A0r=
ecord length: 254</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.011 [opensc-pkcs11] iso7816.c:520:iso7816_process_fci: =C2=A0=C2=A0r=
ecords: 4</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.011 [opensc-pkcs11] iso7816.c:533:iso7816_process_fci: =C2=A0=C2=A0f=
ile identifier: 0x4408</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.011 [opensc-pkcs11] card.c:871:sc_select_file: returning with: 0 (Su=
ccess)</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">Now it calls sc_read_record, which fai=
ls, because its not implemented. &quot;NULL&quot;:</span><span style=3D"col=
or:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14:42:49.=
012 [opensc-pkcs11] card.c:948:sc_read_record: called</span><span style=3D"=
color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.012 [opensc-pkcs11] card.c:953:sc_read_record: returning with: -1408=
 (Not supported)</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.012 [opensc-pkcs11] card.c:515:sc_unlock: called</span><span style=
=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.012 [opensc-pkcs11] reader-pcsc.c:770:pcsc_unlock: called</span><spa=
n style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.013 [opensc-pkcs11] pkcs15.c:2646:sc_pkcs15_read_file: returning wit=
h: -1408 (Not supported)</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.013 [opensc-pkcs11] pkcs15.c:2178:sc_pkcs15_parse_df: pkcs15 read fi=
le failed: -1408 (Not supported)</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br>
<br><span style=3D"color:rgb(0,0,0)">In the source code the sequence looks =
like this (start with EF &quot;5&quot;):</span><br><span style=3D"color:rgb=
(0,0,0)">
</span></span><span style=3D"font-family:monospace"><span style=3D"color:rg=
b(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">iso7816_process_fci: =C2=A0=C2=
=A0EF structure: 5</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">src/libopensc/types.h:#define SC_FILE_=
EF_LINEAR_VARIABLE_TLV</span><span style=3D"color:rgb(0,0,0)"> =C2=A0=C2=A0=
=C2=A0</span><span style=3D"color:rgb(0,0,0)">0x05</span><span style=3D"col=
or:rgb(0,0,0)">
</span><br>
<br>
<br><span style=3D"color:rgb(0,0,0)">pkcs15.c:2561:</span><span style=3D"co=
lor:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">if (file-&gt;ef_structure =3D=
=3D SC_FILE_EF_LINEAR_VARIABLE_TLV) {</span><span style=3D"color:rgb(0,0,0)=
">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:=
rgb(0,0,0)">unsigned int i;</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:=
rgb(0,0,0)">size_t l, record_len;</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:=
rgb(0,0,0)">unsigned char *head =3D data;</span><span style=3D"color:rgb(0,=
0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:=
rgb(0,0,0)">for (i=3D1; ; i++) {</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(0,0,0)">l =3D len - (he=
ad - data);</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(0,0,0)">if (l &gt; 256)=
 {</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
<span style=3D"color:rgb(0,0,0)">l =3D 256;</span><span style=3D"color:rgb(=
0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(0,0,0)">}</span><span s=
tyle=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(0,0,0)">r =3D sc_read_r=
ecord(p15card-&gt;card, i, 0, head, l, SC_RECORD_BY_REC_NR);</span><span st=
yle=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(0,0,0)">if (r =3D=3D SC=
_ERROR_RECORD_NOT_FOUND)</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
<span style=3D"color:rgb(0,0,0)">break;</span><span style=3D"color:rgb(0,0,=
0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(0,0,0)">if (r &lt; 0) {=
</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
<span style=3D"color:rgb(0,0,0)">goto fail_unlock;</span><span style=3D"col=
or:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(0,0,0)">}</span><span s=
tyle=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">And then pkcs15-cache.c ends =C2=A0int=
 goto fail:</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">fail:</span><span style=3D"color:rgb(0=
,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:=
rgb(0,0,0)">free(data);</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:=
rgb(0,0,0)">sc_file_free(file);</span><span style=3D"color:rgb(0,0,0)">
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:=
rgb(0,0,0)">LOG_FUNC_RETURN(ctx, r);</span><span style=3D"color:rgb(0,0,0)"=
>
</span><br><span style=3D"color:rgb(0,0,0)">}</span><span style=3D"color:rg=
b(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14:42:49.=
013 [opensc-pkcs11] pkcs15.c:2646:sc_pkcs15_read_file: returning with: -140=
8 (Not supported)</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.013 [opensc-pkcs11] pkcs15.c:2178:sc_pkcs15_parse_df: pkcs15 read fi=
le failed: -1408 (Not supported)</span><span style=3D"color:rgb(0,0,0)">
</span><br><span style=3D"color:rgb(0,0,0)">P:13178; T:0x140715934025344 14=
:42:49.013 [opensc-pkcs11] misc.c:72:sc_to_cryptoki_error_common: libopensc=
 return value: 0 (Success)</span><span style=3D"color:rgb(0,0,0)">
</span><br><br>
</span><span style=3D"font-family:monospace"><span style=3D"color:rgb(0,0,0=
)">
</span><br><span style=3D"color:rgb(0,0,0)">As a result :</span><span style=
=3D"color:rgb(0,0,0)">
</span><br>
<br> <span style=3D"color:rgb(0,0,0)">/* no record oriented file services *=
/</span><span style=3D"color:rgb(0,0,0)">
</span><br> <span style=3D"color:rgb(0,0,0)">jcop_ops.read_record =3D NULL;=
</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">leads to -1408 (Not supported) and the=
 file get not cached, pretty clear.</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">So it should be implemented, of course=
, but otherwise the driver </span><span style=3D"color:rgb(0,0,0)">=C2=A0</=
span><br><span style=3D"color:rgb(0,0,0)">seems to work fine (it passed --t=
est) and I can sign,de/encrypt etc.. </span><span style=3D"color:rgb(0,0,0)=
">=C2=A0</span><br>
<br>
<br><span style=3D"color:rgb(0,0,0)">$ grep &quot;\.read_record&quot; card*=
.c | grep &quot;=3D&quot; | grep -v NULL</span><span style=3D"color:rgb(0,0=
,0)">
</span><br><span style=3D"color:rgb(0,0,0)">card-oberthur.c:</span><span st=
yle=3D"color:rgb(0,0,0)"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</span>=
<span style=3D"color:rgb(0,0,0)">auth_ops.read_record =3D auth_read_record;=
</span><span style=3D"color:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">=3D=3D&gt; There is only one card-driv=
er of all which implements this call.</span><span style=3D"color:rgb(0,0,0)=
">
</span><br>
<br>
<br><span style=3D"color:rgb(0,0,0)">best regards,</span><span style=3D"col=
or:rgb(0,0,0)">
</span><br>
<br><span style=3D"color:rgb(0,0,0)">Martin</span><span style=3D"color:rgb(=
0,0,0)">
</span><br>
<br><br>
<br></span></div></div>

--000000000000de68750656a62931--


--===============3161346644359792420==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============3161346644359792420==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Opensc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensc-devel

--===============3161346644359792420==--