Select Command Le check. Can't get the Le.

Hello all.
I have a question.
I am making an applet.
Into the Select command, I think my applet cannot get the Le data.
The Le value has always '00' even though the select command Le value has been changed.
First, in order to get the Le, I used the apdu.setOutgoing(), which returns Le, and then I checked the Le != 0.
However, I think the setOutgoing() always returns '00' in my applet, and the applet does not perform the checking Le statement.
I guess my testing environment or performing follow has a problem, but I am not sure.
I want to hear your opinion and how to test in this case.
          short idl = apdu.setIncomingAndReceive();
          byte[] apduBuffer = apdu.getBuffer();
          short le = (short)(apdu.setOutgoing() & (short)0x00ff);
          if(apduBuffer[ISO7816.OFFSET_CLA] != CLASS_ISO)
     CardException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
          Util.arrayCopy(fileControlInformation, (short)0, transientData, TD_OFF_FILE_CONTROL_INFORMATION, (short)fileControlInformation.length);
          if((apduBuffer[ISO7816.OFFSET_P1]!=(byte)4) || ((apduBuffer[ISO7816.OFFSET_P2]!=(byte)0)))
     CardException.throwIt(ISO7816.SW_INCORRECT_P1P2);
          if((apduBuffer[ISO7816.OFFSET_LC] == (byte)0) || (idl == (short)0) || (apduBuffer[ISO7816.OFFSET_LC] != (byte)idl) || (le != (short)0))
                    CardException.throwIt(ISO7816.SW_WRONG_LENGTH);
For example,
00A4040007xxxxxxxxxxxxxx01<<9000
Although wrong Le is added, the applet returns 9000.
I know why the applet returns 9000.
The point is how to test it correctly.
Thank you.
글 수정: Jin

not really, "select application" can return whatever you like, and most applets do return something: a file control information template (fci) giving the AID and other info (for an example, try to select a card manager). That's a good practice: because you can select an application with only part of an AID, the applet usually replies with this complete AID. [tell the card: "Hello ath", she will respond "Hello, understood, but if you want to know, my full name is Athena" :) ]
Jin, can you post your whole process() algorithm for the select command, including: how are you returning data? do you use apdu.SendBytes() ?
if you have a contactless card it is possible that Le is always zero, because according to iso7816 zero means "all available data".
why? because a contactless card (or a T=1 card) can return any length without prior indication, so it does not need Le.
or it might be a bug in your javacard implementation...
You can use apdu.SetOutgoingLength() to indicate the real length of the response, and usually the card OS (below javacard) relies on that to create a 6CXX response if there's a problem.
A workaround can be: Read Le in the apdu buffer at the correct offset, and send a 6CXX SW yourself if you're not satisfied with it.
I'm expecting more details from you to fully understand the problem.

