Skip to content

Commit 25821e9

Browse files
committed
Update to openssl 1.0.1k
1 parent 323badf commit 25821e9

28 files changed

+116
-40
lines changed

OpenSSL-Universal.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OpenSSL-Universal"
3-
s.version = "1.0.1.j-2"
3+
s.version = "1.0.1.k"
44
s.summary = "OpenSSL for iOS and OS X"
55
s.description = "OpenSSL is an SSL/TLS and Crypto toolkit. Deprecated in Mac OS and gone in iOS, this spec gives your project non-deprecated OpenSSL support. Supports OSX and iOS including Simulator (armv7,armv7s,arm64,i386,x86_64)."
66
s.homepage = "http://krzyzanowskim.github.io/OpenSSL/"

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -x
77

88
# Setup paths to stuff we need
99

10-
OPENSSL_VERSION="1.0.1j"
10+
OPENSSL_VERSION="1.0.1k"
1111

1212
DEVELOPER=$(xcode-select --print-path)
1313

include-ios/openssl/asn1.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
776776
int ASN1_TYPE_get(ASN1_TYPE *a);
777777
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
778778
int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
779-
int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b);
779+
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
780780

781781
ASN1_OBJECT * ASN1_OBJECT_new(void );
782782
void ASN1_OBJECT_free(ASN1_OBJECT *a);
@@ -1329,6 +1329,7 @@ void ERR_load_ASN1_strings(void);
13291329
#define ASN1_R_ILLEGAL_TIME_VALUE 184
13301330
#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
13311331
#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
1332+
#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
13321333
#define ASN1_R_INVALID_BMPSTRING_LENGTH 129
13331334
#define ASN1_R_INVALID_DIGIT 130
13341335
#define ASN1_R_INVALID_MIME_TYPE 205
@@ -1378,6 +1379,7 @@ void ERR_load_ASN1_strings(void);
13781379
#define ASN1_R_TIME_NOT_ASCII_FORMAT 193
13791380
#define ASN1_R_TOO_LONG 155
13801381
#define ASN1_R_TYPE_NOT_CONSTRUCTED 156
1382+
#define ASN1_R_TYPE_NOT_PRIMITIVE 218
13811383
#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
13821384
#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
13831385
#define ASN1_R_UNEXPECTED_EOC 159

include-ios/openssl/bio.h

+4
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ extern "C" {
175175
#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to
176176
* adjust socket timeouts */
177177

178+
#define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
179+
178180
#ifndef OPENSSL_NO_SCTP
179181
/* SCTP stuff */
180182
#define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
@@ -607,6 +609,8 @@ int BIO_ctrl_reset_read_request(BIO *b);
607609
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)
608610
#define BIO_dgram_set_peer(b,peer) \
609611
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
612+
#define BIO_dgram_get_mtu_overhead(b) \
613+
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
610614

611615
/* These two aren't currently implemented */
612616
/* int BIO_get_ex_num(BIO *bio); */

include-ios/openssl/bn.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,9 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
780780
#define bn_wcheck_size(bn, words) \
781781
do { \
782782
const BIGNUM *_bnum2 = (bn); \
783-
assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
783+
assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \
784+
/* avoid unused variable warning with NDEBUG */ \
785+
(void)(_bnum2); \
784786
} while(0)
785787

786788
#else /* !BN_DEBUG */

include-ios/openssl/dtls1.h

