oweals/openssl.git
10 years agoRecongnise no-dane and no-libunbound
Dr. Stephen Henson [Sun, 1 Dec 2013 23:12:27 +0000 (23:12 +0000)]
Recongnise no-dane and no-libunbound

10 years agomake update
Dr. Stephen Henson [Sun, 1 Dec 2013 23:09:44 +0000 (23:09 +0000)]
make update

10 years agoFix warnings.
Dr. Stephen Henson [Sun, 1 Dec 2013 23:08:13 +0000 (23:08 +0000)]
Fix warnings.

10 years agoWIN32 fixes.
Dr. Stephen Henson [Sun, 1 Dec 2013 23:07:18 +0000 (23:07 +0000)]
WIN32 fixes.

10 years agoRSAX no longer compiled.
Dr. Stephen Henson [Sun, 1 Dec 2013 23:06:33 +0000 (23:06 +0000)]
RSAX no longer compiled.

10 years agoSimplify and update openssl.spec
Dr. Stephen Henson [Wed, 27 Nov 2013 15:35:02 +0000 (15:35 +0000)]
Simplify and update openssl.spec

11 years agoNew functions to retrieve certificate from SSL_CTX
Dr. Stephen Henson [Mon, 18 Nov 2013 18:49:46 +0000 (18:49 +0000)]
New functions to retrieve certificate from SSL_CTX

New functions to retrieve current certificate or private key
from an SSL_CTX.

Constify SSL_get_private_key().
(cherry picked from commit a25f9adc778e17568fe2a325e5c3606adb8329f1)

11 years agoDon't define SSL_select_next_proto if OPENSSL_NO_TLSEXT set
Dr. Stephen Henson [Mon, 18 Nov 2013 16:52:10 +0000 (16:52 +0000)]
Don't define SSL_select_next_proto if OPENSSL_NO_TLSEXT set
(cherry picked from commit 60aeb18750382362ec1c4e1cf05a7222c99ec886)

11 years agoUse correct header length in ssl3_send_certifcate_request
Dr. Stephen Henson [Sun, 17 Nov 2013 17:48:18 +0000 (17:48 +0000)]
Use correct header length in ssl3_send_certifcate_request
(cherry picked from commit fdeaf55bf95e1e2a1e70cca8b68c7d8bbef7c8f0)

11 years agoConstify.
Dr. Stephen Henson [Thu, 14 Nov 2013 21:00:40 +0000 (21:00 +0000)]
Constify.

11 years agoFix compilation with no-nextprotoneg.
Piotr Sikora [Wed, 13 Nov 2013 23:40:01 +0000 (15:40 -0800)]
Fix compilation with no-nextprotoneg.

PR#3106

11 years agoAllow match selecting of current certificate.
Dr. Stephen Henson [Wed, 13 Nov 2013 22:57:11 +0000 (22:57 +0000)]
Allow match selecting of current certificate.

If pointer comparison for current certificate fails check
to see if a match using X509_cmp succeeds for the current
certificate: this is useful for cases where the certificate
pointer is not available.
(cherry picked from commit 6856b288a6e66edd23907b7fa264f42e05ac9fc7)

11 years agoAdditional "chain_cert" functions.
Rob Stradling [Mon, 11 Nov 2013 17:04:24 +0000 (18:04 +0100)]
Additional "chain_cert" functions.

PR#3169

This patch, which currently applies successfully against master and
1_0_2, adds the following functions:

SSL_[CTX_]select_current_cert() - set the current certificate without
disturbing the existing structure.

SSL_[CTX_]get0_chain_certs() - get the current certificate's chain.

SSL_[CTX_]clear_chain_certs() - clear the current certificate's chain.

The patch also adds these functions to, and fixes some existing errors
in, SSL_CTX_add1_chain_cert.pod.
(cherry picked from commit 2f56c9c015dbca45379c9a725915b3b8e765a119)

11 years agoDelete duplicate entry.
Krzysztof Kwiatkowski [Wed, 13 Nov 2013 22:45:16 +0000 (22:45 +0000)]
Delete duplicate entry.

PR#3172
(cherry picked from commit 4f055e34c3598cad00fca097d812fa3e6436d967)

