Hello,

Ludovic Rousseau:
> 2009/6/23 Aktiv Co. Aleksey Samsonov <[email protected]>:
>> I propose the attached patch for iso7816.c.
> 
> Can you split the patch is small and independent patches please?
> And for each patch explain what the patch does and/or why it is needed.
> 
> For example you can create one patch with only the assert() calls, etc.

Patches for trunk revision 3698 are in attachment.

1) opensc-trunk-r3698_new1.diff

Fix:
If (in_path->type == SC_PATH_TYPE_PARENT) then:
src/libopensc/iso7816.c:
433                     apdu.p1 = 3;
434                     pathlen = 0;
435                     apdu.cse = SC_APDU_CASE_2_SHORT;
and if (file_out == NULL) then
452                     apdu.cse = SC_APDU_CASE_3_SHORT;

=> apdu.lc == 0 && apdu.le = 0, but  apdu.cse = SC_APDU_CASE_3_SHORT; 
sc_transmit_apdu -> sc_check_apdu -> error


2) opensc-trunk-r3698_new2.diff
Fix for the case when "apdu.resplen < 2" and checked buffer length.

3) opensc-trunk-r3698_new3.diff
Check buffer length (*outlen)

4) opensc-trunk-r3698_new4.diff
Add assert() calls to check constant buffer size.

5) opensc-trunk-r3698_new5.diff
Remove dead code.

Thanks
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to