+8
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ extern "C" {
117117
#define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP"
118118
#endif
119119

120+
/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */
121+
#define DTLS1_MAX_MTU_OVERHEAD 48
122+
120123
typedef struct dtls1_bitmap_st
121124
{
122125
unsigned long map; /* track 32 packets on 32-bit systems
@@ -231,6 +234,7 @@ typedef struct dtls1_state_st
231234
/* Is set when listening for new connections with dtls1_listen() */
232235
unsigned int listen;
233236

237+
unsigned int link_mtu; /* max on-the-wire DTLS packet size */
234238
unsigned int mtu; /* max DTLS packet size */
235239

236240
struct hm_header_st w_msg_hdr;
@@ -252,6 +256,10 @@ typedef struct dtls1_state_st
252256
unsigned int handshake_fragment_len;
253257

254258
unsigned int retransmitting;
259+
/*
260+
* Set when the handshake is ready to process peer's ChangeCipherSpec message.
261+
* Cleared after the message has been processed.
262+
*/
255263
unsigned int change_cipher_spec_ok;
256264

257265
#ifndef OPENSSL_NO_SCTP

include-ios/openssl/opensslconf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ extern "C" {
9898

9999
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
100100
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
101-
#define ENGINESDIR "/tmp/openssl-1.0.1j-i386/lib/engines"
102-
#define OPENSSLDIR "/tmp/openssl-1.0.1j-i386"
101+
#define ENGINESDIR "/tmp/openssl-1.0.1k-i386/lib/engines"
102+
#define OPENSSLDIR "/tmp/openssl-1.0.1k-i386"
103103
#endif
104104
#endif
105105

include-ios/openssl/opensslv.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ extern "C" {
2929
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
3030
* major minor fix final patch/beta)
3131
*/
32-
#define OPENSSL_VERSION_NUMBER 0x100010afL
32+
#define OPENSSL_VERSION_NUMBER 0x100010bfL
3333
#ifdef OPENSSL_FIPS
34-
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j-fips 15 Oct 2014"
34+
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1k-fips 8 Jan 2015"
3535
#else
36-
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j 15 Oct 2014"
36+
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1k 8 Jan 2015"
3737
#endif
3838
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
3939

include-ios/openssl/srtp.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ssl/tls1.h */
1+
/* ssl/srtp.h */
22
/* Copyright (C) 1995-1998 Eric Young ([email protected])
33
* All rights reserved.
44
*
@@ -118,6 +118,8 @@
118118
#ifndef HEADER_D1_SRTP_H
119119
#define HEADER_D1_SRTP_H
120120

121+
#include <openssl/ssl.h>
122+
121123
#ifdef __cplusplus
122124
extern "C" {
123125
#endif

include-ios/openssl/ssl.h

+20-8
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,8 @@ struct ssl_session_st
596596
#define SSL_OP_SINGLE_ECDH_USE 0x00080000L
597597
/* If set, always create a new key when using tmp_dh parameters */
598598
#define SSL_OP_SINGLE_DH_USE 0x00100000L
599-
/* Set to always use the tmp_rsa key when doing RSA operations,
600-
* even when this violates protocol specs */
601-
#define SSL_OP_EPHEMERAL_RSA 0x00200000L
599+
/* Does nothing: retained for compatibiity */
600+
#define SSL_OP_EPHEMERAL_RSA 0x0
602601
/* Set on servers to choose the cipher according to the server's
603602
* preferences */
604603
#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L
@@ -654,8 +653,13 @@ struct ssl_session_st
654653
#define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L
655654
#define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L
656655
/* Send TLS_FALLBACK_SCSV in the ClientHello.
657-
* To be set by applications that reconnect with a downgraded protocol
658-
* version; see draft-ietf-tls-downgrade-scsv-00 for details. */
656+
* To be set only by applications that reconnect with a downgraded protocol
657+
* version; see draft-ietf-tls-downgrade-scsv-00 for details.
658+
*
659+
* DO NOT ENABLE THIS if your application attempts a normal handshake.
660+
* Only use this in explicit fallback retries, following the guidance
661+
* in draft-ietf-tls-downgrade-scsv-00.
662+
*/
659663
#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L
660664

661665
/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
@@ -688,6 +692,10 @@ struct ssl_session_st
688692
SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL)
689693
#define SSL_set_mtu(ssl, mtu) \
690694
SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL)
695+
#define DTLS_set_link_mtu(ssl, mtu) \
696+
SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL)
697+
#define DTLS_get_link_min_mtu(ssl) \
698+
SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL)
691699

692700
#define SSL_get_secure_renegotiation_support(ssl) \
693701
SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL)
@@ -1627,6 +1635,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
16271635
#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
16281636

