Commit graph

5437 commits

Author SHA1 Message Date
Matt Caswell
72370164c3 Fixed valgrind complaint due to BN_consttime_swap reading uninitialised data.
This is actually ok for this function, but initialised to zero anyway if
PURIFY defined.

This does have the impact of masking any *real* unitialised data reads in bn though.

Patch based on approach suggested by Rich Salz.

PR#3415

(cherry picked from commit 77747e2d9a5573b1dbc15e247ce18c03374c760c)
2014-07-13 22:23:10 +01:00
Richard Levitte
8e8d7e1b26 * crypto/ui/ui_lib.c: misplaced brace in switch statement.
Detected by dcruette@qualitesys.com

(cherry picked from commit 8b5dd34091)
2014-07-13 19:15:30 +02:00
Ben Laurie
3ed6327571 Don't clean up uninitialised EVP_CIPHER_CTX on error (CID 483259).
(cherry picked from commit c1d1b0114e)
2014-07-10 17:52:37 +01:00
Matt Caswell
efd4f1dfd3 Fix memory leak in BIO_free if there is no destroy function.
Based on an original patch by Neitrino Photonov <neitrinoph@gmail.com>

PR#3439

(cherry picked from commit 66816c53be)
2014-07-09 23:34:35 +01:00
David Lloyd
00032b0ba1 Prevent infinite loop loading config files.
PR#2985
(cherry picked from commit 9d23f422a3)
2014-07-07 13:50:00 +01:00
Dr. Stephen Henson
98a3c3c514 Sanity check keylength in PVK files.
PR#2277
(cherry picked from commit 733a6c882e92f8221bd03a51643bb47f5f81bb81)
2014-07-06 00:36:11 +01:00
Alan Hryngle
675b1c2fce Return smaller of ret and f.
PR#3418.
(cherry picked from commit fdea4fff8f)
2014-07-05 22:38:44 +01:00
Dr. Stephen Henson
af7bcd7daa Add license info.
(cherry picked from commit 55707a36cc)
2014-07-04 18:43:50 +01:00
Andy Polyakov
e432336433 bn_exp.c: fix x86_64-specific crash with one-word modulus.
PR: #3397
(cherry picked from commit eca441b2b4)
2014-07-02 21:21:02 +02:00
Dr. Stephen Henson
6d87cd2f03 ASN1 sanity check.
Primitive encodings shouldn't use indefinite length constructed
form.

PR#2438 (partial).
(cherry picked from commit 398e99fe5e)
2014-07-02 01:00:18 +01:00
Dr. Stephen Henson
c28b055a0c Fix copy for CCM, GCM and XTS.
Internal pointers in CCM, GCM and XTS contexts should either be
NULL or set to point to the appropriate key schedule. This needs
to be adjusted when copying contexts.
(cherry picked from commit c2fd5d79ff)
2014-06-30 14:00:00 +01:00
ZNV
105a3db56e Make EVP_CIPHER_CTX_copy work in GCM mode.
PR#3272
(cherry picked from commit 370bf1d708)
2014-06-29 22:02:42 +01:00
Andreas Westfeld
5894eb1f33 Fix typo in ideatest.c
(cherry picked from commit d1d4382dcb)
2014-06-28 00:06:40 +01:00
Dr. Stephen Henson
69b8f2895b Fix for EVP_PBE_alg_add().
In EVP_PBE_alg_add don't use the underlying NID for the cipher
as it may have a non-standard key size.

PR#3206
(cherry picked from commit efb7caef637a1de8468ca109efd355a9d0e73a45)
2014-06-27 22:58:55 +01:00
Dr. Stephen Henson
0ace876730 Tolerate critical AKID in CRLs.
PR#3014
(cherry picked from commit 11da66f8b1)
2014-06-27 18:50:33 +01:00
Tom Greenslade
e9daf8a9ce Handle IPv6 addresses in OCSP_parse_url.
PR#2783
(cherry picked from commit b36f35cda9)
2014-06-27 17:31:44 +01:00
Dr. Stephen Henson
f46ea1d8e2 Remove ancient obsolete files under pkcs7.
(cherry picked from commit 7be6b27aaf)
2014-06-27 13:54:45 +01:00
Dr. Stephen Henson
0980992d44 Memory leak and NULL derefernce fixes.
PR#3403
2014-06-27 03:21:10 +01:00
Dr. Stephen Henson
38a503fb8a Fix OID encoding for one component.
OIDs with one component don't have an encoding.

PR#2556 (Bug#1)
2014-06-27 03:17:15 +01:00
Huzaifa Sidhpurwala
fef58ce79e Make sure BN_sqr can never return a negative value.
PR#3410
(cherry picked from commit e14e764c0d5d469da63d0819c6ffc0e1e9e7f0bb)
2014-06-26 23:50:36 +01:00
Jenny Yung
da0d5e78bc Memory allocation checks.
PR#3399.
2014-06-26 23:32:17 +01:00
Dr. Stephen Henson
aa59369b4c Fix null pointer errors.
PR#3394
(cherry picked from commit 7a9d59c148)
2014-06-10 14:48:07 +01:00
Jakub Wilk
5c52c04650 Create ~/.rnd with mode 0600 instead of 0666
Because of a missing include <fcntl.h> we don't have O_CREATE and don't create
the file with open() using mode 0600 but fall back to using fopen() with the
default umask followed by a chmod().

