Commit graph

6034 commits

Author SHA1 Message Date
Andy Polyakov
d24d1d7daf modes/asm/ghash-alpha.pl: make it work with older assembler.
PR: 3165
2013-11-08 22:56:44 +01:00
Dr. Stephen Henson
b0513fd2bb Initialise context before using it.
(cherry picked from commit a4947e4e06)
2013-11-06 13:19:13 +00:00
Ben Laurie
c10e3f0cff PBKDF2 should be efficient. Contributed by Christian Heimes
<christian@python.org>.
2013-11-03 17:23:50 +00:00
Robin Seggelmann
b814081136 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.
(cherry picked from commit f596e3c491)
2013-11-01 21:41:52 +00:00
Andy Polyakov
fb65e65e28 sha/asm/sha512-ppc.pl: fix typo.
Submitted by: Marcelo Cerri
2013-10-31 20:21:54 +01:00
Andy Polyakov
0e0a105364 perlas/ppc-xlate.pl: fix typo. 2013-10-31 11:58:50 +01:00
Andy Polyakov
c944f81703 aes/asm/aes-ppc.pl: add little-endian support.
Submitted by: Marcelo Cerri
2013-10-31 11:41:26 +01:00
Andy Polyakov
8ff8a829b0 perlasm/ppc-xlate.pl: add .quad directive
sha/asm/sha512-ppc.pl: add little-endian support.

Submitted by: Marcelo Cerri
2013-10-31 11:08:51 +01:00
Andy Polyakov
3f9562a669 sha/asm/sha1-ppc.pl: add little-endian support.
Submitted by: Marcelo Cerri
2013-10-31 11:07:38 +01:00
Andy Polyakov
4eeb750d20 bn/asm/x86_64-mont.pl: minor optimization [for Decoded ICache]. 2013-10-25 10:14:20 +02:00
Lubomir Rintel
ed77017b59 POD: Fix list termination
This fixes problems in POD list formatting: extra or missing =back
sequences.

doc/ssl/SSL_CTX_set1_curves.pod around line 90: =back without =over
doc/ssl/SSL_CTX_set1_verify_cert_store.pod around line 73: =back without =over
doc/ssl/SSL_CTX_add1_chain_cert.pod around line 82: =back without =over
doc/crypto/evp.pod around line 40: '=item' outside of any '=over'
crypto/des/des.pod around line 184: You forgot a '=back' before '=head1'

