oweals/openssl.git
11 years agoReencode with X509_CRL_ctx_sign too.
Dr. Stephen Henson [Fri, 3 May 2013 11:31:47 +0000 (12:31 +0100)]
Reencode with X509_CRL_ctx_sign too.
(cherry picked from commit 96940f4f2d0300c033379a87db0ff19e598c6264)

11 years agoHeader needed for SOCK_STREAM on FreeBSD.
Ben Laurie [Tue, 4 Jun 2013 15:27:05 +0000 (16:27 +0100)]
Header needed for SOCK_STREAM on FreeBSD.

11 years agoFix missing/incorrect prototype.
Ben Laurie [Tue, 4 Jun 2013 15:17:30 +0000 (16:17 +0100)]
Fix missing/incorrect prototype.

11 years agoMissing prototypes.
Ben Laurie [Tue, 4 Jun 2013 14:14:18 +0000 (15:14 +0100)]
Missing prototypes.

11 years agoRemove added ;.
Ben Laurie [Tue, 4 Jun 2013 14:05:18 +0000 (15:05 +0100)]
Remove added ;.

11 years agocrypto/modes: even more strict aliasing fixes [and fix bug in cbc128.c from
Andy Polyakov [Mon, 5 Nov 2012 17:03:39 +0000 (17:03 +0000)]
crypto/modes: even more strict aliasing fixes [and fix bug in cbc128.c from
previous cbc128.c commit].

11 years agocbc128.c: fix strict aliasing warning.
Andy Polyakov [Mon, 5 Nov 2012 10:04:02 +0000 (10:04 +0000)]
cbc128.c: fix strict aliasing warning.

11 years agocrypto/bn/bn_exp.c: SPARC portability fix.
Andy Polyakov [Sat, 1 Jun 2013 07:58:07 +0000 (09:58 +0200)]
crypto/bn/bn_exp.c: SPARC portability fix.
(cherry picked from commit b69437e1e5cdf9c6dfda17cc238f87f730b198ac)

11 years agoaesni-sha1-x86_64.pl: Atom-specific optimization.
Andy Polyakov [Sat, 25 May 2013 17:08:39 +0000 (19:08 +0200)]
aesni-sha1-x86_64.pl: Atom-specific optimization.
(cherry picked from commit 4df2280b4f4747256a729116fef0f1c2af457522)

11 years agosha512-x86_64.pl: +16% optimization for Atom.
Andy Polyakov [Sat, 25 May 2013 17:02:57 +0000 (19:02 +0200)]
sha512-x86_64.pl: +16% optimization for Atom.

(and pending AVX2 changes).
(cherry picked from commit 504bbcf3cd236353d7e5ef66fc3bfbf5c7935791)

11 years agovpaes-x86[_64].pl: minor Atom-specific optimization.
Andy Polyakov [Sat, 25 May 2013 16:57:03 +0000 (18:57 +0200)]
vpaes-x86[_64].pl: minor Atom-specific optimization.
(cherry picked from commit 988d11b64193da65e7f9bbf436ad2a08d8d57142)

11 years agoevp/e_aes.c: engage SPARC T4 AES support [from master].
Andy Polyakov [Mon, 20 May 2013 14:36:53 +0000 (16:36 +0200)]
evp/e_aes.c: engage SPARC T4 AES support [from master].

11 years agoevp/e_aes.c: engage AES-NI GCM stitch.
Andy Polyakov [Mon, 20 May 2013 14:30:21 +0000 (16:30 +0200)]
evp/e_aes.c: engage AES-NI GCM stitch.

11 years agoevp/evp_err.c: update from master.
Andy Polyakov [Mon, 20 May 2013 14:16:34 +0000 (16:16 +0200)]
evp/evp_err.c: update from master.

11 years agoevp/e_camellia.c: engage SPARC T5 Camellia support [from master].
Andy Polyakov [Mon, 20 May 2013 14:09:13 +0000 (16:09 +0200)]
evp/e_camellia.c: engage SPARC T5 Camellia support [from master].

11 years agoevp/e_des[3].c: engage SPARC T4 DES support.
Andy Polyakov [Mon, 20 May 2013 14:08:39 +0000 (16:08 +0200)]
evp/e_des[3].c: engage SPARC T4 DES support.

11 years agoAdd BN support for SPARC VIS3 and T4 [from master].
Andy Polyakov [Mon, 20 May 2013 13:48:13 +0000 (15:48 +0200)]
Add BN support for SPARC VIS3 and T4 [from master].

11 years agomd5_locl.h: enable assembly support on SPARC [from master].
Andy Polyakov [Sun, 19 May 2013 22:33:09 +0000 (00:33 +0200)]
md5_locl.h: enable assembly support on SPARC [from master].

11 years agosparcv9cap.c: update from master.
Andy Polyakov [Sun, 19 May 2013 22:16:18 +0000 (00:16 +0200)]
sparcv9cap.c: update from master.

11 years agoAdd MD5 SPARC T4 code from master.
Andy Polyakov [Sun, 19 May 2013 22:08:15 +0000 (00:08 +0200)]
Add MD5 SPARC T4 code from master.

11 years agoAdd SHA SPARC T4 code from master.
Andy Polyakov [Sun, 19 May 2013 22:04:38 +0000 (00:04 +0200)]
Add SHA SPARC T4 code from master.

11 years agoAdd Camellia SPARC T4 module from master.
Andy Polyakov [Sun, 19 May 2013 21:58:54 +0000 (23:58 +0200)]
Add Camellia SPARC T4 module from master.

11 years agoAdd AES SPARC T4 module from master.
Andy Polyakov [Sun, 19 May 2013 21:54:34 +0000 (23:54 +0200)]
Add AES SPARC T4 module from master.

11 years agoAdd DES SPARC T4 module from master.
Andy Polyakov [Sun, 19 May 2013 21:51:22 +0000 (23:51 +0200)]
Add DES SPARC T4 module from master.

11 years agoAdd perlasm/sparcv9_modes.pl from master.
Andy Polyakov [Sun, 19 May 2013 21:47:38 +0000 (23:47 +0200)]
Add perlasm/sparcv9_modes.pl from master.

11 years agodes_enc.m4: update from master.
Andy Polyakov [Sun, 19 May 2013 21:43:12 +0000 (23:43 +0200)]
des_enc.m4: update from master.

11 years agoevp/Makefile: fix typo.
Andy Polyakov [Sun, 19 May 2013 21:11:03 +0000 (23:11 +0200)]
evp/Makefile: fix typo.

11 years agoAdd EVP glue to AES-NI SHA256 stich [from master].
Andy Polyakov [Sun, 19 May 2013 20:35:37 +0000 (22:35 +0200)]
Add EVP glue to AES-NI SHA256 stich [from master].

11 years agoAdd AES-NI SHA256 stitch and take it into build loop [from master].
Andy Polyakov [Sun, 19 May 2013 20:23:18 +0000 (22:23 +0200)]
Add AES-NI SHA256 stitch and take it into build loop [from master].

11 years agoaesni-sha1-x86_64.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 20:18:52 +0000 (22:18 +0200)]
aesni-sha1-x86_64.pl: update from master.

