Commit graph

10390 commits

Author SHA1 Message Date
Dr. Stephen Henson
e9a3aa9721 Set s->d1 to NULL after freeing it.
(cherry picked from commit 04638f2fc3)
2013-04-08 18:39:52 +01:00
Dr. Stephen Henson
a8cc9f1873 Typo.
(cherry picked from commit 0ded2a0689)
2013-03-31 17:43:42 +01:00
Dr. Stephen Henson
f25c3c0542 Call RAND_cleanup in openssl application.
(cherry picked from commit 944bc29f90)
2013-03-28 14:29:11 +00:00
Matt Caswell
4e5b9645e8 Make binary curve ASN.1 work in FIPS mode.
Don't check for binary curves by checking methods: the values will
be different in FIPS mode as they are redirected to the validated module
version.
(cherry picked from commit 94782e0e9c)
2013-03-26 16:58:29 +00:00
Dr. Stephen Henson
04347839ea enhance EC method to support setting curve type when generating keys and add parameter encoding option
(cherry picked from commit 24edfa9df9)
2013-03-20 15:54:05 +00:00
Dr. Stephen Henson
e14b8410ca Disable compression for DTLS.
The only standard compression method is stateful and is incompatible with
DTLS.
2013-03-19 13:46:57 +00:00
Andy Polyakov
2a1ab7b438 x86cpuid.pl: make it work with older CPUs.
PR: 3005
(cherry picked from commit 5702e965d7)
2013-03-18 19:50:09 +01:00
Andy Polyakov
dd1e4fbcc0 e_aes_cbc_hmac_sha1.c: fix rare bad record mac on AES-NI plaforms.
PR: 3002
(cherry picked from commit 5c60046553)
2013-03-18 19:35:20 +01:00
Michael Tuexen
3f84d34c37 Avoid unnecessary fragmentation.
(cherry picked from commit 80ccc66d7e)
2013-03-18 14:32:59 +00:00
Dr. Stephen Henson
d7e429b91d Encode INTEGER correctly.
If an ASN1_INTEGER structure is allocated but not explicitly set encode
it as zero: don't generate an invalid zero length INTEGER.
(cherry picked from commit 1643edc63c)
2013-03-18 14:22:01 +00:00
Dr. Stephen Henson
155ef13c67 Typo.
(cherry picked from commit 1546fb780b)
2013-03-18 13:59:57 +00:00
Dr. Stephen Henson
c3466040ec Update ordinals. 2013-03-04 19:28:57 +00:00
Andy Polyakov
2d9be79407 x86_64-gf2m.pl: fix typo.
(cherry picked from commit 342dbbbe4e)
2013-03-01 22:37:53 +01:00
Andy Polyakov
2e4b7eede3 x86_64-gf2m.pl: add missing Windows build fix for #2963.
PR: 3004
(cherry picked from commit 7c43601d44)
2013-03-01 21:57:25 +01:00
Dr. Stephen Henson
e1dee801b9 Add function CMS_RecipientInfo_encrypt
Add CMS_RecipientInfo_encrypt: this function encrypts an existing content
encryption key to match the key in the RecipientInfo structure: this is
useful if a new recpient is added to and existing enveloped data structure.

Add documentation.
(cherry picked from commit e1f1d28f34)
2013-02-26 17:06:08 +00:00
Dr. Stephen Henson
3c53fd892c Fix error codes.
(cherry picked from commit 388aff08dc)
2013-02-26 17:05:39 +00:00
Dr. Stephen Henson
c46990b13b Demo code for SSL_CONF API
Two example programs one for command line argument processing and
one for configuration file processing.
(cherry picked from commit 3646578ae7)
2013-02-26 16:34:23 +00:00
Dr. Stephen Henson
1510b1f4c2 Update SSL_CONF docs.
Fix some typos and update version number first added: it has now been
backported to OpenSSL 1.0.2.
(cherry picked from commit 4365e4aad9)
2013-02-26 15:29:49 +00:00
Dr. Stephen Henson
f8a69166ed New -force_pubkey option to x509 utility to supply a different public
key to the one in a request. This is useful for cases where the public
key cannot be used for signing e.g. DH.
(cherry picked from commit 43206a2d7c)
2013-02-25 15:25:27 +00:00
Andy Polyakov
b9eef98883 bn_nist.c: work around clang 3.0 bug.
(cherry picked from commit 750398acd8)
2013-02-16 11:37:38 +01:00
Nick Alcock
ae5c1ca377 Fix POD errors to stop make install_docs dying with pod2man 2.5.0+
podlators 2.5.0 has switched to dying on POD syntax errors. This means
that a bunch of long-standing erroneous POD in the openssl documentation
now leads to fatal errors from pod2man, halting installation.

