2009/6/22 Aktiv Co. Aleksey Samsonov <samso...@guardant.ru>: > Hi, > > ISO 7816-4: 7.5.11 MANAGE SECURITY ENVIRONMENT command: > > Table 78 - P1 > b8 b7 b6 b5 b4 b3 b2 b1 Meaning > - - - 1 - - - - Secure messaging in command data field > - - 1 - - - - - Secure messaging in response data field > - 1 - - - - - - Computation, decipherment, internal authentication and key > agreement > 1 - - - - - - - Verification, encipherment, external authentication and key > agreement > - - - - 0 0 0 1 SET > 1 1 1 1 0 0 1 0 STORE > 1 1 1 1 0 0 1 1 RESTORE > 1 1 1 1 0 1 0 0 ERASE > * Any other value is reserved for future use by ISO/IEC JTC 1/SC 17. > > Could you please clarify this: > src/libopensc/iso7816.c:669:iso7816_set_security_env: > case SC_SEC_OPERATION_DECIPHER: > apdu.p1 = 0x81; /* ??? */ > apdu.p2 = 0xB8; > > May be (patch is in attachment)? > Thanks > > diff -u -r opensc-trunk-r3695/src/libopensc/iso7816.c > new/opensc-trunk-r3695/src/libopensc/iso7816.c > --- opensc-trunk-r3695/src/libopensc/iso7816.c 2008-12-27 > 19:15:30.000000000 +0300 > +++ new/opensc-trunk-r3695/src/libopensc/iso7816.c 2009-06-22 > 12:08:14.000000000 +0400 > @@ -667,7 +667,7 @@ > sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x22, 0, 0); > switch (env->operation) { > case SC_SEC_OPERATION_DECIPHER: > - apdu.p1 = 0x81; > + apdu.p1 = 0x41; > apdu.p2 = 0xB8; > break; > case SC_SEC_OPERATION_SIGN:
It looks like your patch is correct (according to ISO 7816-4 2003, page 54, 7.5.11 MANAGE SECURITY ENVIRONMENT command) Any objection from other list members? -- Dr. Ludovic Rousseau _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel