Open SSL RC4

Discussion in 'Mac Programming' started by hiddenpremise, Apr 23, 2010.

  1. hiddenpremise macrumors regular

    hiddenpremise

    Joined:
    Jul 25, 2008
    Location:
    Somewhere between my imagination and reality
    #1
    [edit]PROBLEM SOLVED - thanks chown33[/edit]
    I am trying to write a foundation tool using openssl's rc4 cryptography.
    I have included libssl.0.9.8.dylib in the project and use a
    Code:
    #include <openssl/rc4.h>
    to call the header file that I need. However whenever I try to build, I get an error
    Code:
    Undefined symbols:
      "_RC4_set_key", referenced from:
          _main in sslrc4.o
      "_RC4", referenced from:
          _main in sslrc4.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    . What am I missing, to get use of these functions?

    Thanks,
    W
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    You need an additional library. Here's how to find it.

    Enter these Terminal commands:
    Code:
    nm /usr/lib/* >rc4.txt 2>&1
    open rc4.txt
    
    When rc4.txt is open in an editor, find RC4_set_key. Click Find Next until a line like the red-hilited one appears:
    Code:
    [COLOR="Green"]/usr/lib/libcrypto.dylib[/COLOR](rc4_skey.o):
    919b9414 T _RC4_options
    [COLOR="Red"]919b9424 T _RC4_set_key[/COLOR]
    a1951420 D _RC4_version
    
    The 'T' line identifies where the symbol is defined. The name of the lib where it occurs is shown above it (hilited here in green).
     
  3. hiddenpremise thread starter macrumors regular

    hiddenpremise

    Joined:
    Jul 25, 2008
    Location:
    Somewhere between my imagination and reality
    #3
    Chown33, I again find myself in your debt. Thank you much :)
     

Share This Page