11 years agosrp/srp_grps.h: make it Compaq C-friendly.
Andy Polyakov [Tue, 12 Nov 2013 21:09:55 +0000 (22:09 +0100)]
srp/srp_grps.h: make it Compaq C-friendly.

PR: 3165
Submitted by: Daniel Richard G.
(cherry picked from commit 2df9ec01d563f9cc2deab07e8c3391059d476592)

11 years agomodes/asm/ghash-alpha.pl: update from HEAD.
Andy Polyakov [Tue, 12 Nov 2013 20:59:01 +0000 (21:59 +0100)]
modes/asm/ghash-alpha.pl: update from HEAD.

PR: 3165

11 years agoMake Makefiles OSF-make-friendly.
Andy Polyakov [Tue, 12 Nov 2013 20:49:15 +0000 (21:49 +0100)]
Make Makefiles OSF-make-friendly.

PR: 3165
(cherry picked from commit d1cf23ac86c05b22b8780e2c03b67230564d2d34)

11 years agoFix memory leak.
Dr. Stephen Henson [Mon, 11 Nov 2013 22:39:40 +0000 (22:39 +0000)]
Fix memory leak.
(cherry picked from commit 16bc45ba956fdf07c7cda7feda88de597569df63)

11 years agoTypo.
Dr. Stephen Henson [Mon, 11 Nov 2013 22:24:08 +0000 (22:24 +0000)]
Typo.

11 years agoFix for some platforms where "char" is unsigned.
Dr. Stephen Henson [Fri, 8 Nov 2013 18:59:26 +0000 (18:59 +0000)]
Fix for some platforms where "char" is unsigned.
(cherry picked from commit 08b433540416c5bc9a874ba0343e35ba490c65f1)

11 years agoMakefile.org: make FIPS build work with BSD make.
Andy Polyakov [Sun, 10 Nov 2013 22:06:41 +0000 (23:06 +0100)]
Makefile.org: make FIPS build work with BSD make.

11 years agoCheck for missing components in RSA_check.
Dr. Stephen Henson [Thu, 7 Nov 2013 15:15:20 +0000 (15:15 +0000)]
Check for missing components in RSA_check.
(cherry picked from commit 01be36ef70525e81fc358d2e559bdd0a0d9427a5)

11 years agoDocument RSAPublicKey_{in,out} options.
Dr. Stephen Henson [Thu, 7 Nov 2013 17:27:07 +0000 (17:27 +0000)]
Document RSAPublicKey_{in,out} options.
(cherry picked from commit 7040d73d22987532faa503630d6616cf2788c975)

11 years agoAdd CMS_SignerInfo_get0_signature function.
Dr. Stephen Henson [Thu, 7 Nov 2013 03:55:49 +0000 (03:55 +0000)]
Add CMS_SignerInfo_get0_signature function.

Add function to retrieve the signature from a CMS_SignerInfo structure:
applications can then read or modify it.
(cherry picked from commit e8df6cec4c09b9a94c4c07abcf0402d31ec82cc1)

11 years agoengines/ccgost/gost89.h: make word32 defintion unconditional.
Andy Polyakov [Fri, 8 Nov 2013 22:00:35 +0000 (23:00 +0100)]
engines/ccgost/gost89.h: make word32 defintion unconditional.

Original definition depended on __LONG_MAX__ that is not guaranteed to
be present. As we don't support platforms with int narrower that 32 bits
it's appropriate to make defition inconditional.

PR: 3165
(cherry picked from commit 96180cac04591abfe50fc86096365553484bde65)

11 years agomodes/asm/ghash-alpha.pl: make it work with older assembler.
Andy Polyakov [Fri, 8 Nov 2013 21:56:44 +0000 (22:56 +0100)]
modes/asm/ghash-alpha.pl: make it work with older assembler.

PR: 3165
(cherry picked from commit d24d1d7daf515aa19fbf18f6371e3e617028a07c)

11 years agoEnable PSK in FIPS mode.
Dr. Stephen Henson [Wed, 6 Nov 2013 14:38:28 +0000 (14:38 +0000)]
Enable PSK in FIPS mode.

Enable PSK ciphersuites with AES or DES3 in FIPS mode.
(cherry picked from commit e0ffd129c16af90eb5e2ce54e57832c0046d1aaf)