11 years agoAdd AES-NI GCM stich and take it into build loop [from master].
Andy Polyakov [Sun, 19 May 2013 20:06:18 +0000 (22:06 +0200)]
Add AES-NI GCM stich and take it into build loop [from master].

11 years agogcm128.c: update from master (add AVX and VIS3 support).
Andy Polyakov [Sun, 19 May 2013 19:55:30 +0000 (21:55 +0200)]
gcm128.c: update from master (add AVX and VIS3 support).

11 years agoghash-sparcv9.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:53:14 +0000 (21:53 +0200)]
ghash-sparcv9.pl: update from master.

11 years agoghash-x86_64.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:51:19 +0000 (21:51 +0200)]
ghash-x86_64.pl: update from master.

11 years agoghash-x86.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:46:03 +0000 (21:46 +0200)]
ghash-x86.pl: update from master.

11 years agosha512-x86_64.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:36:54 +0000 (21:36 +0200)]
sha512-x86_64.pl: update from master.

11 years agosha512-586.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:36:38 +0000 (21:36 +0200)]
sha512-586.pl: update from master.

11 years agosha256-598.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:35:55 +0000 (21:35 +0200)]
sha256-598.pl: update from master.

11 years agosha1-x86_64.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:33:04 +0000 (21:33 +0200)]
sha1-x86_64.pl: update from master.

