Please, have it as a patch and as a ticket.
m.
On 14.09.2006, at 22:17, Thomas Harning wrote:
On Wed, 13 Sep 2006 16:32:57 -0700
Iain MacDonnell <[EMAIL PROTECTED]> wrote:
Dejan Gambin wrote on 08/15/06 01:49 PM:
Hi,
I have been able to solve the problem with muscle_create_file using
the following:
- instead of calling mscfs_lookup_local(fs, file->id,
(u8*)&objectId); I have put:
objectId[0] = fs->currentPath[0];
objectId[1] = fs->currentPath[1];
objectId[2] = (file->id >> 8) & 0xFF;
objectId[3] = file->id & 0xFF;
and after that modified the call to msc_create_object to: r =
msc_create_object(card, bebytes2ulong(objectId), objectSize, read,
write, delete); If I can see, muscle_create_directory is doing the
similat thing. I don't know if this is the error but this works for
me on Windows...
Folks,
Did y'all get to the bottom of this yet? I just ran into the same
problem trying to use a MuscleCard with OpenSC (SVN trunk) on Solaris
x86. I applied Dejan's modification (above), and the "File not found"
problem went away, apparently allowing the PKCS#15 creation to
succeed:
~ % pkcs15-init --verbose --create-pkcs15 --profile pkcs15+onepin
--pin 00000000 --so-pin 00000000 --so-puk 00000000
Connecting to card in reader SCM SCR 3310 (21120519102745) 00 00...
Using card driver Muscle Card Driver.
About to create PKCS #15 meta structure.
Unspecified PIN [reference 1] required.
Please enter Unspecified PIN [reference 1]:
~ % pkcs15-tool --list-pins
PIN [User PIN]
Com. Flags: 0x3
ID : 01
Flags : [0x10], initialized
Length : min_len:4, max_len:8, stored_len:8
Pad char : 0x00
Reference : 1
Type : ascii-numeric
Path : 3f005015
~ %
Now I'm running into an issue when trying to do key-related stuff -
like generate a key-pair, or inject a PKCS#12 file:
~ % pkcs15-init -G rsa/1024 -a 01 -u digitalSignature --so-pin
00000000 --pin 00000000
unable to transmit
unable to transmit APDU
muscle.c:199:: APDU transmit failed: Transmit failed
muscle.c:225:: Error in partial object update: Transmit failed
card.c:513:: returning with: Transmit failed
Failed to generate key: Transmit failed
~ %
In the output from pcscd, I see:
commands.c:1039:() Command too long (260 bytes) for max: 253 bytes
ifdwrapper.c:735:() Card not transacted: 612
winscard.c:1481:() Card not transacted: 0x80100016
Attached is a gzipped patch that includes Dejan's fix as well as makes
the majority of the APDU's that the driver uses of a more customizable
length... As opposed to static magic numbers.
There's also some extra fixes in the PIN command code so that more
validation is made.
Please let me know if it fixes the problem... I reduced the maximum
payload by 10 bytes (255 -> 245) which should fix your problem with a
little room to spare for other reader incompatibilities.
My next patch will build on this to replace the mixed up object ID
system to a simpler straightforward one which will hopefully reduce
the
confusion on where swaps need to occur (since none will need to be
made..)
New struct:
struct msc_objid -> msc_objid_t
New functions:
sc_path_to_msc_objid(msc_objid*, sc_path*)
msc_objid_to_sc_path(sc_path*, msc_objid*)
msc_objid's will be passed by value (except in the conversion
functions) since they will only be 4 bytes long.
--
Thomas Harning
@ Identity Alliance
<muscle-fix.patch.gz>
_______________________________________________
opensc-user mailing list
[EMAIL PROTECTED]
http://www.opensc-project.org/mailman/listinfo/opensc-user
--
Martin Paljak / [EMAIL PROTECTED]
martin.paljak.pri.ee / ideelabor.ee
+372 515 64 95
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle