Package: libopensc2
Version: 0.11.4-3
Severity: wishlist
Tags: patch

Hello,

update_binary() was not foreseen by the middleware creators of BELPIC
so I added it, which allows to write some data in the
MF/ID/EF(Preferences) of the card.
Why did I add this? Just because it's possible :-)

--- card-belpic.c.orig  2008-03-12 13:03:07.000000000 +0100
+++ card-belpic.c       2008-03-12 13:03:38.000000000 +0100
@@ -1536,6 +1536,25 @@
        return r;
 }

+static int belpic_update_binary(sc_card_t *card,
+                                   unsigned int idx, u8 *buf, size_t count,
+                                   unsigned long flags)
+{
+       int r;
+
+       r = iso_ops->update_binary(card, idx, buf, count, flags);
+
+#ifdef HAVE_GUI
+       if (r == SC_ERROR_SECURITY_STATUS_NOT_SATISFIED &&
SSO_OK(card->ctx)) {
+               r = belpic_askpin_verify(card, SCR_USAGE_AUTH);
+               if (r == 0)
+                       r = iso_ops->update_binary(card, idx, buf,
count, flags);
+       }
+#endif
+
+       return r;
+}
+
 #if 0
 static int belpic_logout(sc_card_t *card)
 {
@@ -1566,6 +1585,7 @@

        belpic_ops.select_file = belpic_select_file;
        belpic_ops.read_binary = belpic_read_binary;
+       belpic_ops.update_binary = belpic_update_binary;
        belpic_ops.pin_cmd = belpic_pin_cmd;
        belpic_ops.set_security_env = belpic_set_security_env;


Demo: how to install Linux on the eID (hum, so to speak...)

$ opensc-explorer
OpenSC Explorer version 0.11.4
OpenSC [3F00]> cd df01
OpenSC [3F00/DF01]> verify CHV1 31:32:33:34
Code correct.
OpenSC [3F00/DF01]> put 4039 tux.txt
Total of 100 bytes written.

$ opensc-explorer
OpenSC Explorer version 0.11.4
OpenSC [3F00]> cd df01
OpenSC [3F00/DF01]> cd 4039
OpenSC [3F00/DF01/4039]> cat
000000: 5B 47 65 6E 5D 0A 4C 47 3D 66 72 00 5F 20 20 20 [Gen].LG=fr._
000010: 00 00 00 00 00 00 00 00 20 20 20 2E 20 2E 20 20 ........   . .
000020: 00 00 00 00 00 00 00 00 20 20 20 2F 56 5C 20 20 ........   /V\
000030: 00 00 00 00 00 00 00 00 20 20 2F 2F 20 5C 5C 20 ........  // \\
000040: 00 00 00 00 00 00 00 00 20 2F 28 20 20 20 29 5C ........ /(   )\
000050: 00 00 00 00 00 00 00 00 20 20 5E 60 7E 27 5E 20 ........  ^`~'^
000060: 00 00 00 00                                     ....

Phil

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.22-3-vserver-686

Debian Release: lenny/sid
  990 testing         ftp.kulnet.kuleuven.ac.be
  500 unstable        ftp.kulnet.kuleuven.ac.be
  500 unstable        debian.jones.dk

--- Package information. ---
Depends               (Version) | Installed
===============================-+-===============
libc6                (>= 2.7-1) | 2.7-6
libltdl3           (>= 1.5.2-2) | 1.5.26-1
libopenct1           (>> 0.6.9) | 0.6.14-2
libpcsclite1        (>= 1.4.99) | 1.4.99-2
libssl0.9.8       (>= 0.9.8f-1) | 0.9.8g-4
zlib1g           (>= 1:1.1.4-1) | 1:1.2.3.3.dfsg-11




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to