In the first glance, it looks like it is the problem with the padding. Please look 
into it.

----------
In God we trust. For all others, we verify.
- Mohammed Sadiq 


>-----Original Message-----
>From: Jack Wilczynski [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, April 19, 2001 9:08 PM
>To: [EMAIL PROTECTED]
>Subject: [OCF] CHV problem
>
>
>My CHV verification algorithm works if the pin is 8
>chars long but if it's fewer than 8 it fails.
>Can somebody tell me what is wrong with the following
>code:
>
>boolean performCHV(CardChannel channel, int numCHV)
>    throws CardServiceInabilityException,
>CardTerminalException, GSMException
>    {
>        
>        byte []     password = new byte [8];
>        performCHVCommand.setLength(0);
>        performCHVCommand.append(GSMAPDU.CLASS_BYTE);
>        performCHVCommand.append(GSMAPDU.VERIFY_BYTE);
>        performCHVCommand.append((byte)0x00);
>        performCHVCommand.append((byte)numCHV);
>        performCHVCommand.append((byte)0x08);
>        performCHVCommand.append(password);
>        
>        CardTerminalIOControl ioctrl = new
>CardTerminalIOControl(8, 3000, null, null);
>        CHVControl chvctrl = new CHVControl("Enter
>your password", numCHV, CHVEncoder.STRING_ENCODING, 0,
>ioctrl);
>        
>        ResponseAPDU response = null;
>        response =
>(ResponseAPDU)channel.sendVerifiedAPDU(performCHVCommand,
>chvctrl, getCHVDialog());
>        
>        GSMResponseAPDU resp = new
>GSMResponseAPDU(response.getBytes());
>        
>    } // performCHV
>
>    final CHVDialog getCHVDialog()
>    {
>        return CHV_dialog;
>    }
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Auctions - buy the things you want at great prices
>http://auctions.yahoo.com/
>
>
>---
>> Visit the OpenCard web site at http://www.opencard.org/ for more
>> information on OpenCard---binaries, source code, documents.
>> This list is being archived at 
http://www.opencard.org/archive/opencard/

! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
!                           [EMAIL PROTECTED]
! containing the word
!                           unsubscribe 
! in the body.




---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/

! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
!                           [EMAIL PROTECTED]
! containing the word
!                           unsubscribe 
! in the body.

Reply via email to