Unfortunately POD constraints mean that you have to sort numeric lists
in ascending order if they start with 1: you cannot do 1, 0, 2 even if
you want 1 to appear first. I've reshuffled such (alas, I wish there
were a better way but I don't know of one).
(cherry picked from commit 5cc2707742)
2013-02-15 19:39:59 +01:00
Andy Polyakov
188ab7df98 cms-test.pl: make it work with not-so-latest perl.
(cherry picked from commit 9c437e2fad)
2013-02-14 16:39:06 +01:00
Dr. Stephen Henson
2e3d02fe1a Upate FAQ.
Add description of "allocate and encode" operation for ASN1 routines.

Document how versioning will for after the letter release reaches
y.
(cherry picked from commit 2527b94fec)
2013-02-12 16:05:02 +00:00
David Woodhouse
3a3a1af1da Check DTLS_BAD_VER for version number.
The version check for DTLS1_VERSION was redundant as
DTLS1_VERSION > TLS1_1_VERSION, however we do need to
check for DTLS1_BAD_VER for compatibility.

PR:2984
(cherry picked from commit d980abb22e)
2013-02-12 15:15:32 +00:00
Dr. Stephen Henson
0ced72c608 Fix in ssltest is no-ssl2 configured
(cherry picked from commit cbf9b4aed3)
2013-02-11 18:28:48 +00:00
Lutz Jaenicke
5584a95490 FAQ/README: we are now using Git instead of CVS
(cherry picked from commit f88dbb8385)
2013-02-11 11:33:19 +01:00
Andy Polyakov
a3e66779d3 sparccpuid.S: work around emulator bug on T1.
(cherry picked from commit 3caeef94bd)
2013-02-11 10:41:22 +01:00
Andy Polyakov
919eab8a8b s3_cbc.c: make CBC_MAC_ROTATE_IN_PLACE universal.
(cherry picked from commit f93a41877d)
2013-02-08 21:36:06 +01:00
Andy Polyakov
e9baceab5a s3_cbc.c: get rid of expensive divisions [from master]. 2013-02-08 16:59:26 +01:00
Andy Polyakov
b05561c4b7 ssl/[d1|s3]_pkt.c: harmomize orig_len handling.
(cherry picked from commit 8545f73b89)
2013-02-08 10:40:51 +01:00
Dr. Stephen Henson
b7355af421 Fix IV check and padding removal.
Fix the calculation that checks there is enough room in a record
after removing padding and optional explicit IV. (by Steve)