16291637
#define SSL_CTRL_CHECK_PROTO_VERSION 119
1638+
#define DTLS_CTRL_SET_LINK_MTU 120
1639+
#define DTLS_CTRL_GET_LINK_MIN_MTU 121
16301640

16311641
#define DTLSv1_get_timeout(ssl, arg) \
16321642
SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)
@@ -1878,13 +1888,15 @@ const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
18781888
const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
18791889
#endif
18801890

1891+
#ifndef OPENSSL_NO_SSL3_METHOD
18811892
const SSL_METHOD *SSLv3_method(void); /* SSLv3 */
18821893
const SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */
18831894
const SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */
1895+
#endif
18841896

1885-
const SSL_METHOD *SSLv23_method(void); /* SSLv3 but can rollback to v2 */
1886-
const SSL_METHOD *SSLv23_server_method(void); /* SSLv3 but can rollback to v2 */
1887-
const SSL_METHOD *SSLv23_client_method(void); /* SSLv3 but can rollback to v2 */
1897+
const SSL_METHOD *SSLv23_method(void); /* Negotiate highest available SSL/TLS version */
1898+
const SSL_METHOD *SSLv23_server_method(void); /* Negotiate highest available SSL/TLS version */
1899+
const SSL_METHOD *SSLv23_client_method(void); /* Negotiate highest available SSL/TLS version */
18881900

18891901
const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
18901902
const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */

include-ios/openssl/ssl3.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,12 @@ typedef struct ssl3_buffer_st
393393
#define TLS1_FLAGS_TLS_PADDING_BUG 0x0008
394394
#define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
395395
#define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020
396+
/*
397+
* Set when the handshake is ready to process peer's ChangeCipherSpec message.
398+
* Cleared after the message has been processed.
399+
*/
396400
#define SSL3_FLAGS_CCS_OK 0x0080
397-
401+
398402
/* SSL3_FLAGS_SGC_RESTART_DONE is set when we
399403
* restart a handshake because of MS SGC and so prevents us
400404
* from restarting the handshake in a loop. It's reset on a
@@ -456,8 +460,11 @@ typedef struct ssl3_state_st
456460
* and freed and MD_CTX-es for all required digests are stored in
457461
* this array */
458462
EVP_MD_CTX **handshake_dgst;
459-
/* this is set whenerver we see a change_cipher_spec message
460-
* come in when we are not looking for one */
463+
/*
464+
* Set whenever an expected ChangeCipherSpec message is processed.
465+
* Unset when the peer's Finished message is received.
466+
* Unexpected ChangeCipherSpec messages trigger a fatal alert.
467+
*/
461468
int change_cipher_spec;
462469

463470
int warn_alert;

include-ios/openssl/x509.h

+1
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
768768
void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
769769
X509_ALGOR *algor);
770770
void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
771+
int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
771772

772773
X509_NAME *X509_NAME_dup(X509_NAME *xn);
773774
X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);

include-osx/openssl/asn1.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
776776
int ASN1_TYPE_get(ASN1_TYPE *a);
777777
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
778778
int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
779-
int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b);
779+
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
780780

781781
ASN1_OBJECT * ASN1_OBJECT_new(void );
782782
void ASN1_OBJECT_free(ASN1_OBJECT *a);
@@ -1329,6 +1329,7 @@ void ERR_load_ASN1_strings(void);
13291329
#define ASN1_R_ILLEGAL_TIME_VALUE 184
13301330
#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
13311331
#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
1332+
#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
13321333
#define ASN1_R_INVALID_BMPSTRING_LENGTH 129
13331334
#define ASN1_R_INVALID_DIGIT 130
13341335
#define ASN1_R_INVALID_MIME_TYPE 205
@@ -1378,6 +1379,7 @@ void ERR_load_ASN1_strings(void);
13781379
#define ASN1_R_TIME_NOT_ASCII_FORMAT 193
13791380
#define ASN1_R_TOO_LONG 155
13801381
#define ASN1_R_TYPE_NOT_CONSTRUCTED 156
1382+
#define ASN1_R_TYPE_NOT_PRIMITIVE 218
13811383
#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
13821384
#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
13831385
#define ASN1_R_UNEXPECTED_EOC 159

