1 2 3 Previous Next 64 Replies Latest reply: Jun 9, 2013 9:53 AM by TRON
jan0k Level 1 Level 1 (0 points)

Hi guys,

 

in this discussion https://discussions.apple.com/thread/1679181?threadID=1679181 was descriped,

that it’s possible to connect a smartcard from Mac to a Windows Server with the tool „rDesktop 1.6.0“.

 

Now there’s a new Client-version available: 1.7.0.

 

So I’d like to ask how to configure it, because it‘s impossible like this:

 

„cd Desktop/rdesktop-1.7.0 && ./configure --enable-smartcard -x-includes=/usr/X11/include-x-libraries=/usr/X11/lib && make && sudo make install“

 

Does anyone has some experience with this version?

 

Best regards

Jan

  • 1. Re: rDesktop 1.7.0
    jan0k Level 1 Level 1 (0 points)

    No idea how i compile rdesktop 1.7.0?

  • 2. Re: rDesktop 1.7.0
    TRON Level 1 Level 1 (20 points)

    jan0k,

    I'm the one that posted the rdesktop-1.6.0 with smartcard support instructions.

     

    I'm still trying to compile and install rdesktop-1.7.0 with smartcard support.  Unfortunately, there appears to be some kind of error in one of the source code files, "scard.c".

     

    Until I can figure out a work-around, is there a reason why you can't use rdesktop-1.6.0?

  • 3. Re: rDesktop 1.7.0
    jan0k Level 1 Level 1 (0 points)

    I’m very glad to hearing from you. Maybe you’re the right one

     

    Exact the same error occurs to me, so I asked you for help.

     

    I’ve used rDesktop 1.6 but I need 1.7 to solve some bugs (blackmouse-cursor and printer-redirection).

     

    I’m looking forward to hearing from you soon

     

    Best regards

    Jan

  • 4. Re: rDesktop 1.7.0
    TRON Level 1 Level 1 (20 points)

    Jan,

    I was able to compile and install rdesktop-1.7.0 using the steps below, but I have no way of testing if smartcard support works.

     

    Edit the following rdesktop-1.7.0 files:  scard.h, scard.c

     

    In scard.h -

    Add (without the quotation marks)

     

    "int scard_enum_devices(uint32 * id, char *optarg);"

     

    as the last line of the file, then save and close the file.

     

    In scard.c -

    Replace the current TS_SCardControl function with TS_SCardControl function from rdesktop-1.6.0:

     

     

    TS_SCardControl(STREAM in, STREAM out)

     

    {

              MYPCSC_DWORD rv;

              SERVER_SCARDCONTEXT hContext;

              SERVER_SCARDHANDLE hCard;

              MYPCSC_SCARDHANDLE myHCard;

              SERVER_DWORD map[3];

              SERVER_DWORD dwControlCode;

              unsigned char *pInBuffer, *pOutBuffer;

              SERVER_DWORD nInBufferSize, nOutBufferSize, nOutBufferRealSize, nBytesReturned;

              MYPCSC_DWORD sc_nBytesReturned;

              PMEM_HANDLE lcHandle = NULL;

     

              pInBuffer = NULL;

              pOutBuffer = NULL;

     

              in->p += 0x14;

              in_uint32_le(in, map[0]);

              in->p += 0x04;

              in_uint32_le(in, map[1]);

              in_uint32_le(in, dwControlCode);

              in_uint32_le(in, nInBufferSize);

              in_uint32_le(in, map[2]);

              in->p += 0x04;

              in_uint32_le(in, nOutBufferSize);

              in->p += 0x04;

              in_uint32_le(in, hContext);

              in->p += 0x04;

              in_uint32_le(in, hCard);

              if (map[2] & INPUT_LINKED)

              {

      /* read real input size */

                        in_uint32_le(in, nInBufferSize);

                        pInBuffer = SC_xmalloc(&lcHandle, nInBufferSize);

                        if (!pInBuffer)

                                  return SC_returnNoMemoryError(&lcHandle, in, out);

                        in_uint8a(in, pInBuffer, nInBufferSize);

              }

     

    #if 0

              if (nOutBufferSize > 0)

              {

                        nOutBufferRealSize = nOutBufferSize;

              }

      else

    #endif

                        nOutBufferRealSize = 1024;

     

              nBytesReturned = nOutBufferRealSize;

     

              nBytesReturned = nOutBufferRealSize;

              pOutBuffer = SC_xmalloc(&lcHandle, nOutBufferRealSize);

              if (!pOutBuffer)

                        return SC_returnNoMemoryError(&lcHandle, in, out);

     

              DEBUG_SCARD(("SCARD: SCardControl(context: 0x%08x, hcard: 0x%08x, code: 0x%08x, in: %d bytes, out: %d bytes)\n", (unsigned) hContext, (unsigned) hCard, (unsigned) dwControlCode, (int) nInBufferSize, (int) nOutBufferSize));

     

              sc_nBytesReturned = nBytesReturned;

              myHCard = scHandleToMyPCSC(hCard);

    #ifdef WITH_PCSC120

              rv = SCardControl(myHCard, pInBuffer, (MYPCSC_DWORD) nInBufferSize, pOutBuffer,

                                    &sc_nBytesReturned);

    #else

              rv = SCardControl(myHCard, (MYPCSC_DWORD) dwControlCode, pInBuffer,

                                    (MYPCSC_DWORD) nInBufferSize, pOutBuffer,

                                    (MYPCSC_DWORD) nOutBufferRealSize, &sc_nBytesReturned);

    #endif

              nBytesReturned = sc_nBytesReturned;

     

              if (rv != SCARD_S_SUCCESS)

              {

                        DEBUG_SCARD(("SCARD: -> Failure: %s (0x%08x)\n",

                                       pcsc_stringify_error(rv), (unsigned int) rv));

              }

      else

              {

                        DEBUG_SCARD(("SCARD: -> Success (out: %d bytes)\n", (int) nBytesReturned));

              }

     

              out_uint32_le(out, nBytesReturned);

              out_uint32_le(out, 0x00000004);

              out_uint32_le(out, nBytesReturned);

              if (nBytesReturned > 0)

              {

                        out_uint8p(out, pOutBuffer, nBytesReturned);

                        outRepos(out, nBytesReturned);

              }

     

              outForceAlignment(out, 8);

              SC_xfreeallmemory(&lcHandle);

      return rv;

    }

     

    After replacing the code, save and close the file and then launch your X11 application.

    In the X11 window, "cd" to your rdesktop-1.7.0 folder then type:

              ./configure --enable-smartcard -x-includes=/usr/X11/include -x-libraries=/usr/X11/lib && make && sudo make install

     

    then hit enter and give your admin password when prompted.

    Please let me know if this helps.  Good luck!

  • 5. Re: rDesktop 1.7.0
    jan0k Level 1 Level 1 (0 points)

    Thank You very much for your answer and your workaround.

    I’ve tried it and I’ve compiled rdesktop 1.7 successful

     

    But now the SmartCard-Support doesn’t work !

     

    Do you have any idea why?

  • 6. Re: rDesktop 1.7.0
    TRON Level 1 Level 1 (20 points)

    Jan,

    I went back and replaced as man of the scard references in the 1.7.0 files with the scard references from 1.6.0.

    I was able to compile this and install it, but I can't check if the smartcard support is back.  My new version of the rdesktop-1.7.0 files can be downloaded here:

        

         https://files.me.com/captarendt/l3scpk

     

    You can re-compile the files yourself, or just try the "make && sudo make install" procedure.  Good luck!

  • 7. Re: rDesktop 1.7.0
    jan0k Level 1 Level 1 (0 points)

    Hi Tron,

     

    you are the greatest one! It works!

     

    I’ve downloaded and compiled rDesktop 1.7.0 from your link. X11 returned „nothing to compile“ with the command „make“, but anyway it supports the SmartCard now.

     

    I thank you very very much!

     

    Jan

  • 8. Re: rDesktop 1.7.0
    defiler Level 1 Level 1 (0 points)

    hello! i'm trying to do the same thing, but your link doesn't working anymore can you upload it again please?

    thank you!

  • 9. Re: rDesktop 1.7.0
    TRON Level 1 Level 1 (20 points)

    All,

    The link is back up:

    http://files.me.com/captarendt/l3scpk

  • 10. Re: rDesktop 1.7.0
    defiler Level 1 Level 1 (0 points)

    thank you, but i can't build it anyway. can i ask you for assistance once more?

     

    Undefined symbols:

      "_iconv", referenced from:

          _ui_clip_handle_data in xclip.o

          _xclip_send_data_with_convert in xclip.o

          _rdp_out_unistr in rdp.o

          _rdp_out_unistr in rdp.o

          _rdp_in_unistr in rdp.o

      "_iconv_close", referenced from:

          _ui_clip_handle_data in xclip.o

          _ui_clip_handle_data in xclip.o

          _xclip_send_data_with_convert in xclip.o

          _rdp_out_unistr in rdp.o

          _rdp_out_unistr in rdp.o

          _rdp_in_unistr in rdp.o

      "_iconv_open", referenced from:

          _ui_clip_handle_data in xclip.o

          _xclip_send_data_with_convert in xclip.o

          _xclip_send_data_with_convert in xclip.o

          _xclip_send_data_with_convert in xclip.o

          _rdp_out_unistr in rdp.o

          _rdp_in_unistr in rdp.o

    ld: symbol(s) not found

    collect2: ld returned 1 exit status

    make: *** [rdesktop] Error 1

     

    i've got libiconv installed and it seems that it have this functions. tried to google it, but found only macports discussions.

  • 11. Re: rDesktop 1.7.0
    TRON Level 1 Level 1 (20 points)

    Which OS are you running, and what application and commands are you using to compile the package?

  • 12. Re: rDesktop 1.7.0
    muc2810 Level 1 Level 1 (0 points)

    Hello all,

     

    i've the same problem "defiler" has. I just upgraded my SnowLeopard (with a perfekt working rDesktop 1.6) to Lion. I tried to revoke the rDesktop but it does't work. I'm at the end of my knowledge. Can yoehelp me?

    Would be great. Thanks

  • 13. Re: rDesktop 1.7.0
    TRON Level 1 Level 1 (20 points)

    Unfortunately, I have not upgraded to Lion yet, since Apple decided to deprecate SmartCard services with Lion.  That means there is no native SmartCard support in Lion, which will probably affect the ability to install rdesktop-1.7.0 with smartcard enabled.

     

    I will not upgrade to Lion until there is stable SmartCard support (from http://smartcardservices.macosforge.org) for Lion, so I do not have a Lion test-platform for rdesktop. I'm sorry.

  • 14. Re: rDesktop 1.7.0
    loufromnc Level 1 Level 1 (0 points)

    This worked like a charm...I modified the code by hand per your instructions.  It compiled and I was able to connect using my smartcard pin.

     

    Thanks!

1 2 3 Previous Next