11 years agoInitialise context before using it.
Dr. Stephen Henson [Wed, 6 Nov 2013 13:16:50 +0000 (13:16 +0000)]
Initialise context before using it.

11 years agoPBKDF2 should be efficient. Contributed by Christian Heimes
Ben Laurie [Sun, 3 Nov 2013 17:23:50 +0000 (17:23 +0000)]
PBKDF2 should be efficient. Contributed by Christian Heimes
<christian@python.org>.

11 years agoAdd brainpool curves to trace output.
Dr. Stephen Henson [Sat, 2 Nov 2013 14:07:21 +0000 (14:07 +0000)]
Add brainpool curves to trace output.

11 years agoFix warning.
Dr. Stephen Henson [Fri, 1 Nov 2013 21:39:56 +0000 (21:39 +0000)]
Fix warning.
(cherry picked from commit 96e16bddb42563dc09187939dc20b35369d413b7)

11 years agoAdd SSL_CONF command to set DH Parameters.
Dr. Stephen Henson [Tue, 22 Oct 2013 06:35:22 +0000 (07:35 +0100)]
Add SSL_CONF command to set DH Parameters.
(cherry picked from commit c557f921dcb20a1bf2ce75e9dc7dd164e59ec3ea)

11 years agoFix argument processing.
Dr. Stephen Henson [Tue, 22 Oct 2013 04:37:10 +0000 (05:37 +0100)]
Fix argument processing.
(cherry picked from commit abf840e4f71c3a8795428c213fd37ece2a910443)

11 years agoConstification.
Dr. Stephen Henson [Mon, 21 Oct 2013 06:19:01 +0000 (07:19 +0100)]
Constification.
(cherry picked from commit 27f3b65f49ea91fcf4b46ec0298be51b4207214a)

11 years agoExtend SSL_CONF
Dr. Stephen Henson [Fri, 18 Oct 2013 15:09:12 +0000 (16:09 +0100)]
Extend SSL_CONF

Extend SSL_CONF to return command value types.

Add certificate and key options.

Update documentation.
(cherry picked from commit ec2f7e568ea18a22ab57326fffe78ef2aa6884f5)

11 years agoTypo.
Dr. Stephen Henson [Thu, 17 Oct 2013 15:07:27 +0000 (16:07 +0100)]
Typo.
(cherry picked from commit 13af1451595b514524b0efc17f99f6392ce090d5)

11 years agoFix SSL_OP_SINGLE_ECDH_USE
Piotr Sikora [Fri, 1 Nov 2013 21:35:46 +0000 (21:35 +0000)]
Fix SSL_OP_SINGLE_ECDH_USE

Don't require a public key in tls1_set_ec_id if compression status is
not needed. This fixes a bug where SSL_OP_SINGLE_ECDH_USE wouldn't work.

11 years agoAdd -ecdh_single option.
Dr. Stephen Henson [Fri, 1 Nov 2013 21:35:00 +0000 (21:35 +0000)]
Add -ecdh_single option.

Add -ecdh_single option to set SSL_OP_SINGLE_ECDH_USE on the command line.

11 years agoDTLS/SCTP struct authchunks Bug
Robin Seggelmann [Wed, 9 May 2012 17:28:44 +0000 (19:28 +0200)]
DTLS/SCTP struct authchunks Bug

PR: 2809

DTLS/SCTP requires DATA and FORWARD-TSN chunks to be protected with
SCTP-AUTH.  It is checked if this has been activated successfully for
the local and remote peer. Due to a bug, however, the
gauth_number_of_chunks field of the authchunks struct is missing on
FreeBSD, and was therefore not considered in the OpenSSL implementation.
This patch sets the corresponding pointer for the check correctly
whether or not this bug is present.

11 years agoDTLS/SCTP Finished Auth Bug
Robin Seggelmann [Wed, 9 May 2012 17:28:41 +0000 (19:28 +0200)]
DTLS/SCTP Finished Auth Bug

PR: 2808