Problem found by Jakub Wilk <jwilk@debian.org>.
2014-06-08 21:25:43 +01:00
Dr. Stephen Henson
049615e35d Prepare for 1.0.1i-dev 2014-06-05 10:45:50 +01:00
Dr. Stephen Henson
6b72417a00 Prepare for 1.0.1h release 2014-06-05 10:45:00 +01:00
Libor Krystek
1854c48005 Corrected OPENSSL_NO_EC_NISTP_64_GCC_128 usage in ec_lcl.h. PR#3370 2014-06-03 23:19:21 +01:00
Dr. Stephen Henson
49270d0431 Set default global mask to UTF8 only.
(cherry picked from commit 3009244da4)
2014-06-01 15:04:29 +01:00
Dr. Stephen Henson
48f5b3efce Set version number correctly.
PR#3249
(cherry picked from commit 8909bf20269035d295743fca559207ef2eb84eb3)
2014-05-29 14:12:14 +01:00
František Bořánek
f8dc000699 Fix memory leak.
PR#3278
(cherry picked from commit de56fe797081fc09ebd1add06d6e2df42a324fd5)
2014-05-29 14:12:14 +01:00
Martin Kaiser
bf8d6f9ab8 remove duplicate 0x for default RSASSA-PSS salt len
(cherry picked from commit 3820fec3a09faecba7fe9912aa20ef7fcda8337b)
2014-05-29 14:12:14 +01:00
Dr. Stephen Henson
da0a95b23a Fix for PKCS12_create if no-rc2 specified.
Use triple DES for certificate encryption if no-rc2 is
specified.

PR#3357
(cherry picked from commit 4689c08453e95eeefcc88c9f32dc6e509f95caff)
2014-05-21 11:14:33 +01:00
Janpopan
4659b53e7d Fix a wrong parameter count ERR_add_error_data 2014-05-19 22:17:00 +01:00
Kurt Roeckx
d544755389 Set authkey to NULL and check malloc return value. 2014-05-12 00:24:59 +01:00
Martin Brejcha
88398e9ba3 dgram_sctp_ctrl: authkey memory leak
PR: 3327
2014-05-12 00:24:59 +01:00
Dr. Stephen Henson
d61be85581 Return an error if no recipient type matches.
If the key type does not match any CMS recipient type return
an error instead of using a random key (MMA mitigation). This
does not leak any useful information to an attacker.

PR#3348
2014-05-09 14:24:51 +01:00
Matt Caswell
c6a47f988c Fixed NULL pointer dereference in PKCS7_dataDecode reported by David Ramos in PR#3339 2014-05-07 23:25:46 +01:00
Geoff Thorpe
d0666f289a evp: prevent underflow in base64 decoding
This patch resolves RT ticket #2608.

Thanks to Robert Dugal for originally spotting this, and to David
Ramos for noticing that the ball had been dropped.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
2014-05-06 18:10:23 -04:00
Geoff Thorpe
d8afda60a9 bignum: allow concurrent BN_MONT_CTX_set_locked()
The lazy-initialisation of BN_MONT_CTX was serialising all threads, as
noted by Daniel Sands and co at Sandia. This was to handle the case that
2 or more threads race to lazy-init the same context, but stunted all
scalability in the case where 2 or more threads are doing unrelated
things! We favour the latter case by punishing the former. The init work
gets done by each thread that finds the context to be uninitialised, and
we then lock the "set" logic after that work is done - the winning
thread's work gets used, the losing threads throw away what they've done.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
2014-05-06 18:10:21 -04:00
Geoff Thorpe
804ab36df6 dso: eliminate VMS code on non-VMS systems
Even though the meat of dso_vms.c is compiled out on non-VMS builds,
the (pre-)compiler still traverses some of the macro handling. This
trips up at least one non-VMS build configuration, so this commit
makes the skip-VMS case more robust.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
2014-05-06 18:10:17 -04:00
Dr. Stephen Henson
a41d5174e2 Initialize num properly.
PR#3289
PR#3345
(cherry picked from commit 3ba1e406c2)
2014-05-06 14:09:14 +01:00
Dr. Stephen Henson
9c5d953a07 Set Enveloped data version to 2 if ktri version not zero. 2014-05-06 14:02:38 +01:00
Tim Hudson
7b7b18c57e - fix coverity issues 966593-966596 2014-05-06 00:07:34 +01:00
David Ramos
8eb094b946 Double free in i2o_ECPublicKey
PR: 3338
2014-05-04 00:53:19 +01:00
mancha
f0816174d2 Fix eckey_priv_encode()
Fix eckey_priv_encode to return an error on failure of i2d_ECPrivateKey.
2014-04-24 19:32:17 +00:00
Ben Laurie
9c8dc84ac1 Fix double frees. 2014-04-22 17:02:37 +01:00
Dr. Stephen Henson
3fc880ac5d Extension checking fixes.
When looking for an extension we need to set the last found
position to -1 to properly search all extensions.

PR#3309.
(cherry picked from commit 300b9f0b70)
2014-04-15 18:53:04 +01:00
Dr. Stephen Henson
ebe221948d Prepare for 1.0.1h-dev 2014-04-07 17:58:39 +01:00
Dr. Stephen Henson
b2d951e423 Prepare for 1.0.1g release 2014-04-07 17:55:44 +01:00
Dr. Stephen Henson
5be1ae28ef Return if ssleay_rand_add called with zero num.
Treat a zero length passed to ssleay_rand_add a no op: the existing logic
zeroes the md value which is very bad. OpenSSL itself never does this
internally and the actual call doesn't make sense as it would be passing
zero bytes of entropy.

Thanks to Marcus Meissner <meissner@suse.de> for reporting this bug.
2014-04-07 17:53:31 +01:00
Andy Polyakov
aba7600029 crypto/modes/gcm128.c: more strict aliasing fixes.
(cherry picked from commit 997d1aac7c)
2014-04-06 17:22:46 +02:00