11 years agosha1-586.pl: update from master.
Andy Polyakov [Sun, 19 May 2013 19:32:29 +0000 (21:32 +0200)]
sha1-586.pl: update from master.

11 years agocrypto/perlasm: update from master.
Andy Polyakov [Sun, 19 May 2013 19:27:59 +0000 (21:27 +0200)]
crypto/perlasm: update from master.

11 years agoRFC6689 support: add missing commit (git noob alert).
Andy Polyakov [Wed, 15 May 2013 18:41:51 +0000 (20:41 +0200)]
RFC6689 support: add missing commit (git noob alert).

11 years agossl/dnssec.c: compilation errors.
Andy Polyakov [Wed, 15 May 2013 18:38:58 +0000 (20:38 +0200)]
ssl/dnssec.c: compilation errors.

11 years agoInitial support for RFC6689, a.k.a. DANE.
Andy Polyakov [Mon, 13 May 2013 13:36:06 +0000 (15:36 +0200)]
Initial support for RFC6689, a.k.a. DANE.

Note that it initially applies to 1.0.2, and not to HEAD. This is
in order to allow development with existing libunbound installations
that are dependent on OpenSSL 1.0.x. More details in RT.

RT: 3003

11 years agoReencode certificates in X509_sign_ctx.
Dr. Stephen Henson [Thu, 2 May 2013 11:18:46 +0000 (12:18 +0100)]
Reencode certificates in X509_sign_ctx.

Reencode certificates in X509_sign_ctx as well as X509_sign.

This was causing a problem in the x509 application when it modified an
existing certificate.
(cherry picked from commit c6d8adb8a45186617e0a8e2c09469bd164b92b31)

11 years agocrypto/modes/modes_lcl.h: let STRICT_ALIGNMENT be on ARMv7.
Andy Polyakov [Sat, 13 Apr 2013 18:57:37 +0000 (20:57 +0200)]
crypto/modes/modes_lcl.h: let STRICT_ALIGNMENT be on ARMv7.

While ARMv7 in general is capable of unaligned access, not all instructions
actually are. And trouble is that compiler doesn't seem to differentiate
those capable and incapable of unaligned access. Side effect is that kernel
goes into endless loop retrying same instruction triggering unaligned trap.
Problem was observed in xts128.c and ccm128.c modules. It's possible to
resolve it by using (volatile u32*) casts, but letting STRICT_ALIGNMENT
be feels more appropriate.
(cherry picked from commit 3bdd80521a81d50ade4214053cd9b293f920a77b)

11 years agoSet s->d1 to NULL after freeing it.
Dr. Stephen Henson [Mon, 8 Apr 2013 17:03:12 +0000 (18:03 +0100)]
Set s->d1 to NULL after freeing it.
(cherry picked from commit 04638f2fc335a6dc2af8e5d556d36e29c261dcd2)

11 years agoTypo.
Dr. Stephen Henson [Sun, 31 Mar 2013 16:42:46 +0000 (17:42 +0100)]
Typo.
(cherry picked from commit 0ded2a06891a4d5a207d8f29aa9a89a755158170)