With DTLS/SCTP the SCTP extension SCTP-AUTH is used to protect DATA and
FORWARD-TSN chunks. The key for this extension is derived from the
master secret and changed with the next ChangeCipherSpec, whenever a new
key has been negotiated. The following Finished then already uses the
new key.  Unfortunately, the ChangeCipherSpec and Finished are part of
the same flight as the ClientKeyExchange, which is necessary for the
computation of the new secret. Hence, these messages are sent
immediately following each other, leaving the server very little time to
compute the new secret and pass it to SCTP before the finished arrives.
So the Finished is likely to be discarded by SCTP and a retransmission
becomes necessary. To prevent this issue, the Finished of the client is
still sent with the old key.

11 years agoRemove unused variable.
Ben Laurie [Mon, 21 Oct 2013 02:34:00 +0000 (03:34 +0100)]
Remove unused variable.

11 years agoFix another gmt_unix_time case in server_random
Nick Mathewson [Sun, 20 Oct 2013 22:08:58 +0000 (15:08 -0700)]
Fix another gmt_unix_time case in server_random

11 years agoDo not include a timestamp in the Client/ServerHello Random field.
Nick Mathewson [Sun, 20 Oct 2013 22:03:24 +0000 (15:03 -0700)]
Do not include a timestamp in the Client/ServerHello Random field.

Instead, send random bytes, unless SSL_SEND_{CLIENT,SERVER}RANDOM_MODE
is set.

This is a forward-port of commits:
  4af793036f6ef4f0a1078e5d7155426a98d50e37
  f4c93b46edb51da71f09eda99e83eaf193a33c08
  3da721dac9382c48812c8eba455528fd59af2eef
  2583270191a8b27eed303c03ece1da97b9b69fd3

While the gmt_unix_time record was added in an ostensible attempt to
mitigate the dangers of a bad RNG, its presence leaks the host's view
of the current time in the clear.  This minor leak can help
fingerprint TLS instances across networks and protocols... and what's
worse, it's doubtful thet the gmt_unix_time record does any good at
all for its intended purpose, since:

    * It's quite possible to open two TLS connections in one second.

    * If the PRNG output is prone to repeat itself, ephemeral
      handshakes (and who knows what else besides) are broken.

11 years agoRemove gratuitous patent references
Steve Marquess [Tue, 15 Oct 2013 12:03:12 +0000 (08:03 -0400)]
Remove gratuitous patent references

11 years agoFix no-ssl-trace
Dr. Stephen Henson [Thu, 17 Oct 2013 14:37:12 +0000 (15:37 +0100)]
Fix no-ssl-trace

11 years agoPrevent use of RSA+MD5 in TLS 1.2 by default.
Dr. Stephen Henson [Tue, 15 Oct 2013 12:37:01 +0000 (13:37 +0100)]
Prevent use of RSA+MD5 in TLS 1.2 by default.

Removing RSA+MD5 from the default signature algorithm list
prevents its use by default.

If a broken implementation attempts to use RSA+MD5 anyway the sanity
checking of signature algorithms will cause a fatal alert.
(cherry picked from commit 77a0f740d00ecf8f6b01c0685a2f858c3f65a3dd)

11 years agoAdd clang debug target.
Ben Laurie [Sun, 20 Oct 2013 12:10:25 +0000 (13:10 +0100)]
Add clang debug target.

11 years agoPPC assembly pack: make new .size directives profiler-friendly.
Andy Polyakov [Tue, 15 Oct 2013 21:40:12 +0000 (23:40 +0200)]
PPC assembly pack: make new .size directives profiler-friendly.

Suggested by: Anton Blanchard
(cherry picked from commit 76c15d790e07f6cc098be2d7b7f6ddc8acd11ca6)

11 years agoAdd brainpool curves to NID table too.
Dr. Stephen Henson [Tue, 15 Oct 2013 11:08:47 +0000 (12:08 +0100)]
Add brainpool curves to NID table too.
(cherry picked from commit 6699cb84912f0d7c04acbf91c3e3dbdae5929857)

11 years agoFix warning.
Dr. Stephen Henson [Tue, 15 Oct 2013 00:17:40 +0000 (01:17 +0100)]
Fix warning.
(cherry picked from commit f6983769c1bcd6c3c6b6bbfbbc41848f6dccf127)

