Skip to content

Commit 78ed5a1

Browse files
committed
Update to openssl 1.0.1j
1 parent 8666c6d commit 78ed5a1

37 files changed

+174
-40
lines changed

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.1i"
10+
OPENSSL_VERSION="1.0.1j"
1111

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

include-ios/openssl/dtls1.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ extern "C" {
8484
#endif
8585

8686
#define DTLS1_VERSION 0xFEFF
87+
#define DTLS_MAX_VERSION DTLS1_VERSION
88+
8789
#define DTLS1_BAD_VER 0x0100
8890

8991
#if 0
@@ -284,4 +286,3 @@ typedef struct dtls1_record_data_st
284286
}
285287
#endif
286288
#endif
287-

include-ios/openssl/ebcdic.h

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
#include <sys/types.h>
77

8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
812
/* Avoid name clashes with other applications */
913
#define os_toascii _openssl_os_toascii
1014
#define os_toebcdic _openssl_os_toebcdic
@@ -16,4 +20,7 @@ extern const unsigned char os_toebcdic[256];
1620
void *ebcdic2ascii(void *dest, const void *srce, size_t count);
1721
void *ascii2ebcdic(void *dest, const void *srce, size_t count);
1822

23+
#ifdef __cplusplus
24+
}
25+
#endif
1926
#endif

include-ios/openssl/ec.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN
629629
int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
630630
int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);
631631

632-
/** Computes r = generator * n sum_{i=0}^num p[i] * m[i]
632+
/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i]
633633
* \param group underlying EC_GROUP object
634634
* \param r EC_POINT object for the result
635635
* \param n BIGNUM with the multiplier for the group generator (optional)

include-ios/openssl/modes.h

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
#include <stddef.h>
99

10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
1013
typedef void (*block128_f)(const unsigned char in[16],
1114
unsigned char out[16],
1215
const void *key);
@@ -133,3 +136,6 @@ typedef struct xts128_context XTS128_CONTEXT;
133136

134137
int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
135138
const unsigned char *inp, unsigned char *out, size_t len, int enc);
139+
#ifdef __cplusplus
140+
}
141+
#endif

include-ios/openssl/opensslconf.h

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/* opensslconf.h */
22
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
33

4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
47
/* OpenSSL was configured with the following options: */
5-
#ifndef OPENSSL_SYSNAME_iOS
6-
# define OPENSSL_SYSNAME_iOS
8+
#ifndef OPENSSL_SYSNAME_MACOSX
9+
# define OPENSSL_SYSNAME_MACOSX
710
#endif
811
#ifndef OPENSSL_DOING_MAKEDEPEND
912

@@ -85,15 +88,17 @@
8588
# endif
8689
#endif
8790

91+
#define OPENSSL_CPUID_OBJ
92+
8893
/* crypto/opensslconf.h.in */
8994

9095
/* Generate 80386 code? */
9196
#undef I386_ONLY
9297

9398
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
9499
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
95-
#define ENGINESDIR "/tmp/openssl-1.0.1i-i386/lib/engines"
96-
#define OPENSSLDIR "/tmp/openssl-1.0.1i-i386"
100+
#define ENGINESDIR "/tmp/openssl-1.0.1j-i386/lib/engines"
101+
#define OPENSSLDIR "/tmp/openssl-1.0.1j-i386"
97102
#endif
98103
#endif
99104

@@ -124,7 +129,7 @@
124129
* - Intel P6 because partial register stalls are very expensive;
125130
* - elder Alpha because it lacks byte load/store instructions;
126131
*/
127-
#define RC4_INT unsigned char
132+
#define RC4_INT unsigned int
128133
#endif
129134
#if !defined(RC4_CHUNK)
130135
/*
@@ -239,3 +244,6 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
239244

240245
#endif /* DES_DEFAULT_OPTIONS */
241246
#endif /* HEADER_DES_LOCL_H */
247+
#ifdef __cplusplus
248+
}
249+
#endif

include-ios/openssl/opensslv.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#ifndef HEADER_OPENSSLV_H
22
#define HEADER_OPENSSLV_H
33

4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
48
/* Numeric release version identifier:
59
* MNNFFPPS: major minor fix patch status
610
* The status nibble has one of the values 0 for development, 1 to e for betas
@@ -25,11 +29,11 @@
2529
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
2630
* major minor fix final patch/beta)
2731
*/
28-
#define OPENSSL_VERSION_NUMBER 0x1000109fL
32+
#define OPENSSL_VERSION_NUMBER 0x100010afL
2933
#ifdef OPENSSL_FIPS
30-
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1i-fips 6 Aug 2014"
34+
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j-fips 15 Oct 2014"
3135
#else
32-
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1i 6 Aug 2014"
36+
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j 15 Oct 2014"
3337
#endif
3438
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
3539