11 years agoCall RAND_cleanup in openssl application.
Dr. Stephen Henson [Thu, 28 Mar 2013 14:28:06 +0000 (14:28 +0000)]
Call RAND_cleanup in openssl application.
(cherry picked from commit 944bc29f9004cf8851427ebfa83ee70b8399da57)

11 years agoMake binary curve ASN.1 work in FIPS mode.
Matt Caswell [Tue, 26 Mar 2013 15:39:50 +0000 (15:39 +0000)]
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 94782e0e9c28bd872107b8f814f4db68c9fbf5ab)

11 years agoenhance EC method to support setting curve type when generating keys and add paramete...
Dr. Stephen Henson [Tue, 11 Sep 2012 13:54:09 +0000 (13:54 +0000)]
enhance EC method to support setting curve type when generating keys and add parameter encoding option
(cherry picked from commit 24edfa9df9e6315b107b7c2d8ce0634208e8c350)

11 years agoDisable compression for DTLS.
Dr. Stephen Henson [Tue, 19 Mar 2013 13:46:28 +0000 (13:46 +0000)]
Disable compression for DTLS.

The only standard compression method is stateful and is incompatible with
DTLS.

11 years agox86cpuid.pl: make it work with older CPUs.
Andy Polyakov [Mon, 4 Mar 2013 19:05:04 +0000 (20:05 +0100)]
x86cpuid.pl: make it work with older CPUs.

PR: 3005
(cherry picked from commit 5702e965d759dde8a098d8108660721ba2b93a7d)

11 years agoe_aes_cbc_hmac_sha1.c: fix rare bad record mac on AES-NI plaforms.
Andy Polyakov [Mon, 18 Mar 2013 18:29:41 +0000 (19:29 +0100)]
e_aes_cbc_hmac_sha1.c: fix rare bad record mac on AES-NI plaforms.

PR: 3002
(cherry picked from commit 5c60046553716fcf160718f59160493194f212dc)

11 years agoAvoid unnecessary fragmentation.
Michael Tuexen [Mon, 18 Mar 2013 14:30:38 +0000 (14:30 +0000)]
Avoid unnecessary fragmentation.
(cherry picked from commit 80ccc66d7eedb2d06050130c77c482ae1584199a)

11 years agoEncode INTEGER correctly.
Dr. Stephen Henson [Mon, 18 Mar 2013 14:19:40 +0000 (14:19 +0000)]
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 1643edc63c3e15b6db5a15a728bc288f2cc2bbc7)

11 years agoTypo.
Dr. Stephen Henson [Mon, 18 Mar 2013 13:58:32 +0000 (13:58 +0000)]
Typo.
(cherry picked from commit 1546fb780bc11556a18d70c5fb29af4a9d5beaff)

11 years agoUpdate ordinals.
Dr. Stephen Henson [Mon, 4 Mar 2013 19:28:39 +0000 (19:28 +0000)]
Update ordinals.

11 years agox86_64-gf2m.pl: fix typo.
Andy Polyakov [Fri, 1 Mar 2013 21:36:36 +0000 (22:36 +0100)]
x86_64-gf2m.pl: fix typo.
(cherry picked from commit 342dbbbe4eb82b6e12163965a12f580c2deb03ad)

11 years agox86_64-gf2m.pl: add missing Windows build fix for #2963.
Andy Polyakov [Fri, 1 Mar 2013 20:43:10 +0000 (21:43 +0100)]
x86_64-gf2m.pl: add missing Windows build fix for #2963.

PR: 3004
(cherry picked from commit 7c43601d4424575d589f028aed0d5a4ae337527f)

11 years agoAdd function CMS_RecipientInfo_encrypt
Dr. Stephen Henson [Tue, 26 Feb 2013 16:48:49 +0000 (16:48 +0000)]
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 e1f1d28f34cc5cfc87772e0d8331e00137a4a213)