11 years agoAdd test vectors from RFC7027
Dr. Stephen Henson [Tue, 15 Oct 2013 00:17:15 +0000 (01:17 +0100)]
Add test vectors from RFC7027
(cherry picked from commit 8ba2d4ed7f128e400693562efd35985068c45e4d)

11 years agoRFC7027 (Brainpool for TLS) support.
Dr. Stephen Henson [Mon, 14 Oct 2013 17:44:44 +0000 (18:44 +0100)]
RFC7027 (Brainpool for TLS) support.
(cherry picked from commit 695e8c36528f9c3275f5f56e9633ac6a0c11f2e3)

11 years agoPPC assembly pack: update from master branch.
Andy Polyakov [Mon, 14 Oct 2013 22:31:45 +0000 (00:31 +0200)]
PPC assembly pack: update from master branch.

Includes multiple updates: AES module to comply with more ABI
flavors, SHA512 for PPC32, .size directives.

11 years agoAdd support for Cygwin-x86_64.
Andy Polyakov [Sun, 15 Sep 2013 19:59:25 +0000 (21:59 +0200)]
Add support for Cygwin-x86_64.

PR: 3110
Submitted by Corinna Vinschen.
(cherry picked from commit b3ef742cbbc1c8bf0e33dca60f08c65031647b07)

11 years agoInitial aarch64 bits.
Andy Polyakov [Sun, 13 Oct 2013 17:15:15 +0000 (19:15 +0200)]
Initial aarch64 bits.
(cherry picked from commit 039081b80977e2a5de84e1f88f8b4d025b559956)

11 years agoMIPS assembly pack: get rid of deprecated instructions.
Andy Polyakov [Sun, 13 Oct 2013 11:14:52 +0000 (13:14 +0200)]
MIPS assembly pack: get rid of deprecated instructions.

Latest MIPS ISA specification declared 'branch likely' instructions
obsolete. To makes code future-proof replace them with equivalent.
(cherry picked from commit 0c2adb0a9be76da8de9bbfd5377215f71711a52e)

11 years agoaes/asm/bsaes-x86_64.pl: update from master.
Andy Polyakov [Sat, 12 Oct 2013 19:47:54 +0000 (21:47 +0200)]
aes/asm/bsaes-x86_64.pl: update from master.