@@ -86,4 +90,7 @@
8690
#define SHLIB_VERSION_NUMBER "1.0.0"
8791

8892

93+
#ifdef __cplusplus
94+
}
95+
#endif
8996
#endif /* HEADER_OPENSSLV_H */

include-ios/openssl/ossl_typ.h

+7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
#ifndef HEADER_OPENSSL_TYPES_H
5656
#define HEADER_OPENSSL_TYPES_H
5757

58+
#ifdef __cplusplus
59+
extern "C" {
60+
#endif
61+
5862
#include <openssl/e_os2.h>
5963

6064
#ifdef NO_ASN1_TYPEDEFS
@@ -199,4 +203,7 @@ typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
199203
typedef struct ocsp_response_st OCSP_RESPONSE;
200204
typedef struct ocsp_responder_id_st OCSP_RESPID;
201205

206+
#ifdef __cplusplus
207+
}
208+
#endif
202209
#endif /* def HEADER_OPENSSL_TYPES_H */

include-ios/openssl/pkcs7.h

-4
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,6 @@ DECLARE_PKCS12_STACK_OF(PKCS7)
233233
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
234234
#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
235235
#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
236-
#define PKCS7_type_is_encrypted(a) \
237-
(OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
238-
239-
#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
240236

241237
#define PKCS7_set_detached(p,v) \
242238
PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)

include-ios/openssl/pqueue.h

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
#include <stdlib.h>
6565
#include <string.h>
6666

67+
#ifdef __cplusplus
68+
extern "C" {
69+
#endif
6770
typedef struct _pqueue *pqueue;
6871

6972
typedef struct _pitem
@@ -91,4 +94,7 @@ pitem *pqueue_next(piterator *iter);
9194
void pqueue_print(pqueue pq);
9295
int pqueue_size(pqueue pq);
9396

97+
#ifdef __cplusplus
98+
}
99+
#endif
94100
#endif /* ! HEADER_PQUEUE_H */

include-ios/openssl/rsa.h

+1
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ void ERR_load_RSA_strings(void);
559559
#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158
560560
#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
561561
#define RSA_R_PADDING_CHECK_FAILED 114
562+
#define RSA_R_PKCS_DECODING_ERROR 159
562563
#define RSA_R_P_NOT_PRIME 128
563564
#define RSA_R_Q_NOT_PRIME 129
564565
#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130

include-ios/openssl/safestack.h

+8
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757

5858
#include <openssl/stack.h>
5959

60+
#ifdef __cplusplus
61+
extern "C" {
62+
#endif
63+
6064
#ifndef CHECKED_PTR_OF
6165
#define CHECKED_PTR_OF(type, p) \
6266
((void*) (1 ? p : (type*)0))
@@ -2660,4 +2664,8 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
26602664
#define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh)
26612665
/* End of util/mkstack.pl block, you may now edit :-) */
26622666

2667+
2668+
#ifdef __cplusplus
2669+
}
2670+
#endif
26632671
#endif /* !defined HEADER_SAFESTACK_H */

include-ios/openssl/srtp.h

+4
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,17 @@ extern "C" {
130130
#define SRTP_NULL_SHA1_80 0x0005
131131
#define SRTP_NULL_SHA1_32 0x0006
132132

133+
#ifndef OPENSSL_NO_SRTP
134+
133135
int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
134136
int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles);
135137
SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
136138

137139
STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
138140
SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
139141

142+
#endif
143+
140144
#ifdef __cplusplus
141145
}
142146
#endif

include-ios/openssl/ssl.h

+9
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,10 @@ struct ssl_session_st
653653
*/
654654
#define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L
655655
#define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L
656+
/* 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. */
659+
#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L
656660

657661
/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
658662
* they cannot be used to clear bits. */
@@ -1511,6 +1515,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
15111515
#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
15121516
#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
15131517
#define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY /* fatal */
1518+
#define SSL_AD_INAPPROPRIATE_FALLBACK TLS1_AD_INAPPROPRIATE_FALLBACK /* fatal */
15141519

15151520
#define SSL_ERROR_NONE 0
15161521
#define SSL_ERROR_SSL 1
@@ -1621,6 +1626,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
16211626
#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
16221627
#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
16231628

1629+
#define SSL_CTRL_CHECK_PROTO_VERSION 119
1630+
16241631
#define DTLSv1_get_timeout(ssl, arg) \
16251632
SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)
16261633
#define DTLSv1_handle_timeout(ssl) \
@@ -2379,6 +2386,7 @@ void ERR_load_SSL_strings(void);
23792386
#define SSL_R_HTTPS_PROXY_REQUEST 155
23802387
#define SSL_R_HTTP_REQUEST 156
23812388
#define SSL_R_ILLEGAL_PADDING 283
2389+
#define SSL_R_INAPPROPRIATE_FALLBACK 373
23822390
#define SSL_R_INCONSISTENT_COMPRESSION 340
23832391
#define SSL_R_INVALID_CHALLENGE_LENGTH 158
23842392
#define SSL_R_INVALID_COMMAND 280
@@ -2525,6 +2533,7 @@ void ERR_load_SSL_strings(void);
25252533
#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
25262534
#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
25272535
#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
2536+
#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
25282537
#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
25292538
#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
25302539
#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100

