Re: [Smartsign-users] Re: MUSCLE ..Error communicating to: Schlumberger Reflex 62

2000-10-20 Thread Christian Del Rosso

Hi,

I've done some tests, thanks to  David Corcoran and
Tommaso Cucinotta, I've modified the ReadBinary() function in smartsign.
If I try to read 0xFF bytes at once I get an error .

By now, I've changed the ReadBinary() function in the smart_util.c
in this way:

while (len  0) {
if (len = 253)
  partial = len;
else
// before 
  // partial = 255;

// now
partial=253; 


I've tried differents values for "partial", "253" is the highest that worked.
with 254 I would get the same error. Why does this happen?



Christian 



 David Corcoran wrote:
  You might try modifying the code to try and read binary smaller amounts
  instead of FF you might try a lower number just to try and track down the
  problem.

 Tommaso Cucinotta wrote:
 You can try this modifying the ReadBinary() function in smart_util.c
 There you have a loop in which 0xFF bytes are read at once, modify the
 value to something smallest. Please, consider that you should (perhaps)
 modify WriteBinary() too, if it worked.
 
 Please, let me know if that works, bye,
 
   Tommaso.
***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***



Re: [Smartsign-users] Re: MUSCLE ..Error communicating to: Schlumberger Reflex 62

2000-10-20 Thread Lawrence

It may be caused by 2 reasons.
(1)  Your smart card does not have 256 byte buffer.
(2)  Your card reader does not have 256 byte buffer to handle your request.

Many smart cards may has 252 or less RAM for read /write operation.  (most
8051 core smart card).

Lawrence


- Original Message -
From: "Christian Del Rosso" [EMAIL PROTECTED]
To: "Tommaso Cucinotta" [EMAIL PROTECTED]e
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, October 20, 2000 5:09 PM
Subject: Re: [Smartsign-users] Re: MUSCLE ..Error communicating to:
Schlumberger Reflex 62


 Hi,

 I've done some tests, thanks to  David Corcoran and
 Tommaso Cucinotta, I've modified the ReadBinary() function in smartsign.
 If I try to read 0xFF bytes at once I get an error .

 By now, I've changed the ReadBinary() function in the smart_util.c
 in this way:

 while (len  0) {
 if (len = 253)
   partial = len;
 else
 // before
   // partial = 255;

 // now
 partial=253;


 I've tried differents values for "partial", "253" is the highest that
worked.
 with 254 I would get the same error. Why does this happen?



 Christian



  David Corcoran wrote:
   You might try modifying the code to try and read binary smaller
amounts
   instead of FF you might try a lower number just to try and track down
the
   problem.

  Tommaso Cucinotta wrote:
  You can try this modifying the ReadBinary() function in smart_util.c
  There you have a loop in which 0xFF bytes are read at once, modify the
  value to something smallest. Please, consider that you should (perhaps)
  modify WriteBinary() too, if it worked.
 
  Please, let me know if that works, bye,
 
  Tommaso.
 ***
 Linux Smart Card Developers - M.U.S.C.L.E.
 (Movement for the Use of Smart Cards in a Linux Environment)
 http://www.linuxnet.com/smartcard/index.html
 ***

***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***



Re: MUSCLE ..Error communicating to: Schlumberger Reflex 62

2000-10-19 Thread David Corcoran

Hello,

This could be a number of different things.

The Reflex reader is a 'smart' reader and buffers commands.  Some versions
of the access cards did not have a large enough WWT in the ATR to cover
commands which might take some time.  If Tomas is using an Access card to
develop smartsign and a reflex 62 you might swap ATR's and see the
difference in cards.

The Error Communicating to Reflex 62 is happenning because the card status
thread can no longer talk to the reader.  Either the reader is in a spin
loop waiting for data from the card and the driver timed out or too much
data was received and somehow the driver got corrupt.

You shouldn't be able to do a read binary on the private key file 0012
depending on the priveledges but I would imagine the card would return 2
bytes to notify this.

You might try modifying the code to try and read binary smaller amounts
instead of FF you might try a lower number just to try and track down the
problem.

Best Regards,
Dave


Hi,

I'm using smartsign.
I've pcsc-lite-0.7.8.tar.gz, smartsign-2000_07_03-11_17.tgz,
and slb_rf60-drv-current.tar.gz

I've a schlumberger Reflex 60 smart card reader and a cyberflex access
smart card.

I've compiled pcsc with  rpc support.

Smartsign seems to work well.
With smarsh, the smartsign shell I can do an "ls".

The problems comes when I try do read a binary file.
these are the steps I do with smartsh:

cmd: reset
Reader Schlumberger Reflex 62
Status 34
protocol   01
reader_len 23
ATR3B 16 94 81 10 06 01 81 2F
Reader Schlumberger Reflex 62
Status 34
protocol   01
reader_len 23
ATR3B 16 94 81 10 06 01 81 2F
ATR = 3B 16 94 81 10 06 01 81 2F
Ok.

cmd: vk 0 ad9f61fefa20ce63
key_bytes = 'ad9f61fefa20ce63'
key_nb = '0'
OK: SUCCESS


cmd: ga 0012
File-ID = '0012'
Default: FF
CHV1   : FF
CHV2   : 00
AUT0   : FF
AUT1   : 00
AUT2   : 00
AUT3   : 00
AUT4   : 00

cmd: test
Generating new RSA 512 key pair ...
Setting key#3 on 0x0012 ...
Error: Unknown error !
Error: Couldn't ReadBinary() key file !
Error: SetKey() failed !
Error: SetKeyPrvRSA() failed !

From pcscd I have:

winscard.c 812: SCardTransmit: Send Protocol: 0
[0005] - 00 b0 00 00 ff
[0001] - 00
eventhandler.c 123: EHSpawnEventHandler: Error communicating to:
Schlumberger Reflex 62


It seems to me that I can't read that binary file, "test" tries to read
the 0x0012 file:

if (SendCmd(0x00, INS_READ_BINARY, offset / 256, offset % 256, (uchar)
partial, buf + offset, R) != SCU_OK)
   ERRORE("Read Binary !\n");

and from the logs of smartsh_log
Sending APDU: 00 B0 00 00 FF ...
NO DATA Received !!

So, I don't have an answer.
SendCmd calls:
rv = SCardTransmit(hCard, SCARD_PCI_T0, cmd, apdu_len, sRecvPci, temp_buf,
   dwRecvLength);

lr = dwRecvLength;
   if (lr = 2) {
   }
   else MyLog(0, "NO DATA Received !!\n");



I don't know how to proceed, I'm a novice in this field,
I need some hints to resolve this problem.

Thanks
   Christian Del Rosso














***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***


David Corcoran  Purdue University
1008 Cherry Lane
West Lafayette, IN 47906
[EMAIL PROTECTED]
765 - 427 - 5147http://www.linuxnet.com


***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***