11 years agoFix error codes.
Dr. Stephen Henson [Tue, 26 Feb 2013 16:46:58 +0000 (16:46 +0000)]
Fix error codes.
(cherry picked from commit 388aff08dc38d6e4c5146d445b62f581bb484ed4)

11 years agoDemo code for SSL_CONF API
Dr. Stephen Henson [Tue, 26 Feb 2013 16:33:05 +0000 (16:33 +0000)]
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 3646578ae7e29230d7b05a5487ad12990b2ae688)

11 years agoUpdate SSL_CONF docs.
Dr. Stephen Henson [Tue, 26 Feb 2013 15:27:56 +0000 (15:27 +0000)]
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 4365e4aad97fa37e4a97eb2270a64c03e6547014)

11 years agoNew -force_pubkey option to x509 utility to supply a different public
Dr. Stephen Henson [Fri, 7 Oct 2011 15:18:09 +0000 (15:18 +0000)]
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 43206a2d7cc87c959535c0f69e2aa3b364eafd6e)

11 years agobn_nist.c: work around clang 3.0 bug.
Andy Polyakov [Thu, 14 Feb 2013 08:51:41 +0000 (09:51 +0100)]
bn_nist.c: work around clang 3.0 bug.
(cherry picked from commit 750398acd85a7ae220d272d28a76dff7bb269c31)

11 years agoFix POD errors to stop make install_docs dying with pod2man 2.5.0+
Nick Alcock [Fri, 15 Feb 2013 17:44:11 +0000 (17:44 +0000)]
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 5cc270774258149235f69e1789b3370f57b0e27b)

11 years agocms-test.pl: make it work with not-so-latest perl.
Andy Polyakov [Mon, 16 May 2011 18:11:45 +0000 (18:11 +0000)]
cms-test.pl: make it work with not-so-latest perl.
(cherry picked from commit 9c437e2faded18b4ef6499d7041c65d6e216955b)

11 years agoUpate FAQ.
Dr. Stephen Henson [Tue, 12 Feb 2013 16:02:45 +0000 (16:02 +0000)]
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 2527b94fec345c0bec58f4c7a810b7b8d0552b17)

11 years agoCheck DTLS_BAD_VER for version number.
David Woodhouse [Tue, 12 Feb 2013 14:55:32 +0000 (14:55 +0000)]
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 d980abb22e22661e98e5cee33d760ab0c7584ecc)

11 years agoFix in ssltest is no-ssl2 configured
Dr. Stephen Henson [Mon, 11 Feb 2013 18:17:50 +0000 (18:17 +0000)]
Fix in ssltest is no-ssl2 configured
(cherry picked from commit cbf9b4aed3e209fe8a39e1d6f55aaf46d1369dc4)

11 years agoFAQ/README: we are now using Git instead of CVS
Lutz Jaenicke [Mon, 11 Feb 2013 10:29:05 +0000 (11:29 +0100)]
FAQ/README: we are now using Git instead of CVS
(cherry picked from commit f88dbb8385c199a2a28e9525c6bba3a64bda96af)

11 years agosparccpuid.S: work around emulator bug on T1.
Andy Polyakov [Mon, 11 Feb 2013 09:39:50 +0000 (10:39 +0100)]
sparccpuid.S: work around emulator bug on T1.
(cherry picked from commit 3caeef94bd045608af03b061643992e3afd9c445)

11 years agos3_cbc.c: make CBC_MAC_ROTATE_IN_PLACE universal.
Andy Polyakov [Fri, 8 Feb 2013 20:30:52 +0000 (21:30 +0100)]
s3_cbc.c: make CBC_MAC_ROTATE_IN_PLACE universal.
(cherry picked from commit f93a41877d8d7a287debb7c63d7b646abaaf269c)