Performance improvement and Windows-specific bugfix (PR#3139).

11 years agobn/asm/rsax-avx2.pl: minor optimization [for Decoded ICache].
Andy Polyakov [Thu, 10 Oct 2013 21:06:43 +0000 (23:06 +0200)]
bn/asm/rsax-avx2.pl: minor optimization [for Decoded ICache].
(cherry picked from commit fa104be35e24f3fea895d55bb7042d6f4b2963e9)

11 years agoConstification.
Ben Laurie [Mon, 7 Oct 2013 11:41:43 +0000 (12:41 +0100)]
Constification.

11 years agoMerge branch 'OpenSSL_1_0_2-stable' into pre-aead
Ben Laurie [Sat, 5 Oct 2013 20:20:24 +0000 (21:20 +0100)]
Merge branch 'OpenSSL_1_0_2-stable' into pre-aead

11 years agoevp/e_des3.c: fix typo with potential integer overflow on 32-bit platforms.
Andy Polyakov [Thu, 3 Oct 2013 08:55:49 +0000 (10:55 +0200)]
evp/e_des3.c: fix typo with potential integer overflow on 32-bit platforms.

Submitted by: Yuriy Kaminskiy
(cherry picked from commit 524b00c0da42b129ed8622dfb3f5eab9cc5d6617)

11 years agoperlasm/sparcv9_modes.pl: make it work even with seasoned perl.
Andy Polyakov [Thu, 3 Oct 2013 08:42:11 +0000 (10:42 +0200)]
perlasm/sparcv9_modes.pl: make it work even with seasoned perl.

PR: 3130
(cherry picked from commit 6b2cae0c16631c6c1ccf61080fc2aa9bd1b5ea1b)

11 years agoMerge branch 'OpenSSL_1_0_2-stable' into agl-1.0.2aead
Ben Laurie [Fri, 4 Oct 2013 11:59:03 +0000 (12:59 +0100)]
Merge branch 'OpenSSL_1_0_2-stable' into agl-1.0.2aead

11 years agoTidy.
Ben Laurie [Fri, 4 Oct 2013 11:58:08 +0000 (12:58 +0100)]
Tidy.

11 years agoMerge branch 'OpenSSL_1_0_2-stable' into agl-1.0.2aead
Ben Laurie [Fri, 4 Oct 2013 11:48:24 +0000 (12:48 +0100)]
Merge branch 'OpenSSL_1_0_2-stable' into agl-1.0.2aead

11 years agoMake it build and test.
Ben Laurie [Thu, 3 Oct 2013 18:02:58 +0000 (19:02 +0100)]
Make it build and test.

11 years agoevp/e_des3.c: fix typo with potential integer overflow on 32-bit platforms.
Andy Polyakov [Thu, 3 Oct 2013 08:55:49 +0000 (10:55 +0200)]
evp/e_des3.c: fix typo with potential integer overflow on 32-bit platforms.

Submitted by: Yuriy Kaminskiy
(cherry picked from commit 524b00c0da42b129ed8622dfb3f5eab9cc5d6617)

11 years agoperlasm/sparcv9_modes.pl: make it work even with seasoned perl.
Andy Polyakov [Thu, 3 Oct 2013 08:42:11 +0000 (10:42 +0200)]
perlasm/sparcv9_modes.pl: make it work even with seasoned perl.

PR: 3130
(cherry picked from commit 6b2cae0c16631c6c1ccf61080fc2aa9bd1b5ea1b)

11 years agoAEAD Tests.
Adam Langley [Fri, 20 Sep 2013 20:04:54 +0000 (16:04 -0400)]
AEAD Tests.

Add tests for AEAD functions: AES-128-GCM, AES-256-GCM and
ChaCha20+Poly1305.

11 years agochacha20poly1305
Adam Langley [Mon, 9 Sep 2013 16:13:24 +0000 (12:13 -0400)]
chacha20poly1305

Add support for Chacha20 + Poly1305.

11 years agoUse AEAD for AES-GCM.
Adam Langley [Wed, 4 Sep 2013 16:21:12 +0000 (12:21 -0400)]
Use AEAD for AES-GCM.

Switches AES-GCM ciphersuites to use AEAD interfaces.

11 years agoAEAD support in ssl/
Adam Langley [Thu, 25 Jul 2013 21:35:23 +0000 (17:35 -0400)]
AEAD support in ssl/

This change allows AEADs to be used in ssl/ to implement SSL/TLS
ciphersuites.

11 years agoAEAD support.
Adam Langley [Thu, 25 Jul 2013 20:52:35 +0000 (16:52 -0400)]
AEAD support.

This change adds an AEAD interface to EVP and an AES-GCM implementation
suitable for use in TLS.

11 years agoRework tls1_change_cipher_state.
Adam Langley [Tue, 1 Oct 2013 15:18:10 +0000 (11:18 -0400)]
Rework tls1_change_cipher_state.

The previous version of the function made adding AEAD changes very
difficult. This change should be a semantic no-op - it should be purely
a cleanup.

11 years agoConstification.
Ben Laurie [Tue, 1 Oct 2013 13:51:04 +0000 (14:51 +0100)]
Constification.

11 years agoUpdate cms docs.
Dr. Stephen Henson [Mon, 5 Aug 2013 14:56:01 +0000 (15:56 +0100)]
Update cms docs.
(cherry picked from commit dfcb42c68eac61b35d52f2fc53771c0f27dd9c29)

11 years agoCorrectly test for no-ec.
Ben Laurie [Wed, 21 Aug 2013 03:21:57 +0000 (04:21 +0100)]
Correctly test for no-ec.
(cherry picked from commit d5605699a15d870457f96b3e1795135228547324)

11 years agoDon't run ECDH CMS tests if EC disabled.
Dr. Stephen Henson [Sat, 17 Aug 2013 16:39:48 +0000 (17:39 +0100)]
Don't run ECDH CMS tests if EC disabled.
(cherry picked from commit b85f8afe3735eb77073481ffff2a4c972a6c3b21)

11 years agoAdd X9.42 DH test.
Dr. Stephen Henson [Fri, 2 Aug 2013 14:57:54 +0000 (15:57 +0100)]
Add X9.42 DH test.
(cherry picked from commit bbc098ffb3c0b09e0bbeca787e20efddc3242ec1)

11 years agoNew CMS tests.
Dr. Stephen Henson [Wed, 17 Jul 2013 17:20:29 +0000 (18:20 +0100)]
New CMS tests.

Add some ECDH CMS tests.
(cherry picked from commit 5cdc25a7545e44523b1f15418146bbda8eb03015)

11 years agoAdd X9.42 DH certificate to S/MIME test
Dr. Stephen Henson [Fri, 2 Aug 2013 14:51:46 +0000 (15:51 +0100)]
Add X9.42 DH certificate to S/MIME test
(cherry picked from commit 75787fd833a11798e09b027991aabc5b7dafa335)

11 years agoScripts to recreate S/MIME test certificates.
Dr. Stephen Henson [Wed, 17 Jul 2013 15:30:04 +0000 (16:30 +0100)]
Scripts to recreate S/MIME test certificates.

Add a script to generate keys and certificates for the S/MIME and CMS
tests.

Update certificates and add EC examples.
(cherry picked from commit a0957d55059f0b6052235737f7441fc35da41afd)

11 years agoCustom key wrap option for cms utility.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:21:31 +0000 (15:21 +0100)]
Custom key wrap option for cms utility.
(cherry picked from commit 5711885a2b31bfb623fb3738ce92a4cce4316bc7)

