A script for compiling OpenSSL for Apple Devices.
Go to file
Felix Schulze aa44921811 Upgrad to OpenSSL 0.9.8m 2010-02-26 17:29:32 +01:00
Classes XCode Projectfor iPhone SDK 3 with OpenSSL-0.9.8m-beta1 2010-02-04 15:04:16 +01:00
OpenSSL-1.xcodeproj XCode Projectfor iPhone SDK 3 with OpenSSL-0.9.8m-beta1 2010-02-04 15:04:16 +01:00
include/openssl XCode Projectfor iPhone SDK 3 with OpenSSL-0.9.8m-beta1 2010-02-04 15:04:16 +01:00
MainWindow.xib XCode Projectfor iPhone SDK 3 with OpenSSL-0.9.8m-beta1 2010-02-04 15:04:16 +01:00
OpenSSL_1-Info.plist XCode Projectfor iPhone SDK 3 with OpenSSL-0.9.8m-beta1 2010-02-04 15:04:16 +01:00
OpenSSL_1_Prefix.pch XCode Projectfor iPhone SDK 3 with OpenSSL-0.9.8m-beta1 2010-02-04 15:04:16 +01:00
README Upgrad to OpenSSL 0.9.8m 2010-02-26 17:29:32 +01:00
libcrypto_arm.a Upgrad to OpenSSL 0.9.8m 2010-02-26 17:29:32 +01:00
libcrypto_i386.a Upgrad to OpenSSL 0.9.8m 2010-02-26 17:29:32 +01:00
libssl_arm.a Upgrad to OpenSSL 0.9.8m 2010-02-26 17:29:32 +01:00
libssl_i386.a Upgrad to OpenSSL 0.9.8m 2010-02-26 17:29:32 +01:00
main.m XCode Projectfor iPhone SDK 3 with OpenSSL-0.9.8m-beta1 2010-02-04 15:04:16 +01:00

README

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From: http://www.x2on.de/2010/02/01/tutorial-iphone-app-with-compiled-openssl-library/

UPDATE 2010-02-26: I have updated OpenSSL to 0.9.8m

This is a tutorial for using self-compiled builds of  the OpenSSL-library on the iPhone. You can build apps with XCode and the official SDK from Apple with this. I also made a small example-app for using the libraries with XCode and the iPhone/iPhone-Simulator. You can also download the precompiled OpenSSL-library (0.9.8m-beta1).

Create OpenSSL Libary:

    * Download OpenSSL Sourcecode
    * Build OpenSSL for i368 iPhoneSimulator:
          o cd openssl-0.9.8m
            mkdir openssl_arm
            mkdir openssl_i386
            ./config --openssldir=/Users/

          o Edit Makefile:
                + Change CC = cc to:

                  CC= /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0

                + Add as first item to CFLAG:

                  -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk

          o Change in crypto/ui/ui_openssl.c

            static volatile sig_atomic_t intr_signal;

            to

            static volatile int intr_signal;

            for preventing building error
          o Build it:

            make
            make install

          o Your libcrypto.a and libssl.a are in the folder openssl_i368/lib
          o Rename the two files to libcrypto_i386.a and libssl_i386.a
    * Build OpenSSL for arm iPhoneOS:
          o Edit Makefile:
                + Search and replace openssl_i386 with openssl_arm
                + Change -arch i386 in CFLAG to:
                  -arch armv6
                + Change

                  CC=  /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0

                  to

                  CC=  /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0

                + Change

                  -isysroot  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk

                  to

                  -isysroot  /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk

          o Build it:
            make
            make install

          o Your libcrypto.a and libssl.a are in the folder openssl_arm/lib
          o Rename the two files to libcrypto_arm.a and libssl_arm.a

Edit your iPhone-XCode project:

    * Copy the “include” folder from OpenSSL into your project-folder
    * Copy the libcrypto_*.a and libss_*.a files into your project-folder
    * Drag the libcrypto_*.a and libss_*.a files into your XCode Framework Folder-Tree
    * Open the Build-Info from your “Target” (Righclick on Target  Get Info)
    * Change Library Search Paths to

      $(inherited) "$(SRCROOT)"

    * Change User Header Search Paths to include
    * Activate Always Search User Paths

Enjoy OpenSSL on the iPhone!

I have made an iPhone OS 3.1.2 XCode Project with OpenSSL 0.9.8m (Beta1) Libaries. The examples uses the MD5-algorithm to calculate an md5 hash from an UITextfield.