Commit graph

5510 commits

Author SHA1 Message Date
Andy Polyakov
ca44f72938 Make Makefiles OSF-make-friendly.
PR: 3165
(cherry picked from commit d1cf23ac86)
2013-11-12 21:53:39 +01:00
Dr. Stephen Henson
18f49508a5 Fix memory leak.
(cherry picked from commit 16bc45ba95)
2013-11-11 23:55:18 +00:00
Dr. Stephen Henson
a257865303 Fix for some platforms where "char" is unsigned.
(cherry picked from commit 08b433540416c5bc9a874ba0343e35ba490c65f1)
2013-11-11 22:18:07 +00:00
Dr. Stephen Henson
b5dde6bcc6 Check for missing components in RSA_check.
(cherry picked from commit 01be36ef70525e81fc358d2e559bdd0a0d9427a5)
2013-11-09 15:09:22 +00:00
Dr. Stephen Henson
233069f8db 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)
2013-11-09 15:09:22 +00:00
Andy Polyakov
3241496144 modes/asm/ghash-alpha.pl: make it work with older assembler.
PR: 3165
(cherry picked from commit d24d1d7daf)
2013-11-08 23:10:09 +01:00
Dr. Stephen Henson
a4947e4e06 Initialise context before using it. 2013-11-06 13:16:50 +00:00
Ben Laurie
262f1c524e PBKDF2 should be efficient. Contributed by Christian Heimes
<christian@python.org>.
2013-11-03 17:27:12 +00:00
Robin Seggelmann
f596e3c491 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.
2013-10-30 14:37:22 +00:00
Andy Polyakov
e41a49c625 PPC assembly pack: make new .size directives profiler-friendly.
Suggested by: Anton Blanchard
(cherry picked from commit 76c15d790e)
2013-10-15 23:42:18 +02:00
Dr. Stephen Henson
72550c52ed Fix warning.
(cherry picked from commit f6983769c1bcd6c3c6b6bbfbbc41848f6dccf127)
2013-10-15 11:33:58 +01:00
Dr. Stephen Henson
a9d0c56de1 Add test vectors from RFC7027
(cherry picked from commit 8ba2d4ed7f128e400693562efd35985068c45e4d)
2013-10-15 11:33:58 +01:00
Andy Polyakov
43ce9cdde9 PPC assembly pack: update from master branch.
Includes multiple updates: AES module to comply with more ABI
flavors, SHA512 for PPC32, .size directives.
2013-10-15 00:31:45 +02:00
Andy Polyakov
958608ca1c Initial aarch64 bits.
(cherry picked from commit 039081b809)
2013-10-13 19:24:22 +02:00
Andy Polyakov
1aecb23f5b 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 0c2adb0a9b)
2013-10-13 13:18:21 +02:00
Andy Polyakov
9ed6fba2b4 aes/asm/bsaes-x86_64.pl: update from master.
Performance improvement and Windows-specific bugfix (PR#3139).
2013-10-12 21:47:54 +02:00
Andy Polyakov
df5c435c0b bn/asm/rsax-avx2.pl: minor optimization [for Decoded ICache].
(cherry picked from commit fa104be35e)
2013-10-10 23:09:54 +02:00
Ben Laurie
1ebaf97c44 Constification. 2013-10-07 12:44:40 +01:00
Andy Polyakov
c99028f252 evp/e_des3.c: fix typo with potential integer overflow on 32-bit platforms.
Submitted by: Yuriy Kaminskiy
(cherry picked from commit 524b00c0da)
2013-10-05 21:09:50 +01:00
Andy Polyakov
90d8c5862b perlasm/sparcv9_modes.pl: make it work even with seasoned perl.
PR: 3130
(cherry picked from commit 6b2cae0c16)
2013-10-05 21:09:39 +01:00
Ben Laurie
7a216dfee5 Constification. 2013-10-01 14:51:04 +01:00
Dr. Stephen Henson
3e792793f6 add cofactor ECDH support from fips branch
(cherry picked from commit a3a2e3a43d)
2013-10-01 14:01:18 +01:00
Ben Laurie
ac5cb33356 Fix compile errors.
(cherry picked from commit a0aaa5660a)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
aaf74259ec CMS RFC2631 X9.42 DH enveloped data support.
(cherry picked from commit bd59f2b91d)

Conflicts:

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

Sync error codes with 1.0.1.
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
ecf9ceb90d Minor optimisation to KDF algorithm.
Don't need to use temporary buffer if remaining length equals digest length.
(cherry picked from commit 3f6b6f0b8c)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
5c4ff8ad37 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 dc1ce3bc64)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
dc427fc8e2 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 41b920ef01)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
e1e6c4dae7 Algorithm parameter support.
Check and set AlgorithmIdenfier parameters for key wrap algorithms.
Currently these just set parameters to NULL.
(cherry picked from commit e61f5d55bc)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
1747fd1cc6 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 88e20b8584)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
a119822b90 Add support for X9.62 KDF.
Add X9.62 KDF to EC EVP_PKEY_METHOD.
(cherry picked from commit 25af7a5dbc)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
8c798690ce 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 17c2764d2e)
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
af7d6b936b 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 0574cadf85)

