Skip to content
This repository has been archived by the owner on Aug 11, 2019. It is now read-only.

Updated to openssl-1.0.1l and iOS SDK 8.1 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This script builds OpenSSL 1.0.1g for iOS.
This script builds OpenSSL 1.0.1l for iOS.


WARNING Although I am still maintaining this project, I do not actually
Expand All @@ -11,14 +11,14 @@ WARNING maintained and updated more easily since it is OS provided.
Precompiled binaries and headers are also included and can be used directly in
your project.

It builds multi-architecture libaries with support for armv7, armv7s (iPhone 5),
arm64 (iPhone 5S, iPad Air and iPad Mini Retina) and also for 32 and 64-bit
It builds multi-architecture libaries with support for armv7, arm64 (iPhone 5S,
iPad Air and iPad Mini Retina) and also for 32 and 64-bit
Intel targets for running in the simulator.

This script is known to work with the following combination of software versions:

* MacOS X 10.9.2
* XCode 5.1.1 & iOS SDK 7.1
* XCode 6.1 & iOS SDK 8.1

The compiled libraries should be downward compatible to iOS 4.3 at least.

Expand Down Expand Up @@ -50,9 +50,9 @@ IMPORTANT
I included pre-compiled binaries of the openssl libraries in this project mostly for my
own convenience. But you should really not trust me and do two things:

1) Verify that the openssl-1.0.1g.tar.gz file is authentic by comparing it's SHA1
1) Verify that the openssl-1.0.1l.tar.gz file is authentic by comparing it's SHA1
hash to the one found on http://www.openssl.org/source/ You can do this with
the 'openssl sha1 openssl-1.0.1g.tar.gz' command.
the 'openssl sha1 openssl-1.0.1l.tar.gz' command.
2) Compile your own version of the library as explained above

Enjoy :-)
Expand Down
20 changes: 9 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
#!/bin/bash

# Yay shell scripting! This script builds a static version of
# OpenSSL ${OPENSSL_VERSION} for iOS 7.0 that contains code for
# armv6, armv7, arm7s and i386.
# OpenSSL ${OPENSSL_VERSION} for iOS 8.1 that contains code for
# armv7, arm64 and i386.

set -x

# Setup paths to stuff we need

OPENSSL_VERSION="1.0.1g"
OPENSSL_VERSION="1.0.1l"

DEVELOPER="/Applications/Xcode.app/Contents/Developer"
DEVELOPER="`xcode-select -p`"
if [ $? -ne 0 ]; then exit 1; fi

SDK_VERSION="7.1"
MIN_VERSION="4.3"
SDK_VERSION="8.1"
MIN_VERSION="7.0"

IPHONEOS_PLATFORM="${DEVELOPER}/Platforms/iPhoneOS.platform"
IPHONEOS_SDK="${IPHONEOS_PLATFORM}/Developer/SDKs/iPhoneOS${SDK_VERSION}.sdk"
IPHONEOS_GCC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
IPHONEOS_GCC="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

IPHONESIMULATOR_PLATFORM="${DEVELOPER}/Platforms/iPhoneSimulator.platform"
IPHONESIMULATOR_SDK="${IPHONESIMULATOR_PLATFORM}/Developer/SDKs/iPhoneSimulator${SDK_VERSION}.sdk"
IPHONESIMULATOR_GCC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
IPHONESIMULATOR_GCC="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

# Make sure things actually exist

Expand Down Expand Up @@ -83,7 +84,6 @@ build()
}

build "BSD-generic32" "armv7" "${IPHONEOS_GCC}" "${IPHONEOS_SDK}" ""
build "BSD-generic32" "armv7s" "${IPHONEOS_GCC}" "${IPHONEOS_SDK}" ""
build "BSD-generic64" "arm64" "${IPHONEOS_GCC}" "${IPHONEOS_SDK}" ""
build "BSD-generic32" "i386" "${IPHONESIMULATOR_GCC}" "${IPHONESIMULATOR_SDK}" ""
build "BSD-generic64" "x86_64" "${IPHONESIMULATOR_GCC}" "${IPHONESIMULATOR_SDK}" "-DOPENSSL_NO_ASM"
Expand All @@ -96,14 +96,12 @@ cp -r /tmp/openssl-${OPENSSL_VERSION}-i386/include/openssl include/
mkdir lib
lipo \
"/tmp/openssl-${OPENSSL_VERSION}-armv7/lib/libcrypto.a" \
"/tmp/openssl-${OPENSSL_VERSION}-armv7s/lib/libcrypto.a" \
"/tmp/openssl-${OPENSSL_VERSION}-arm64/lib/libcrypto.a" \
"/tmp/openssl-${OPENSSL_VERSION}-i386/lib/libcrypto.a" \
"/tmp/openssl-${OPENSSL_VERSION}-x86_64/lib/libcrypto.a" \
-create -output lib/libcrypto.a
lipo \
"/tmp/openssl-${OPENSSL_VERSION}-armv7/lib/libssl.a" \
"/tmp/openssl-${OPENSSL_VERSION}-armv7s/lib/libssl.a" \
"/tmp/openssl-${OPENSSL_VERSION}-arm64/lib/libssl.a" \
"/tmp/openssl-${OPENSSL_VERSION}-i386/lib/libssl.a" \
"/tmp/openssl-${OPENSSL_VERSION}-x86_64/lib/libssl.a" \
Expand Down
4 changes: 3 additions & 1 deletion include/openssl/asn1.h
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
int ASN1_TYPE_get(ASN1_TYPE *a);
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b);
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);