PR#3147
2013-10-22 07:38:25 +01:00
Dr. Stephen Henson
c051e521a7 Time value for various platforms.
The function gettimeofday() is not supported on all platforms. Use
more portable versions. Adapted from FIPS code.
2013-10-20 22:07:36 +01:00
Andy Polyakov
76c15d790e PPC assembly pack: make new .size directives profiler-friendly.
Suggested by: Anton Blanchard
2013-10-15 23:40:12 +02:00
Dr. Stephen Henson
579a759071 Fix warning. 2013-10-15 11:33:30 +01:00
Dr. Stephen Henson
da317b94d9 Add test vectors from RFC7027 2013-10-15 11:33:30 +01:00
Dr. Stephen Henson
7f5fd314c0 Sync OID numbers with 1.0.2 branch. 2013-10-15 11:33:30 +01:00
Andy Polyakov
d6019e1654 PPC assembly pack: add .size directives. 2013-10-15 00:14:39 +02:00
Andy Polyakov
30b9c2348d bn/asm/*x86_64*.pl: correct assembler requirement for ad*x. 2013-10-14 22:41:00 +02:00
Andy Polyakov
039081b809 Initial aarch64 bits. 2013-10-13 19:15:15 +02:00
Andy Polyakov
0c2adb0a9b 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.
2013-10-13 13:14:52 +02:00
Andy Polyakov
b4f0abd246 evp/e_aes_cbc_hmac_sha*.c: limit multi-block fragmentation to 1KB.
Excessive fragmentation put additional burden (of addtional MAC
calculations) on the other size and limiting fragments it to 1KB
limits the overhead to ~6%.
2013-10-12 22:10:28 +02:00
Andy Polyakov
7e1e3334f6 aes/asm/bsaes-x86_64.pl: fix Windows-specific bug in XTS.
PR: 3139
2013-10-12 21:37:55 +02:00
Andy Polyakov
fa104be35e bn/asm/rsax-avx2.pl: minor optimization [for Decoded ICache]. 2013-10-10 23:06:43 +02:00
Andy Polyakov
37de2b5c1e bn/bn_exp.c: prefer MULX/AD*X over AVX2. 2013-10-09 11:08:52 +02:00
Andy Polyakov
a69c0a1be5 evp/e_aes_cbc_hmac_sha*.c: harmonize names, fix bugs. 2013-10-08 23:39:26 +02:00
Andy Polyakov
b1de640f03 evp/evp.h: add multi-block contstants and parameter type. 2013-10-08 23:38:05 +02:00
Andy Polyakov
61ba602af5 sha/asm/sha*-mb-x86_64.pl: commentary update. 2013-10-08 23:36:55 +02:00
Ben Laurie
c45a48c186 Constification. 2013-10-07 12:45:26 +01:00
Andy Polyakov
6f6a613032 aes/asm/bsaes-*.pl: improve decrypt performance.
Improve decrypt performance by 10-20% depending on platform. Thanks
to Jussi Kivilinna for providing valuable hint. Also thanks to Ard
Biesheuvel.
2013-10-03 23:08:31 +02:00
Andy Polyakov
524b00c0da evp/e_des3.c: fix typo with potential integer overflow on 32-bit platforms.
Submitted by: Yuriy Kaminskiy
2013-10-03 10:55:49 +02:00
Andy Polyakov
6b2cae0c16 perlasm/sparcv9_modes.pl: make it work even with seasoned perl.
PR: 3130
2013-10-03 10:42:11 +02:00
Andy Polyakov
a5bb5bca52 bn/asm/x86_64-mont*.pl: add MULX/ADCX/ADOX code path. 2013-10-03 00:45:04 +02:00
Andy Polyakov
87954638a6 rsaz-x86_64.pl: add MULX/ADCX/ADOX code path. 2013-10-03 00:30:12 +02:00
Andy Polyakov
667053a2f3 x86_64-xlate.pl: fix jrcxz in nasm case. 2013-10-03 00:26:09 +02:00
Andy Polyakov
7f893258f6 evp/e_aes_cbc_hmac_sha*.c: multi-block glue code. 2013-10-03 00:24:03 +02:00
Andy Polyakov
6bcb68da41 Configire: take multi-block modules into build loop. 2013-10-03 00:21:10 +02:00
Andy Polyakov
b783858654 x86_64 assembly pack: add multi-block AES-NI, SHA1 and SHA256. 2013-10-03 00:18:58 +02:00
Andy Polyakov
5f487e0317 evp/e_aes_cbc_hmac_sha256.c: enable is on all AES-NI platforms, not only on AVX. 2013-10-03 00:16:51 +02:00
Andy Polyakov
066caf0551 aes/asm/*-armv*.pl: compensate for inconsistencies in tool-chains.
Suggested by: Ard Biesheuvel
2013-10-01 20:33:06 +02:00
Ben Laurie
3cd8547a20 Mix time into the pool to avoid repetition of the Android duplicated PID problem. 2013-09-20 16:52:07 +01:00
Ben Laurie
79b9209883 More diagnostics for invalid OIDs. 2013-09-20 14:38:36 +01:00
Andy Polyakov
e0202d946d aes-armv4.pl, bsaes-armv7.pl: add Linux kernel and Thumb2 support.
Submitted by: Ard Biesheuvel
2013-09-20 13:22:57 +02:00
Dr. Stephen Henson
94c2f77a62 Add functions to set ECDSA_METHOD structure.
Add various functions to allocate and set the fields of an ECDSA_METHOD
structure.
2013-09-18 01:22:50 +01:00
Bodo Moeller
ca567a03ad Fix overly lenient comparisons:
- EC_GROUP_cmp shouldn't consider curves equal just because
      the curve name is the same. (They really *should* be the same
      in this case, but there's an EC_GROUP_set_curve_name API,
      which could be misused.)

    - EC_POINT_cmp shouldn't return 0 for ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED
      or EC_R_INCOMPATIBLE_OBJECTS errors because in a cmp API, 0 indicates
      equality (not an error).

    Reported by: king cope
2013-09-16 12:59:21 +02:00
Andy Polyakov
8e52a9063a crypto/armcap.c: fix typo in rdtsc subroutine.
PR: 3125
Submitted by: Kyle McMartin
2013-09-15 22:07:49 +02:00
Andy Polyakov
612f4e2384 bsaes-armv7.pl: remove partial register operations in CTR subroutine. 2013-09-15 19:47:51 +02:00
Andy Polyakov
29f41e8a80 bsaes-armv7.pl: remove byte order dependency and minor optimization. 2013-09-15 19:44:43 +02:00
Ard Biesheuvel
a2ea9f3ecc Added support for ARM/NEON based bit sliced AES in XTS mode
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2013-09-15 19:37:16 +02:00
Ben Laurie
edf92f1c41 Constification. 2013-09-10 18:04:08 +01:00
Andy Polyakov
7a1a12232a crypto/modes/asm/aesni-gcm-x86_64.pl: minor optimization.
Avoid occasional up to 8% performance drops.
2013-09-09 21:43:21 +02:00
Andy Polyakov
72a158703b crypto/bn/asm/x86_64-mont.pl: minor optimization. 2013-09-09 21:40:33 +02:00
Dr. Stephen Henson
52073b7675 Partial path fix.
When verifying a partial path always check to see if the EE certificate
is explicitly trusted: the path could contain other untrusted certificates.
2013-09-08 19:26:59 +01:00
Scott Deboy
36086186a9 Add callbacks supporting generation and retrieval of supplemental data entries, facilitating RFC 5878 (TLS auth extensions)
Removed prior audit proof logic - audit proof support was implemented using the generic TLS extension API
Tests exercising the new supplemental data registration and callback api can be found in ssltest.c.
Implemented changes to s_server and s_client to exercise supplemental data callbacks via the -auth argument, as well as additional flags to exercise supplemental data being sent only during renegotiation.
2013-09-06 13:59:13 +01:00
Veres Lajos
478b50cf67 misspellings fixes by https://github.com/vlajos/misspell_fixer 2013-09-05 21:39:42 +01:00
Ben Laurie
a0aaa5660a Fix compile errors. 2013-08-21 04:21:42 +01:00
Dr. Stephen Henson
14536c8c9c Make no-ec compilation work. 2013-08-17 17:41:13 +01:00
Kaspar Brand
5ae8d6bcba Fix for PEM_X509_INFO_read_bio.
PR: 3028
Fix bug introduced in PEM_X509_INFO_bio which wouldn't process RSA keys
correctly if they appeared first.
2013-08-06 16:01:47 +01:00
Dr. Stephen Henson
bd59f2b91d CMS RFC2631 X9.42 DH enveloped data support. 2013-08-05 16:23:13 +01:00
Dr. Stephen Henson
dc1ce3bc64 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.
2013-08-05 15:45:01 +01:00
Dr. Stephen Henson
3909087801 Extend DH parameter generation support.
Add support for DH parameter generation using DSA methods including
FIPS 186-3.
2013-08-05 15:45:01 +01:00
Dr. Stephen Henson
d3cc91eee2 Enhance DH dup functions.
Make DHparams_dup work properly with X9.42 DH parameters.
2013-08-05 15:45:01 +01:00
Dr. Stephen Henson
c9577ab5ea If present print j, seed and counter values for DH 2013-08-05 15:45:00 +01:00
Dr. Stephen Henson
3f6b6f0b8c Minor optimisation to KDF algorithm.
Don't need to use temporary buffer if remaining length equals digest length.
2013-08-05 15:45:00 +01:00
Dr. Stephen Henson
e61f5d55bc Algorithm parameter support.
Check and set AlgorithmIdenfier parameters for key wrap algorithms.
Currently these just set parameters to NULL.
2013-08-05 15:45:00 +01:00
Andy Polyakov
a59f436295 crypto/evp/e_aes.c: fix logical pre-processor bug and formatting.
Bug would emerge when XTS is added to bsaes-armv7.pl. Pointed out by
Ard Biesheuvel of Linaro.
2013-08-03 17:09:06 +02:00
Andy Polyakov
fd8ad019e1 crypto/bn/asm/rsax-x86_64.pl: make it work on Darwin. 2013-08-03 16:28:50 +02:00
Andy Polyakov
006784378d crypto/sha/asm/sha*-x86_64.pl: comply with Win64 ABI. 2013-07-31 23:50:15 +02:00
Dr. Stephen Henson
584ac22110 Make ecdsatest work with nonces.
Update ecdsatest to use ECDSA_sign_setup and ECDSA_sign_ex, this
avoids the nonce generation which would otherwise break the test.

Reinstate ecdsatest.
2013-07-19 14:11:43 +01:00
Dr. Stephen Henson
41b920ef01 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.
2013-07-17 21:45:01 +01:00
Dr. Stephen Henson
88e20b8584 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.
2013-07-17 21:45:01 +01:00
Dr. Stephen Henson
25af7a5dbc Add support for X9.62 KDF.
Add X9.62 KDF to EC EVP_PKEY_METHOD.
2013-07-17 21:45:00 +01:00
Dr. Stephen Henson
6af440ced4 Add new OIDs from RFC5753
Add OIDs for KDF schemes from RFC5753 and add cross references for
each type and the appropriate digest to use.
2013-07-17 21:45:00 +01:00
Dr. Stephen Henson
17c2764d2e 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.
2013-07-17 21:45:00 +01:00
Dr. Stephen Henson
ff7b6ce9db Set CMS EnvelopedData version correctly. 2013-07-17 21:45:00 +01:00
Dr. Stephen Henson
97cf1f6c28 EVP support for wrapping algorithms.
Add support for key wrap algorithms via EVP interface.

Generalise AES wrap algorithm and add to modes, making existing
AES wrap algorithm a special case.

Move test code to evptests.txt
2013-07-17 21:45:00 +01:00
Dr. Stephen Henson
415ece7301 Typo. 2013-07-17 21:45:00 +01:00
Dr. Stephen Henson
8d6a75dc3a Avoid need to change function code.
Keep original function names for nonce versions so we don't have to change
error function codes.
2013-07-17 21:45:00 +01:00
Adam Langley
190c615d43 Make `safe' (EC)DSA nonces the default.
This change updates 8a99cb29 to make the generation of (EC)DSA nonces
using the message digest the default. It also reverts the changes to
(EC)DSA_METHOD structure.

In addition to making it the default, removing the flag from EC_KEY
means that FIPS modules will no longer have an ABI mismatch.
2013-07-15 12:57:48 +01:00
Andy Polyakov
5c57c69f9e bn/asm/rsaz-avx2.pl: Windows-specific fix. 2013-07-12 18:59:17 +02:00
Dr. Stephen Henson
4b26645c1a Fix verify loop with CRL checking.
PR #3090
Reported by: Franck Youssef <fry@open.ch>

If no new reason codes are obtained after checking a CRL exit with an
error to avoid repeatedly checking the same CRL.

This will only happen if verify errors such as invalid CRL scope are
overridden in a callback.
2013-07-12 17:48:41 +01:00
Ben Laurie
852f837f5e s/rsaz_eligible/rsaz_avx2_eligible/. 2013-07-12 12:47:39 +01:00
Andy Polyakov
241fba4ea9 sha512-586.pl: fix typo.
Submitted by: Gisle Vanem
2013-07-10 09:59:25 +02:00
Andy Polyakov
f5b132d652 Remove RSAX engine, superseded by RSAZ module. 2013-07-05 22:11:28 +02:00
Andy Polyakov
ca48ace5c5 Take RSAZ modules into build loop, add glue and engage.
RT: 2582, 2850
2013-07-05 21:39:47 +02:00
Andy Polyakov
0b4bb91db6 Add RSAZ assembly modules.
RT: 2582, 2850
2013-07-05 21:30:18 +02:00
Andy Polyakov
26e43b48a3 bn/asm/x86_86-mont.pl: optimize reduction for Intel Core family. 2013-07-05 21:10:56 +02:00
Andy Polyakov
cbce8c4644 bn/bn_exp.c: harmonize. 2013-07-05 20:52:58 +02:00
Dr. Stephen Henson
e0f7cfda68 Initialise CMS signature buffer length properly. 2013-07-02 22:12:19 +01:00
Andy Polyakov
b74ce8d948 bn/bn_exp.c: Solaris-specific fix, T4 MONTMUL relies on alloca. 2013-06-30 23:09:09 +02:00
Andy Polyakov
a9d14832fd x86_64-xlate.pl: Windows fixes. 2013-06-30 23:07:33 +02:00
Andy Polyakov
42386fdb62 aesni-sha256-x86_64.pl: fix typo in Windows SEH. 2013-06-30 23:06:28 +02:00
Dr. Stephen Henson
0574cadf85 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.
2013-06-21 23:43:05 +01:00
Dr. Stephen Henson
e365352d6a CMS public key parameter support.
Add support for customisation of CMS handling of signed and enveloped
data from custom public key parameters.

This will provide support for RSA-PSS and RSA-OAEP but could also be
applied to other algorithms.
2013-06-21 21:33:00 +01:00
Dr. Stephen Henson
211a14f627 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.
2013-06-21 21:33:00 +01:00
Dr. Stephen Henson
810639536c Add control to retrieve signature MD. 2013-06-21 21:33:00 +01:00
Dr. Stephen Henson
e423c360fd Add new OID to pSpecified from PKCS#1 2013-06-21 21:33:00 +01:00
Andy Polyakov
8ee3c7e676 SPARC T4 DES support: fix typo. 2013-06-18 10:42:08 +02:00
Andy Polyakov
4ddacd9921 Optimize SPARC T4 MONTMUL support.
Improve RSA sing performance by 20-30% by:
- switching from floating-point to integer conditional moves;
- daisy-chaining sqr-sqr-sqr-sqr-sqr-mul sequences;
- using MONTMUL even during powers table setup;
2013-06-18 10:39:38 +02:00
Andy Polyakov
02450ec69d PA-RISC assembler pack: switch to bve in 64-bit builds.
PR: 3074
2013-06-18 10:37:00 +02:00
Adam Langley
8a99cb29d1 Add secure DSA nonce flag.
This change adds the option to calculate (EC)DSA nonces by hashing the
message and private key along with entropy to avoid leaking the private
key if the PRNG fails.
2013-06-13 17:26:07 +01:00