Similar Messages

  • Command "imsconnutil -a" can't get the smtp auth log

    Hi
    there is the imsconnutil result
    UID IMAP last access HTTP last access POP last access
    ===================================================================================================
    admin ----NOT-RECORDED---- 15/Aug/2006:20:19:19 ----NOT-RECORDED----
    test ----NOT-RECORDED---- 17/Aug/2006:18:44:47 18/Aug/2006:12:07:01
    is there any way to find the smtp access log. any help is preciate.

    Hi Jack,
    The imsconnutil command doesn't provide information on SMTP transactions - only for client pop/imap/http connections which access the mail-store. This information is stored within the SMTP logs of the server that the user uploaded the email to.
    What information in particular were you after? (who logged in and when?)
    I'm sure it should be fairly straight-forward to parse out the information you need. The following doco lists the various flags and their meanings. You would be looking for log lines containing A e.g. ESA - "Successful enqueue with TLS and SASL (security and authentication)"
    http://docs.sun.com/app/docs/doc/819-2650/6n4u4dtv9?a=view
    Cheers,
    Shane.

  • How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    Ok what about If i need to get all important attributes by comparing Email addresses from excel file and get all required answers
    currently I am trying to verify how many users Lines are missing , Emp numbers , Phones  from AD with HR list available to me.
    I am trying to Scan all the AD matching HR Excel sheet and want to search quickly how many accounts are active , Line Managers names , Phone numbers , locations , title , AD ID .
    these are fields I am interested to get in output file after scanning Excel file and geting reply from AD in another Excel or CSV file
    Name’tAccountName’tDescri ption’tEma I IAddress’tLastLogonoate’tManager’tTitle’tDepartmenttComp
    any’twhenCreatedtAcctEnabled’tGroups
    Name,SamAccountName,Description,EmailAddress,LastLogonDate,Manager,Title,Department,Company,whenCreated,Enabled,MemberOf | Sort-Object -Property Name
    Can you modify this script to help me out :)
    Hi,
    Depending on what attributes you want.
    Import-Module ActiveDirectory
    #From a txt file
    $USERS = Get-Content C:\Temp\USER-LIST.txt
    $USERS|Foreach{Get-ADUser $_ -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    #or from a csv file
    $USERS = Import-CSV C:\Temp\USER-LIST.csv
    $USERS|Foreach{Get-ADUser $_.SAMAccountName -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    Regards,
    Dear
    Gautam Ji<abbr class="affil"></abbr>
    Thanks for replying I tried both but it did not work for me instead this command which i extended generated nice results
    Get-ADUser -Filter * -Property * | Select-Object Name,Created,createTimeStamp,DistinguishedName,DisplayName,
    EmployeeID,EmployeeNumber,Enabled,HomeDirectory,LastBadPasswordAttempt,LastLogonDate,LogonWorkstations,City,Manager,MemberOf,MobilePhone,PasswordLastSet,BadLogonCount,pwdLastSet,SamAccountName,UserPrincipalName,whenCreated,whenChanged
    | Export-CSV Allusers.csv -NoTypeInformation -Encoding UTF8
    only one problem is that Manager column is generating this outcome rather showing exact name of the line Manager .
    CN=Mr XYZ ,OU=Users,OU=IT,OU=Departments,OU=Company ,DC=organization,DC=com,DC=tk

  • Getting the following message on Final Cut Express "audio only capture selected video preview disabled" how can I get the video capture back?

    I'm getting the following message on screen when attempting to capture video  "audio only capture selected, video preview disabled."  How can I get the view preview back?

    FCE doesn't allow for audio only capture, it's in a twist somewhere.
    Try trashing the FCE preferences.
    Al

  • TS3988 I just bought a Iphone 5 -- my Iphone 4 and my ipad used to automatically sinc calendars via the Icloud whenever I entered anything on either device -- I can not get the new phone to do this.I have  check the settings on both devices and they seem

    I just bought a Iphone 5 -- my Iphone 4 and my ipad used to automatically sinc calendars via the Icloud whenever I entered anything on either device -- I can not get the new phone to do this.I have  check the settings on both devices and they seem to be t

    There are only two things that you must do to connect a device to calendars:
    1)  In settings>icloud, you must log in, WITH THE CORRECT ID/PASSWORD, and
    2)  Turn on calendars on the same page.
    You said that the iphone 4 and ipad **used** to automatically sync.  Do they no long sync?

  • How can you get the filter off if you can't remember the password? It's"pro con" and it wont even let me check out the rates for aflight.

    How can you get the filter off if you can't remember the password? It's"pro con" and it wont even let me check out the rates for aflight.

    You can check the file prefs.js in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] and remove the line(s) related to that extension (procon.password).

  • I have just bought four songs from iTunes store using my iMac. I can play the music on my iMac and throughout my Apple TV. However after several restarts and double checks I can't get the four tunes to sync with either my iPhone or my iPad.

    I have just bought four songs from iTunes store using my iMac. I can play the music on my iMac and throughout my Apple TV. However after several restarts and double checks I can't get the four tunes to sync with either my iPhone or my iPad. All the software is up to date.

    do you use the same Apple ID on your iMac, your iPhone and iPad? This is a requirement.

  • I have a MacBook, made in 2010. I can't get the eject function to work. I have a DVD in now and want to eject it and put another one in. Command-E, dragging it to the trash or Find-Eject does not work. Ideas?

    I have a MacBook, made in 2010. I can't get the eject function to work. I have a DVD in now and want to eject it and put another one in. Command-E, dragging it to the trash or Find-Eject does not work. Ideas?

    Hi there. Hear are some other options . Hold down for click on the track pad while restarting and keep it down all the way thru boot. Or use right click on a mouse. If it's stuck, sometimes sticking a business card in top edge of slot while trying the eject option can work.

  • When bookmarking a page, I can't get the complete list of bookmark folders to dropdown in order to select any folder in which to bookmark page. What do you set to get whole list of folders in Bookmarks to drop down?

    When bookmarking a page, I can't get the complete list of bookmark folders to drop down in order to select any folder in which to bookmark page. The 'Folder:' bar has 'Bookmarks Menu' showing. The arrow on the bar drops down 5 recent folders to which pages have been saved, but the pop down arrow to the right of the bar just opens to show the three categories and 'New Folder' button. What do you set to get whole list of folders in Bookmarks to drop down?

    To all, embarrassingly enough, I have discovered that I didn't know how to expand the three categories including 'Bookmarks Menu' in the 'Bookmark This Page' pop up interface. It was expanded by default on the initial Firefox opening and first page bookmark attempt. Next use it only showed categories. I clicked and double clicked the 'Bookmarks Menu' line, but failed to see the small, shaded triangle used to expand/collapse list. If it appears collapsed, just tap triangle at left of line to see all folders. It seems to open the same way after I do it for first time. Sorry for the inconvenience, and thanks for all the attempts to help.

  • When I select a title in the iTunes Store and click on Play in iTunes I am sent to the download page for iTunes 10 which I have already. The selected title cannot be found anywhere in my iTunes. How can I get the title in iTunes with possibility to buy it

    When I select a title in the iTunes Store and click on Play in iTunes I am sent to the download page for iTunes 10 which I have already. The selected title cannot be found anywhere in my iTunes. How can I get the title in iTunes with possibility to buy it?

    The issue is that your credit or debit card credentials must be associated with the same country where you reside in order to purchase iTunes content.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location. You can use the iTunes Store in all countries of which you’re a resident, but you’ll either need a separate iTunes Store account for each one, or you’ll need to continually be switching the billing information on your single account. Generally, it’s simpler just to set up an alternative account for these situations, although it’s worth nothing that features like iTunes in the CLoud and iTunes Match are designed to work best when using a single iTunes Store account, as you can only switch accounts with these services every 90 days."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article

  • HT4059 i have an american iPad2 (set to the UK), iOS version 6.1.2,  & iBooks version1.3.2 & can't get the price box to be selectable to purchase the book I want to buy from the iBookstore. What am I missing?????

    i have an american iPad2 (set to the UK), iOS version 6.1.2,  & iBooks version1.3.2 & can't get the price box to be selectable to purchase the book I want to buy from the iBookstore. What am I missing?????

    Backup with iTunes. If iTunes is asking you if you want to backup, say yes to that and it will backup your iPad. Have you ever synced with this computer before?
    My boilerplate response for anyone that wants to update the iOS.
    What you should do anytime that you update the device is to transfer purchases from the iPad into iTunes - File>Transfer Purchases - and you should backup the iPad as well. When you update the update the device, if something goes wrong, you can restore from the backup.
    However, iTunes should ask if you want to backup before you update, but just in case create the backup yourself before you update. The backup contains your app data and settings - along with other items - so make sure you backup first.
    If you have any other important files, you may want to transfer them to your computer as well, prior to the update.
    How to transfer purchases into your iTunes library
    http://support.apple.com/kb/HT1848
    How to backup and restore from a backup
    http://support.apple.com/kb/HT1766

  • How can I get the messageID of the selected message in GW?

    Can I get the messageID of the selected message?
    Is this realisable? Because I have found nothing in the GW object api.
    language: VB6

    Originally Posted by M_M
    Can I get the messageID of the selected message?
    Is this realisable? Because I have found nothing in the GW object api.
    language: VB6

  • I can't get the convert to word command to work?

    How do I get the Convert to Word function to work?  

    The pane next to the document has a space for the file name and  the target conversion (Microsoft Word) and a conversion button.  I press it and nothing happens, and no inquiry comes up asking for my Acrobat user name and password.  Just no action.  I I have Windows 7.
    In a message dated 08/18/14 12:14:13 Pacific Daylight Time, [email protected] writes:
    I can't get the convert to word command to work?
    created by MichaelKazlow in Creating, Editing & Exporting PDFs - View the full discussion
    What happens when you try? Error Messages? What version of Acrobat? What OS? Does the document have real text or is it a scan which is a picture of text?
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6651867#6651867
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Creating, Editing & Exporting PDFs by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • I want to click to open the message but it is opening when I select it, and I can't get rid of the open Pane below the messages.

    I want to click to open the message but it is opening when I select it, and I can't get rid of the open Pane below the messages.

    Excellent. Thank you very much...

  • I used a Disk Warrior to rebuild my G4. When loading the program it wouldn't SU with the repair disc so I selected the Disc Warrior as my SU disk and repaired my hard drive but now I can't get the G4 to SU with anything but the repair disc. What do I do?

    I used a Disc Warrior repair disc to rebuild by G4 Power Mac hard drive. It wouldn't
    startup using the disc and the C key so I selected the Warrior as my startup disc, started up, repaired the disc and now I can't get the computer to startup on it's hard drive. It will only startup on the repair disc.  What do I do to get back to normal?

    Press the Option key at startup and select the hard disk.
    (60933)

  • I can't get the stupid plug-in check to stop loading a page whenever I launch Firefox !!! How do you turn this totally annoying thing off ?????

    Launch Firefox Browser and the Plug-in Check launches a page at the same time. No matter what I do, I can't get the page to stop launching at startup.

    Thanx. I suspected it might have something to do with FF 4.0 still being in Beta. Guess I'm heading back to the old version until such time as the changes are made.
    Again, many thanx. Pete

Maybe you are looking for

  • Highlighting text in Find

    Hello, while looking for text in a Mail message by doing Command-F the found text is highlighted in a faint grey box.  Is there a way to change the box color to make it easier to find on the page?  Thanks!

  • Population of XREF2-Reference Key 2 for a Accounting Document

    Hi Gurus, I have a requirement while posting an accounting document by clearing the Customer open item. My requirement is Populating the BSEG-XREF2 with customer tolerance Group (KNB1-TOGRU) of the Customer. I tried implementing the logic in the subs

  • Only half my contacts sync with Outlook 2013!!

    I have an iPhone 4 (OS 7.1) with 950 contacts on it. I am wanting to back them up. It seems I can only back up to outlook or windows contacts. I have chosen Outlook and it syncs about half of my contacts fine. I am not sure what has happened to the r

  • How to start in linux ?

    I use creator in linux and i would lije to know how to start creator in command line (shell) what should i type ? studio creator ? or java studio creator ? Please help me !!!!!!

  • Load SMP.swf in other .swf and pass parameters to it

    Hello, I am able to load the StrobeMediaPlayback.swf within my main .swf application, but I have no idea how to mimic the flashvars behaviour : how can I provide it with the source of the video wanted, etc ? Thx