Also sync error codes with OpenSSL 1.0.1 and add new ones.
2013-10-01 14:01:18 +01:00
Dr. Stephen Henson
a64b8786b5 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 211a14f627)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
25f93585a7 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 271fef0ef3)

Conflicts:

	CHANGES
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
0d5a49e150 Add FIPS RSA error code.
Add some RSA error codes used by the FIPS module.
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
5c49a98c5e Set CMS EnvelopedData version correctly.
(cherry picked from commit ff7b6ce9db)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
869772ff08 Initialise CMS signature buffer length properly.
(cherry picked from commit e0f7cfda68)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
f2edf3181e 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.
(cherry picked from commit e365352d6a)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
d6dc5c506a Add control to retrieve signature MD.
(cherry picked from commit 810639536c)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
eebd5e5dd7 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.
(cherry picked from commit 6af440ced4)

Conflicts:

	crypto/objects/obj_dat.h
	crypto/objects/obj_mac.num
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
868b266451 Add new OID to pSpecified from PKCS#1
(cherry picked from commit e423c360fd)

Conflicts:

	crypto/objects/obj_dat.h
	crypto/objects/obj_mac.num
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
3fa23ff0f1 Add FIPS 186-2 DSA parameter generation algorithm.
Backport support for FIPS 186-2 DSA parameter generation from
HEAD. Redirect to FIPS in FIPS mode and workaround prototype error.
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
c275fb091e Extend DH parameter generation support.
Add support for DH parameter generation using DSA methods including
FIPS 186-3.
(cherry picked from commit 3909087801)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
90c341c601 Enhance DH dup functions.
Make DHparams_dup work properly with X9.42 DH parameters.
(cherry picked from commit d3cc91eee2)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
52d0e1ca4e If present print j, seed and counter values for DH
(cherry picked from commit c9577ab5ea)

Conflicts:

	crypto/dh/dh_ameth.c
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
c6f3386577 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
(cherry picked from commit 97cf1f6c28)

Conflicts:

	CHANGES
2013-10-01 14:01:17 +01:00
Andy Polyakov
cf65a07256 evptests.txt: add XTS test vectors
(cherry picked from commit c9a8e3d1c7)
2013-10-01 14:01:17 +01:00
Andy Polyakov
051dc9db2b evptests.txt: additional GCM test vectors.
(cherry picked from commit ca303d333b)
2013-10-01 14:01:17 +01:00
Ben Laurie
93a886b45a Fix warnings.
(cherry picked from commit 282a480a35)
2013-10-01 14:01:17 +01:00
Dr. Stephen Henson
ec19082ecc GCM and CCM test support
Add code to support GCM an CCM modes in evp_test. On encrypt this
will compare the expected ciphertext and tag. On decrypt it will
compare the expected plaintext: tag comparison is done internally.

Add a simple CCM test case and convert all tests from crypto/modes/gcm128.c
(cherry picked from commit 15652f9825)
2013-10-01 14:01:17 +01:00