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


Hmmm...

    ~Iain

_______________________________________________
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to