11 years agos3_cbc.c: get rid of expensive divisions [from master].
Andy Polyakov [Fri, 8 Feb 2013 15:59:26 +0000 (16:59 +0100)]
s3_cbc.c: get rid of expensive divisions [from master].

11 years agossl/[d1|s3]_pkt.c: harmomize orig_len handling.
Andy Polyakov [Thu, 7 Feb 2013 21:47:05 +0000 (22:47 +0100)]
ssl/[d1|s3]_pkt.c: harmomize orig_len handling.
(cherry picked from commit 8545f73b8919770a5d012fe7a82d6785b69baa27)

11 years agoFix IV check and padding removal.
Dr. Stephen Henson [Thu, 7 Feb 2013 21:06:37 +0000 (21:06 +0000)]
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 32cc2479b473c49ce869e57fded7e9a77b695c0d)

11 years agoFix for EXP-RC2-CBC-MD5
Adam Langley [Wed, 6 Feb 2013 16:05:40 +0000 (16:05 +0000)]
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 f306b87d766e6ecf30824635c7c395b67cff9dbc)

11 years agoe_aes_cbc_hmac_sha1.c: align calculated MAC at cache line.
Andy Polyakov [Fri, 8 Feb 2013 09:31:13 +0000 (10:31 +0100)]
e_aes_cbc_hmac_sha1.c: align calculated MAC at cache line.

It also ensures that valgring is happy.
(cherry picked from commit 2141e6f30b1fd2906830fd23d8eae71fe72acc47)

11 years agoe_aes_cbc_hmac_sha1.c: cleanse temporary copy of HMAC secret.
Andy Polyakov [Sun, 3 Feb 2013 19:04:39 +0000 (20:04 +0100)]
e_aes_cbc_hmac_sha1.c: cleanse temporary copy of HMAC secret.
(cherry picked from commit 529d27ea472fc2c7ba9190a15a58cb84012d4ec6)

11 years agoe_aes_cbc_hmac_sha1.c: address the CBC decrypt timing issues.
Andy Polyakov [Sat, 2 Feb 2013 18:29:59 +0000 (19:29 +0100)]
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 125093b59f3c2a2d33785b5563d929d0472f1721)

