Skip to content

Commit c10fbd5

Browse files
committed
Merge remote-tracking branch 'upstream/OpenSSL_1_0_2-stable' into 1.0.2-chacha
2 parents b1141a3 + bc79281 commit c10fbd5

29 files changed

+476
-244
lines changed

CHANGES

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
Changes between 1.0.1h and 1.0.2 [xx XXX xxxx]
66

7+
*) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.)
8+
for corner cases. (Certain input points at infinity could lead to
9+
bogus results, with non-infinity inputs mapped to infinity too.)
10+
[Bodo Moeller]
11+
712
*) Initial support for PowerISA 2.0.7, first implemented in POWER8.
813
This covers AES, SHA256/512 and GHASH. "Initial" means that most
914
common cases are optimized and there still is room for further
@@ -39,17 +44,6 @@
3944
This work was sponsored by Intel Corp.
4045
[Andy Polyakov]
4146

42-
*) Harmonize version and its documentation. -f flag is used to display
43-
compilation flags.
44-
[mancha <[email protected]>]
45-
46-
*) Fix eckey_priv_encode so it immediately returns an error upon a failure
47-
in i2d_ECPrivateKey.
48-
[mancha <[email protected]>]
49-
50-
*) Fix some double frees. These are not thought to be exploitable.
51-
[mancha <[email protected]>]
52-
5347
*) Use algorithm specific chains in SSL_CTX_use_certificate_chain_file():
5448
this fixes a limiation in previous versions of OpenSSL.
5549
[Steve Henson]
@@ -68,14 +62,6 @@
6862
structure.
6963
[Douglas E. Engert, Steve Henson]
7064

71-
*) Add option SSL_OP_SAFARI_ECDHE_ECDSA_BUG (part of SSL_OP_ALL) which
72-
avoids preferring ECDHE-ECDSA ciphers when the client appears to be
73-
Safari on OS X. Safari on OS X 10.8..10.8.3 advertises support for
74-
several ECDHE-ECDSA ciphers, but fails to negotiate them. The bug
75-
is fixed in OS X 10.8.4, but Apple have ruled out both hot fixing
76-
10.8..10.8.3 and forcing users to upgrade to 10.8.4 or newer.
77-
[Rob Stradling, Adam Langley]
78-
7965
*) New functions OPENSSL_gmtime_diff and ASN1_TIME_diff to find the
8066
difference in days and seconds between two tm or ASN1_TIME structures.
8167
[Steve Henson]

Configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,14 +742,15 @@ my %disabled = ( # "what" => "comment" [or special keyword "experimental
742742
"shared" => "default",
743743
"ssl-trace" => "default",
744744
"store" => "experimental",
745+
"unit-test" => "default",
745746
"zlib" => "default",
746747
"zlib-dynamic" => "default"
747748
);
748749
my @experimental = ();
749750

750751
# This is what $depflags will look like with the above defaults
751752
# (we need this to see if we should advise the user to run "make depend"):
752-
my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE";
753+
my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST";
753754

754755
# Explicit "no-..." options will be collected in %disabled along with the defaults.
755756
# To remove something from %disabled, use "enable-foo" (unless it's experimental).