include-osx/openssl/bio.h

+4
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ extern "C" {
175175
#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to
176176
* adjust socket timeouts */
177177

178+
#define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
179+
178180
#ifndef OPENSSL_NO_SCTP
179181
/* SCTP stuff */
180182
#define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
@@ -607,6 +609,8 @@ int BIO_ctrl_reset_read_request(BIO *b);
607609
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)
608610
#define BIO_dgram_set_peer(b,peer) \
609611
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
612+
#define BIO_dgram_get_mtu_overhead(b) \
613+
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
610614

611615
/* These two aren't currently implemented */
612616
/* int BIO_get_ex_num(BIO *bio); */

include-osx/openssl/bn.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,9 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
780780
#define bn_wcheck_size(bn, words) \
781781
do { \
782782
const BIGNUM *_bnum2 = (bn); \
783-
assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
783+
assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \
784+
/* avoid unused variable warning with NDEBUG */ \
785+
(void)(_bnum2); \
784786
} while(0)
785787

786788
#else /* !BN_DEBUG */

include-osx/openssl/dtls1.h

+8
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ extern "C" {
117117
#define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP"
118118
#endif
119119

120+
/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */
121+
#define DTLS1_MAX_MTU_OVERHEAD 48
122+
120123
typedef struct dtls1_bitmap_st
121124
{
122125
unsigned long map; /* track 32 packets on 32-bit systems
@@ -231,6 +234,7 @@ typedef struct dtls1_state_st
231234
/* Is set when listening for new connections with dtls1_listen() */
232235
unsigned int listen;
233236

237+
unsigned int link_mtu; /* max on-the-wire DTLS packet size */
234238
unsigned int mtu; /* max DTLS packet size */
235239

236240
struct hm_header_st w_msg_hdr;
@@ -252,6 +256,10 @@ typedef struct dtls1_state_st
252256
unsigned int handshake_fragment_len;
253257

254258
unsigned int retransmitting;
259+
/*
260+
* Set when the handshake is ready to process peer's ChangeCipherSpec message.
261+
* Cleared after the message has been processed.
262+
*/
255263
unsigned int change_cipher_spec_ok;
256264

257265
#ifndef OPENSSL_NO_SCTP

include-osx/openssl/opensslconf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ extern "C" {
9898

9999
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
100100
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
101-
#define ENGINESDIR "/tmp/openssl-1.0.1j-i386/lib/engines"
102-
#define OPENSSLDIR "/tmp/openssl-1.0.1j-i386"
101+
#define ENGINESDIR "/tmp/openssl-1.0.1k-i386/lib/engines"
102+
#define OPENSSLDIR "/tmp/openssl-1.0.1k-i386"
103103
#endif
104104
#endif
105105

include-osx/openssl/opensslv.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ extern "C" {
2929
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
3030
* major minor fix final patch/beta)
3131
*/
32-
#define OPENSSL_VERSION_NUMBER 0x100010afL
32+
#define OPENSSL_VERSION_NUMBER 0x100010bfL
3333
#ifdef OPENSSL_FIPS
34-
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j-fips 15 Oct 2014"
34+
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1k-fips 8 Jan 2015"
3535
#else
36-
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j 15 Oct 2014"
36+
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1k 8 Jan 2015"
3737
#endif
3838
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
3939

include-osx/openssl/srtp.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ssl/tls1.h */
1+
/* ssl/srtp.h */
22
/* Copyright (C) 1995-1998 Eric Young ([email protected])
33
* All rights reserved.
44
*
@@ -118,6 +118,8 @@
118118
#ifndef HEADER_D1_SRTP_H
119119
#define HEADER_D1_SRTP_H
120120

121+
#include <openssl/ssl.h>
122+
121123
#ifdef __cplusplus
122124
extern "C" {
123125
#endif

0 commit comments

Comments
 (0)