ASN1_OBJECT * ASN1_OBJECT_new(void );
void ASN1_OBJECT_free(ASN1_OBJECT *a);
Expand Down Expand Up @@ -1329,6 +1329,7 @@ void ERR_load_ASN1_strings(void);
#define ASN1_R_ILLEGAL_TIME_VALUE 184
#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
#define ASN1_R_INVALID_BMPSTRING_LENGTH 129
#define ASN1_R_INVALID_DIGIT 130
#define ASN1_R_INVALID_MIME_TYPE 205
Expand Down Expand Up @@ -1378,6 +1379,7 @@ void ERR_load_ASN1_strings(void);
#define ASN1_R_TIME_NOT_ASCII_FORMAT 193
#define ASN1_R_TOO_LONG 155
#define ASN1_R_TYPE_NOT_CONSTRUCTED 156
#define ASN1_R_TYPE_NOT_PRIMITIVE 218
#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
#define ASN1_R_UNEXPECTED_EOC 159
Expand Down
4 changes: 4 additions & 0 deletions include/openssl/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ extern "C" {
#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to
* adjust socket timeouts */

#define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49

#ifndef OPENSSL_NO_SCTP
/* SCTP stuff */
#define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
Expand Down Expand Up @@ -607,6 +609,8 @@ int BIO_ctrl_reset_read_request(BIO *b);
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)
#define BIO_dgram_set_peer(b,peer) \
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
#define BIO_dgram_get_mtu_overhead(b) \
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)

/* These two aren't currently implemented */
/* int BIO_get_ex_num(BIO *bio); */
Expand Down
4 changes: 3 additions & 1 deletion include/openssl/bn.h
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
#define bn_wcheck_size(bn, words) \
do { \
const BIGNUM *_bnum2 = (bn); \
assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \
/* avoid unused variable warning with NDEBUG */ \
(void)(_bnum2); \
} while(0)

#else /* !BN_DEBUG */
Expand Down
11 changes: 10 additions & 1 deletion include/openssl/dtls1.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ extern "C" {
#endif

#define DTLS1_VERSION 0xFEFF
#define DTLS_MAX_VERSION DTLS1_VERSION

#define DTLS1_BAD_VER 0x0100

#if 0
Expand Down Expand Up @@ -115,6 +117,9 @@ extern "C" {
#define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP"
#endif

/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */
#define DTLS1_MAX_MTU_OVERHEAD 48

typedef struct dtls1_bitmap_st
{
unsigned long map; /* track 32 packets on 32-bit systems
Expand Down Expand Up @@ -229,6 +234,7 @@ typedef struct dtls1_state_st
/* Is set when listening for new connections with dtls1_listen() */
unsigned int listen;

unsigned int link_mtu; /* max on-the-wire DTLS packet size */
unsigned int mtu; /* max DTLS packet size */

struct hm_header_st w_msg_hdr;
Expand All @@ -250,6 +256,10 @@ typedef struct dtls1_state_st
unsigned int handshake_fragment_len;

unsigned int retransmitting;
/*
* Set when the handshake is ready to process peer's ChangeCipherSpec message.
* Cleared after the message has been processed.
*/
unsigned int change_cipher_spec_ok;

#ifndef OPENSSL_NO_SCTP
Expand Down Expand Up @@ -284,4 +294,3 @@ typedef struct dtls1_record_data_st
}
#endif
#endif

7 changes: 7 additions & 0 deletions include/openssl/ebcdic.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

#include <sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Avoid name clashes with other applications */
#define os_toascii _openssl_os_toascii
#define os_toebcdic _openssl_os_toebcdic
Expand All @@ -16,4 +20,7 @@ extern const unsigned char os_toebcdic[256];
void *ebcdic2ascii(void *dest, const void *srce, size_t count);
void *ascii2ebcdic(void *dest, const void *srce, size_t count);

#ifdef __cplusplus
}
#endif
#endif
2 changes: 1 addition & 1 deletion include/openssl/ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN
int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);

/** Computes r = generator * n sum_{i=0}^num p[i] * m[i]
/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i]
* \param group underlying EC_GROUP object
* \param r EC_POINT object for the result
* \param n BIGNUM with the multiplier for the group generator (optional)
Expand Down
6 changes: 6 additions & 0 deletions include/openssl/modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif
typedef void (*block128_f)(const unsigned char in[16],
unsigned char out[16],
const void *key);
Expand Down Expand Up @@ -133,3 +136,6 @@ typedef struct xts128_context XTS128_CONTEXT;

int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
const unsigned char *inp, unsigned char *out, size_t len, int enc);
#ifdef __cplusplus
}
#endif
16 changes: 14 additions & 2 deletions include/openssl/opensslconf.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* opensslconf.h */
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */

#ifdef __cplusplus
extern "C" {
#endif
/* OpenSSL was configured with the following options: */
#ifndef OPENSSL_DOING_MAKEDEPEND

Expand Down Expand Up @@ -32,6 +35,9 @@
#ifndef OPENSSL_NO_STORE
# define OPENSSL_NO_STORE
#endif
#ifndef OPENSSL_NO_UNIT_TEST
# define OPENSSL_NO_UNIT_TEST
#endif

#endif /* OPENSSL_DOING_MAKEDEPEND */

Expand Down Expand Up @@ -74,6 +80,9 @@
# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)
# define NO_STORE
# endif
# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST)
# define NO_UNIT_TEST
# endif
#endif

/* crypto/opensslconf.h.in */
Expand All @@ -83,8 +92,8 @@

#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
#define ENGINESDIR "/tmp/openssl-1.0.1g-i386/lib/engines"
#define OPENSSLDIR "/tmp/openssl-1.0.1g-i386"
#define ENGINESDIR "/tmp/openssl-1.0.1l-i386/lib/engines"
#define OPENSSLDIR "/tmp/openssl-1.0.1l-i386"
#endif
#endif

Expand Down Expand Up @@ -230,3 +239,6 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!

#endif /* DES_DEFAULT_OPTIONS */
#endif /* HEADER_DES_LOCL_H */
#ifdef __cplusplus
}
#endif
13 changes: 10 additions & 3 deletions include/openssl/opensslv.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H

#ifdef __cplusplus
extern "C" {
#endif

/* Numeric release version identifier:
* MNNFFPPS: major minor fix patch status
* The status nibble has one of the values 0 for development, 1 to e for betas
Expand All @@ -25,11 +29,11 @@
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
#define OPENSSL_VERSION_NUMBER 0x1000107fL
#define OPENSSL_VERSION_NUMBER 0x100010cfL
#ifdef OPENSSL_FIPS
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-fips 7 Apr 2014"
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1l-fips 15 Jan 2015"
#else
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g 7 Apr 2014"
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1l 15 Jan 2015"
#endif
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT

Expand Down Expand Up @@ -86,4 +90,7 @@
#define SHLIB_VERSION_NUMBER "1.0.0"


#ifdef __cplusplus
}
#endif
#endif /* HEADER_OPENSSLV_H */
7 changes: 7 additions & 0 deletions include/openssl/ossl_typ.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
#ifndef HEADER_OPENSSL_TYPES_H
#define HEADER_OPENSSL_TYPES_H

#ifdef __cplusplus
extern "C" {
#endif

#include <openssl/e_os2.h>

#ifdef NO_ASN1_TYPEDEFS
Expand Down Expand Up @@ -199,4 +203,7 @@ typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
typedef struct ocsp_response_st OCSP_RESPONSE;
typedef struct ocsp_responder_id_st OCSP_RESPID;

#ifdef __cplusplus
}
#endif
#endif /* def HEADER_OPENSSL_TYPES_H */
5 changes: 1 addition & 4 deletions include/openssl/pkcs7.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ DECLARE_PKCS12_STACK_OF(PKCS7)
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
#define PKCS7_type_is_encrypted(a) \
(OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)

#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)

#define PKCS7_set_detached(p,v) \
PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
Expand Down Expand Up @@ -453,6 +449,7 @@ void ERR_load_PKCS7_strings(void);
#define PKCS7_R_ERROR_SETTING_CIPHER 121
#define PKCS7_R_INVALID_MIME_TYPE 131
#define PKCS7_R_INVALID_NULL_POINTER 143
#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
#define PKCS7_R_MIME_NO_CONTENT_TYPE 132
#define PKCS7_R_MIME_PARSE_ERROR 133
#define PKCS7_R_MIME_SIG_PARSE_ERROR 134
Expand Down
6 changes: 6 additions & 0 deletions include/openssl/pqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
#include <stdlib.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif
typedef struct _pqueue *pqueue;

typedef struct _pitem
Expand Down Expand Up @@ -91,4 +94,7 @@ pitem *pqueue_next(piterator *iter);
void pqueue_print(pqueue pq);
int pqueue_size(pqueue pq);

#ifdef __cplusplus
}
#endif
#endif /* ! HEADER_PQUEUE_H */
1 change: 1 addition & 0 deletions include/openssl/rsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ void ERR_load_RSA_strings(void);
#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158
#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
#define RSA_R_PADDING_CHECK_FAILED 114
#define RSA_R_PKCS_DECODING_ERROR 159
#define RSA_R_P_NOT_PRIME 128
#define RSA_R_Q_NOT_PRIME 129
#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
Expand Down
Loading