11 years agoadd cofactor ECDH support from fips branch
Dr. Stephen Henson [Sat, 10 Dec 2011 13:35:11 +0000 (13:35 +0000)]
add cofactor ECDH support from fips branch
(cherry picked from commit a3a2e3a43d13d8486c5e100e1bef7fec8e61b27b)

11 years agoFix compile errors.
Ben Laurie [Wed, 21 Aug 2013 03:21:42 +0000 (04:21 +0100)]
Fix compile errors.
(cherry picked from commit a0aaa5660a29f0faa86e5e51ce889299c5f3098b)

11 years agoCMS RFC2631 X9.42 DH enveloped data support.
Dr. Stephen Henson [Sat, 20 Jul 2013 20:31:10 +0000 (21:31 +0100)]
CMS RFC2631 X9.42 DH enveloped data support.
(cherry picked from commit bd59f2b91db8fab86e8610de4565b5ab8de2b44b)

Conflicts:

crypto/dh/dh.h
crypto/dh/dh_err.c

Sync error codes with 1.0.1.

11 years agoMinor optimisation to KDF algorithm.
Dr. Stephen Henson [Thu, 1 Aug 2013 14:48:44 +0000 (15:48 +0100)]
Minor optimisation to KDF algorithm.

Don't need to use temporary buffer if remaining length equals digest length.
(cherry picked from commit 3f6b6f0b8cbd7173b6c007b07caa6ec34cda08c5)

11 years agoAdd KDF for DH.
Dr. Stephen Henson [Tue, 30 Jul 2013 17:05:08 +0000 (18:05 +0100)]
Add KDF for DH.

Add X9.42 DH KDF. Move sharedinfo generation code to CMS library as the
same structure is used by DH and ECDH.

Move ASN1_OBJECT typedef to ossl_typ.h so it can be picked up by dh headers
without the need to use ASN1.
(cherry picked from commit dc1ce3bc64845d16314af1f11acf5384e4ae9b34)

11 years agoReturn correct enveloped data type in ASN1 methods.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:18:01 +0000 (15:18 +0100)]
Return correct enveloped data type in ASN1 methods.

For RSA and DSA keys return an appropriate RecipientInfo type. By setting
CMS_RECIPINFO_NONE for DSA keys an appropriate error is returned if
an attempt is made to use DSA with enveloped data.
(cherry picked from commit 41b920ef01abeb4c4b1c0f11e647370ae6533d02)

11 years agoAlgorithm parameter support.
Dr. Stephen Henson [Mon, 5 Aug 2013 14:40:50 +0000 (15:40 +0100)]
Algorithm parameter support.

Check and set AlgorithmIdenfier parameters for key wrap algorithms.
Currently these just set parameters to NULL.
(cherry picked from commit e61f5d55bc0072e75023be8971ae6e849643f466)