For AEAD remove the correct number of padding bytes (by Andy)
(cherry picked from commit 32cc2479b4)
2013-02-08 10:40:39 +01:00
Adam Langley
0462eedf5e Fix for EXP-RC2-CBC-MD5
MD5 should use little endian order. Fortunately the only ciphersuite
affected is EXP-RC2-CBC-MD5 (TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5) which
is a rarely used export grade ciphersuite.
(cherry picked from commit f306b87d76)
2013-02-08 10:40:13 +01:00
Andy Polyakov
82425f2c28 e_aes_cbc_hmac_sha1.c: align calculated MAC at cache line.
It also ensures that valgring is happy.
(cherry picked from commit 2141e6f30b)
2013-02-08 10:35:02 +01:00
Andy Polyakov
af010edd55 e_aes_cbc_hmac_sha1.c: cleanse temporary copy of HMAC secret.
(cherry picked from commit 529d27ea47)
2013-02-06 13:56:15 +00:00
Andy Polyakov
5966f4d973 e_aes_cbc_hmac_sha1.c: address the CBC decrypt timing issues.
Address CBC decrypt timing issues and reenable the AESNI+SHA1 stitch.
(cherry picked from commit 125093b59f)
2013-02-06 13:56:15 +00:00
Andy Polyakov
eeb486a5f4 ssl/*: remove SSL3_RECORD->orig_len to restore binary compatibility.
Kludge alert. This is arranged by passing padding length in unused
bits of SSL3_RECORD->type, so that orig_len can be reconstructed.
(cherry picked from commit 8bfd4c659f)
2013-02-06 13:56:15 +00:00
Dr. Stephen Henson
d7f55e76f2 Don't access EVP_MD_CTX internals directly.
(cherry picked from commit 04e45b52ee)
2013-02-06 13:56:14 +00:00
Andy Polyakov
7d9e781a1d s3/s3_cbc.c: allow for compilations with NO_SHA256|512.
(cherry picked from commit d5371324d9)
2013-02-06 13:56:14 +00:00
Andy Polyakov
e0c21a0b6b ssl/s3_cbc.c: md_state alignment portability fix.
RISCs are picky and alignment granted by compiler for md_state can be
insufficient for SHA512.
(cherry picked from commit 36260233e7)
2013-02-06 13:56:14 +00:00
Andy Polyakov
1dfb4b9400 ssl/s3_cbc.c: uint64_t portability fix.
Break dependency on uint64_t. It's possible to declare bits as
unsigned int, because TLS packets are limited in size and 32-bit
value can't overflow.
(cherry picked from commit cab13fc847)
2013-02-06 13:56:14 +00:00
Dr. Stephen Henson
e5cb774323 typo.
(cherry picked from commit 34ab3c8c71)
2013-02-06 13:56:14 +00:00
Dr. Stephen Henson
73390e6ba5 Add ordinal for CRYPTO_memcmp: since this will affect multiple
branches it needs to be in a "gap".
(cherry picked from commit 81ce0e14e7)
2013-02-06 13:56:13 +00:00
Dr. Stephen Henson
d91d9acc58 Timing fix mitigation for FIPS mode.
We have to use EVP in FIPS mode so we can only partially mitigate
timing differences.

Make an extra call to EVP_DigestSignUpdate to hash additonal blocks
to cover any timing differences caused by removal of padding.
(cherry picked from commit b908e88ec1)
2013-02-06 13:56:13 +00:00
Ben Laurie
820988a0c0 Oops. Add missing file.
(cherry picked from commit 014265eb02)
2013-02-06 13:56:13 +00:00
Ben Laurie
1326a64a33 Update DTLS code to match CBC decoding in TLS.
This change updates the DTLS code to match the constant-time CBC
behaviour in the TLS.
(cherry picked from commit 9f27de170d)
2013-02-06 13:56:13 +00:00
Ben Laurie
e0da2c2ed2 Don't crash when processing a zero-length, TLS >= 1.1 record.
The previous CBC patch was bugged in that there was a path through enc()
in s3_pkt.c/d1_pkt.c which didn't set orig_len. orig_len would be left
at the previous value which could suggest that the packet was a
sufficient length when it wasn't.
(cherry picked from commit 6cb19b7681)
2013-02-06 13:56:13 +00:00
Ben Laurie
fb0a59cc58 Make CBC decoding constant time.
This patch makes the decoding of SSLv3 and TLS CBC records constant
time. Without this, a timing side-channel can be used to build a padding
oracle and mount Vaudenay's attack.

This patch also disables the stitched AESNI+SHA mode pending a similar
fix to that code.

In order to be easy to backport, this change is implemented in ssl/,
rather than as a generic AEAD mode. In the future this should be changed
around so that HMAC isn't in ssl/, but crypto/ as FIPS expects.
(cherry picked from commit e130841bcc)
2013-02-06 13:56:12 +00:00
Ben Laurie
f5cd3561ba Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cherry picked from commit 2ee798880a)
2013-02-06 13:56:12 +00:00
Dr. Stephen Henson
115f7fa562 Merge branch 'OpenSSL_1_0_2-stable' of /home/steve/src/git/openssl into OpenSSL_1_0_2-stable 2013-02-04 15:14:11 +00:00
Dr. Stephen Henson
c867d87180 Fix for trace code: SSL3 doesn't include a length value for
encrypted premaster secret value.
(cherry picked from commit ea34a58385)
2013-02-04 15:14:00 +00:00