crypto/asn1/a_object.c

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,29 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
283283
ASN1err(ASN1_F_D2I_ASN1_OBJECT,i);
284284
return(NULL);
285285
}
286+
286287
ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
287288
long len)
288289
{
289290
ASN1_OBJECT *ret=NULL;
290291
const unsigned char *p;
291292
unsigned char *data;
292-
int i;
293-
/* Sanity check OID encoding: can't have leading 0x80 in
294-
* subidentifiers, see: X.690 8.19.2
293+
int i, length;
294+
295+
/* Sanity check OID encoding.
296+
* Need at least one content octet.
297+
* MSB must be clear in the last octet.
298+
* can't have leading 0x80 in subidentifiers, see: X.690 8.19.2
295299
*/
296-
for (i = 0, p = *pp; i < len; i++, p++)
300+
if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL ||
301+
p[len - 1] & 0x80)
302+
{
303+
ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING);
304+
return NULL;
305+
}
306+
/* Now 0 < len <= INT_MAX, so the cast is safe. */
307+
length = (int)len;
308+
for (i = 0; i < length; i++, p++)
297309
{
298310
if (*p == 0x80 && (!i || !(p[-1] & 0x80)))
299311
{
@@ -316,23 +328,23 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
316328
data = (unsigned char *)ret->data;
317329
ret->data = NULL;
318330
/* once detached we can change it */
319-
if ((data == NULL) || (ret->length < len))
331+
if ((data == NULL) || (ret->length < length))
320332
{
321333
ret->length=0;
322334
if (data != NULL) OPENSSL_free(data);
323-
data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1);
335+
data=(unsigned char *)OPENSSL_malloc(length);
324336
if (data == NULL)
325337
{ i=ERR_R_MALLOC_FAILURE; goto err; }
326338
ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;
327339
}
328-
memcpy(data,p,(int)len);
340+
memcpy(data,p,length);
329341
/* reattach data to object, after which it remains const */
330342
ret->data =data;
331-
ret->length=(int)len;
343+
ret->length=length;
332344
ret->sn=NULL;
333345
ret->ln=NULL;
334346
/* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
335-
p+=len;
347+
p+=length;
336348

337349
if (a != NULL) (*a)=ret;
338350
*pp=p;

crypto/bn/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ bn_exp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
253253
bn_exp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
254254
bn_exp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
255255
bn_exp.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_exp.c bn_lcl.h
256+
bn_exp.o: rsaz_exp.h
256257
bn_exp2.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
257258
bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
258259
bn_exp2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h

crypto/ec/ec2_smpl.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080

8181
const EC_METHOD *EC_GF2m_simple_method(void)
8282
{
83-
#ifdef OPENSSL_FIPS
84-
return fips_ec_gf2m_simple_method();
85-
#else
8683
static const EC_METHOD ret = {
8784
EC_FLAGS_DEFAULT_OCT,
8885
NID_X9_62_characteristic_two_field,
@@ -125,8 +122,12 @@ const EC_METHOD *EC_GF2m_simple_method(void)
125122
0 /* field_decode */,
126123
0 /* field_set_to_one */ };
127124

128-
return &ret;
125+
#ifdef OPENSSL_FIPS
126+
if (FIPS_mode())
127+
return fips_ec_gf2m_simple_method();
129128
#endif
129+
130+
return &ret;
130131
}
131132

132133

crypto/ec/ecp_mont.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@
7272

7373
const EC_METHOD *EC_GFp_mont_method(void)
7474
{
75-
#ifdef OPENSSL_FIPS
76-
return fips_ec_gfp_mont_method();
77-
#else
7875
static const EC_METHOD ret = {
7976
EC_FLAGS_DEFAULT_OCT,
8077
NID_X9_62_prime_field,
@@ -114,8 +111,12 @@ const EC_METHOD *EC_GFp_mont_method(void)
114111
ec_GFp_mont_field_decode,
115112
ec_GFp_mont_field_set_to_one };
116113

117-
return &ret;
114+
#ifdef OPENSSL_FIPS
115+
if (FIPS_mode())
116+
return fips_ec_gfp_mont_method();
118117
#endif
118+
119+
return &ret;
119120
}
120121

121122

crypto/ec/ecp_nist.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@
7373

7474
const EC_METHOD *EC_GFp_nist_method(void)
7575
{
76-
#ifdef OPENSSL_FIPS
77-
return fips_ec_gfp_nist_method();
78-
#else
7976
static const EC_METHOD ret = {
8077
EC_FLAGS_DEFAULT_OCT,
8178
NID_X9_62_prime_field,
@@ -115,8 +112,12 @@ const EC_METHOD *EC_GFp_nist_method(void)
115112
0 /* field_decode */,
116113
0 /* field_set_to_one */ };
117114

118-
return &ret;
115+
#ifdef OPENSSL_FIPS
116+
if (FIPS_mode())
117+
return fips_ec_gfp_nist_method();
119118
#endif
119+
120+
return &ret;
120121
}
121122

122123
int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)

0 commit comments

Comments
 (0)