11 years agoAdd support for ECDH KARI.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:13:37 +0000 (15:13 +0100)]
Add support for ECDH KARI.

Add support for ECDH in enveloped data. The CMS ctrls for the EC ASN1
method decode/encode the appropriate parameters from the CMS ASN1 data
and send appropriate data to the EC public key method.
(cherry picked from commit 88e20b8584a78c803eca7aa9fcf8c46ff0ece4ae)

11 years agoAdd support for X9.62 KDF.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:01:08 +0000 (15:01 +0100)]
Add support for X9.62 KDF.

Add X9.62 KDF to EC EVP_PKEY_METHOD.
(cherry picked from commit 25af7a5dbc05c7359d1d7f472d50d65a9d876b7e)

11 years agoCMS support for key agreeement recipient info.
Dr. Stephen Henson [Wed, 17 Jul 2013 13:36:39 +0000 (14:36 +0100)]
CMS support for key agreeement recipient info.

Add hooks to support key agreement recipient info type (KARI) using
algorithm specific code in the relevant public key ASN1 method.
(cherry picked from commit 17c2764d2e6fc5a010ad3c12662068689ed2ad17)

11 years agoAdd new CMS tests.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:26:27 +0000 (18:26 +0100)]
Add new CMS tests.

Add new tests to cms-test.pl covering PSS and OAEP.
(cherry picked from commit 32b18e0338a326723680c7c347d3f04bf4e24b40)

11 years agoAdd -keyopt option to cms utility.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:24:00 +0000 (18:24 +0100)]
Add -keyopt option to cms utility.

Add support for custom public key parameters in the cms utility using
the -keyopt switch. Works for -sign and also -encrypt if -recip is used.
(cherry picked from commit 02498cc885b801f38f33c0a0d08d4603fd6350c7)

11 years agoUpdate cms docs.
Dr. Stephen Henson [Fri, 21 Jun 2013 22:24:25 +0000 (23:24 +0100)]
Update cms docs.

Document use of -keyopt to use RSA-PSS and RSA-OAEP modes.
(cherry picked from commit 4bf4a6501c6ca3fa1853f07c82e0e9cfe22dee45)

11 years agoCMS RSA-OAEP and RSA-PSS support.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:21:37 +0000 (18:21 +0100)]
CMS RSA-OAEP and RSA-PSS support.

Extend RSA ASN1 method to support CMS PSS signatures for both sign
and verify.

For signing the EVP_PKEY_CTX parameters are read and the appropriate
CMS structures set up.

For verification the CMS structures are analysed and the corresponding
parameters in the EVP_PKEY_CTX set.

Also add RSA-OAEP support.

For encrypt the EVP_PKEY_CTX parameters are used.

For decrypt the CMS structure is uses to set the appropriate EVP_PKEY_CTX
parameters.
(cherry picked from commit 0574cadf857b19485465b9d71b7dec9549857a4d)

Also sync error codes with OpenSSL 1.0.1 and add new ones.

11 years agoUpdate to OAEP support.
Dr. Stephen Henson [Thu, 20 Jun 2013 16:02:14 +0000 (17:02 +0100)]
Update to OAEP support.

Add OAEP ctrls to retrieve MD and label. Return errors if
an attempt is made to set or retrieve OAEP parameters when
padding mode is not OAEP.
(cherry picked from commit 211a14f6279f127f7a5a59948819bd939131b0b6)

11 years agoExetended OAEP support.
Dr. Stephen Henson [Tue, 21 May 2013 22:55:50 +0000 (23:55 +0100)]
Exetended OAEP support.

Extend OAEP support. Generalise the OAEP padding functions to support
arbitrary digests. Extend EVP_PKEY RSA method to handle the new OAEP
padding functions and add ctrls to set the additional parameters.
(cherry picked from commit 271fef0ef39a1c0cb5233a5adf3ff8733abb375e)

Conflicts:

CHANGES

11 years agoAdd FIPS RSA error code.
Dr. Stephen Henson [Fri, 20 Sep 2013 12:24:08 +0000 (13:24 +0100)]
Add FIPS RSA error code.

Add some RSA error codes used by the FIPS module.