include-ios/openssl/ssl3.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,14 @@
128128
extern "C" {
129129
#endif
130130

131-
/* Signalling cipher suite value: from draft-ietf-tls-renegotiation-03.txt */
131+
/* Signalling cipher suite value from RFC 5746
132+
* (TLS_EMPTY_RENEGOTIATION_INFO_SCSV) */
132133
#define SSL3_CK_SCSV 0x030000FF
133134

135+
/* Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00
136+
* (TLS_FALLBACK_SCSV) */
137+
#define SSL3_CK_FALLBACK_SCSV 0x03005600
138+
134139
#define SSL3_CK_RSA_NULL_MD5 0x03000001
135140
#define SSL3_CK_RSA_NULL_SHA 0x03000002
136141
#define SSL3_CK_RSA_RC4_40_MD5 0x03000003

include-ios/openssl/tls1.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,19 @@ extern "C" {
159159

160160
#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
161161

162+
#define TLS1_VERSION 0x0301
163+
#define TLS1_1_VERSION 0x0302
162164
#define TLS1_2_VERSION 0x0303
163-
#define TLS1_2_VERSION_MAJOR 0x03
164-
#define TLS1_2_VERSION_MINOR 0x03
165+
#define TLS_MAX_VERSION TLS1_2_VERSION
166+
167+
#define TLS1_VERSION_MAJOR 0x03
168+
#define TLS1_VERSION_MINOR 0x01
165169

166-
#define TLS1_1_VERSION 0x0302
167170
#define TLS1_1_VERSION_MAJOR 0x03
168171
#define TLS1_1_VERSION_MINOR 0x02
169172

170-
#define TLS1_VERSION 0x0301
171-
#define TLS1_VERSION_MAJOR 0x03
172-
#define TLS1_VERSION_MINOR 0x01
173+
#define TLS1_2_VERSION_MAJOR 0x03
174+
#define TLS1_2_VERSION_MINOR 0x03
173175

174176
#define TLS1_get_version(s) \
175177
((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0)
@@ -187,6 +189,7 @@ extern "C" {
187189
#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */
188190
#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */
189191
#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
192+
#define TLS1_AD_INAPPROPRIATE_FALLBACK 86 /* fatal */
190193
#define TLS1_AD_USER_CANCELLED 90
191194
#define TLS1_AD_NO_RENEGOTIATION 100
192195
/* codes 110-114 are from RFC3546 */

include-osx/openssl/dtls1.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ extern "C" {
8484
#endif
8585

8686
#define DTLS1_VERSION 0xFEFF
87+
#define DTLS_MAX_VERSION DTLS1_VERSION
88+
8789
#define DTLS1_BAD_VER 0x0100
8890

8991
#if 0
@@ -284,4 +286,3 @@ typedef struct dtls1_record_data_st
284286
}
285287
#endif
286288
#endif
287-

include-osx/openssl/ebcdic.h

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
#include <sys/types.h>
77

8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
812
/* Avoid name clashes with other applications */
913
#define os_toascii _openssl_os_toascii
1014
#define os_toebcdic _openssl_os_toebcdic
@@ -16,4 +20,7 @@ extern const unsigned char os_toebcdic[256];
1620
void *ebcdic2ascii(void *dest, const void *srce, size_t count);
1721
void *ascii2ebcdic(void *dest, const void *srce, size_t count);
1822

23+
#ifdef __cplusplus
24+
}
25+
#endif
1926
#endif

include-osx/openssl/ec.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN
629629
int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
630630
int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);
631631

632-
/** Computes r = generator * n sum_{i=0}^num p[i] * m[i]
632+
/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i]
633633
* \param group underlying EC_GROUP object
634634
* \param r EC_POINT object for the result
635635
* \param n BIGNUM with the multiplier for the group generator (optional)

include-osx/openssl/modes.h

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
#include <stddef.h>
99

10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
1013
typedef void (*block128_f)(const unsigned char in[16],
1114
unsigned char out[16],
1215
const void *key);
@@ -133,3 +136,6 @@ typedef struct xts128_context XTS128_CONTEXT;
133136

134137
int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
135138
const unsigned char *inp, unsigned char *out, size_t len, int enc);
139+
#ifdef __cplusplus
140+
}
141+
#endif

0 commit comments

Comments
 (0)