11 years agossl/*: remove SSL3_RECORD->orig_len to restore binary compatibility.
Andy Polyakov [Fri, 1 Feb 2013 14:31:50 +0000 (15:31 +0100)]
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 8bfd4c659f180a6ce34f21c0e62956b362067fba)

11 years agoDon't access EVP_MD_CTX internals directly.
Dr. Stephen Henson [Fri, 1 Feb 2013 13:53:43 +0000 (13:53 +0000)]
Don't access EVP_MD_CTX internals directly.
(cherry picked from commit 04e45b52ee3be81121359cc1198fd01e38096e9f)

11 years agos3/s3_cbc.c: allow for compilations with NO_SHA256|512.
Andy Polyakov [Fri, 1 Feb 2013 09:10:32 +0000 (10:10 +0100)]
s3/s3_cbc.c: allow for compilations with NO_SHA256|512.
(cherry picked from commit d5371324d978e4096bf99b9d0fe71b2cb65d9dc8)

11 years agossl/s3_cbc.c: md_state alignment portability fix.
Andy Polyakov [Fri, 1 Feb 2013 08:59:56 +0000 (09:59 +0100)]
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 36260233e7e3396feed884d3f501283e0453c04f)

11 years agossl/s3_cbc.c: uint64_t portability fix.
Andy Polyakov [Fri, 1 Feb 2013 08:55:43 +0000 (09:55 +0100)]
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 cab13fc8473856a43556d41d8dac5605f4ba1f91)

11 years agotypo.
Dr. Stephen Henson [Thu, 31 Jan 2013 23:04:39 +0000 (23:04 +0000)]
typo.
(cherry picked from commit 34ab3c8c711ff79c2b768f0b17e4b2a78fd1df5d)

11 years agoAdd ordinal for CRYPTO_memcmp: since this will affect multiple
Dr. Stephen Henson [Thu, 31 Jan 2013 15:19:00 +0000 (15:19 +0000)]
Add ordinal for CRYPTO_memcmp: since this will affect multiple
branches it needs to be in a "gap".
(cherry picked from commit 81ce0e14e72e8e255ad1bd9c7cfaa47a6291919c)

11 years agoTiming fix mitigation for FIPS mode.
Dr. Stephen Henson [Tue, 29 Jan 2013 14:44:36 +0000 (14:44 +0000)]
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 b908e88ec15aa0a74805e3f2236fc4f83f2789c2)

11 years agoOops. Add missing file.
Ben Laurie [Mon, 28 Jan 2013 18:24:55 +0000 (18:24 +0000)]
Oops. Add missing file.
(cherry picked from commit 014265eb02e26f35c8db58e2ccbf100b0b2f0072)

11 years agoUpdate DTLS code to match CBC decoding in TLS.
Ben Laurie [Mon, 28 Jan 2013 17:34:33 +0000 (17:34 +0000)]
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 9f27de170d1b7bef3d46d41382dc4dafde8b3900)

11 years agoDon't crash when processing a zero-length, TLS >= 1.1 record.
Ben Laurie [Mon, 28 Jan 2013 17:33:18 +0000 (17:33 +0000)]
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 6cb19b7681f600b2f165e4adc57547b097b475fd)

11 years agoMake CBC decoding constant time.
Ben Laurie [Mon, 28 Jan 2013 17:31:49 +0000 (17:31 +0000)]
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 e130841bccfc0bb9da254dc84e23bc6a1c78a64e)

11 years agoAdd and use a constant-time memcmp.
Ben Laurie [Mon, 28 Jan 2013 17:30:38 +0000 (17:30 +0000)]
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 2ee798880a246d648ecddadc5b91367bee4a5d98)

11 years agoMerge branch 'OpenSSL_1_0_2-stable' of /home/steve/src/git/openssl into OpenSSL_1_0_2...
Dr. Stephen Henson [Mon, 4 Feb 2013 15:14:11 +0000 (15:14 +0000)]
Merge branch 'OpenSSL_1_0_2-stable' of /home/steve/src/git/openssl into OpenSSL_1_0_2-stable

11 years agoFix for trace code: SSL3 doesn't include a length value for
Dr. Stephen Henson [Mon, 4 Feb 2013 14:53:47 +0000 (14:53 +0000)]
Fix for trace code: SSL3 doesn't include a length value for
encrypted premaster secret value.
(cherry picked from commit ea34a58385058748c51037bfb2c3208ee639f5f1)

11 years agobn_word.c: fix overflow bug in BN_add_word.
Andy Polyakov [Fri, 9 Nov 2012 13:58:40 +0000 (13:58 +0000)]
bn_word.c: fix overflow bug in BN_add_word.
(cherry picked from commit 134c00659a1bc67ad35a1e4620e16bc4315e6e37)

11 years agox86_64 assembly pack: keep making Windows build more robust.
Andy Polyakov [Sat, 2 Feb 2013 18:52:43 +0000 (19:52 +0100)]
x86_64 assembly pack: keep making Windows build more robust.

PR: 2963 and a number of others
(cherry picked from commit 4568182a8b8cbfd15cbc175189029ac547bd1762)

11 years agoFix warning: lenmax isn't used any more.
Dr. Stephen Henson [Thu, 24 Jan 2013 14:06:54 +0000 (14:06 +0000)]
Fix warning: lenmax isn't used any more.

11 years agoDon't include comp.h in cmd_cd.c if OPENSSL_NO_COMP set
Dr. Stephen Henson [Wed, 23 Jan 2013 01:04:36 +0000 (01:04 +0000)]
Don't include comp.h in cmd_cd.c if OPENSSL_NO_COMP set