aboutsummaryrefslogtreecommitdiffstats
path: root/include/openssl/rsa.h
Commit message (Collapse)AuthorAgeFilesLines
* Add parentheses on public macros where appropriate.Bernd Edlinger2017-04-271-19/+19
| | | | | | | Fixes #3063. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3100)
* Make default_method mostly compile-time (cont'd)Rich Salz2017-04-071-5/+5
| | | | | | | Forgot to include this commit as requested by review. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2244)
* Make default_method mostly compile-timeRich Salz2017-04-071-7/+6
| | | | | | | | Document thread-safety issues Have RSA_null return NULL (always fails) Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2244)
* Defines and strings for special salt length values, add testsDr. Stephen Henson2017-01-181-0/+8
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2236)
* Add support for -1, -2 salt lengths for PSS only keys.Dr. Stephen Henson2017-01-181-0/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2236)
* fix typo and remove duplicate macroDr. Stephen Henson2017-01-081-7/+3
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* make errorsDr. Stephen Henson2017-01-081-0/+1
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Only allow PSS padding for PSS keys.Dr. Stephen Henson2017-01-081-0/+1
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Initial parameter restrictions.Dr. Stephen Henson2017-01-081-0/+3
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Add rsa_pss_get_param.Dr. Stephen Henson2017-01-081-0/+1
| | | | | | | New function rsa_pss_get_param to extract and sanity check PSS parameters. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Support pad mode get/set for PSS keys.Dr. Stephen Henson2017-01-081-4/+2
| | | | | | | Pad mode setting returns an error if the mode is anything other then PSS. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Key gen param support.Dr. Stephen Henson2017-01-081-0/+17
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Support RSA operations in PSS.Dr. Stephen Henson2017-01-081-18/+14
| | | | | | | | | Add support for common operations in PSS by adding a new function RSA_pkey_ctx_ctrl() which calls EVP_PKEY_CTX_ctrl if the key type is RSA or PSS. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* PSS parameter encode and decode.Dr. Stephen Henson2017-01-081-0/+1
| | | | | | | | For RSA PSS keys encode and decode parameters when handling public and private keys. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Cache maskHash parameterDr. Stephen Henson2017-01-081-0/+4
| | | | | | | | | Store hash algorithm used for MGF1 masks in PSS and OAEP modes in PSS and OAEP parameter structure: this avoids the need to decode part of the ASN.1 structure every time it is used. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
* Check input length to pkey_rsa_verify()Dr. Stephen Henson2016-12-091-0/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2065)
* Implement RSASSA-PKCS1-v1_5 as specified.David Benjamin2016-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 3447, section 8.2.2, steps 3 and 4 states that verifiers must encode the DigestInfo struct and then compare the result against the public key operation result. This implies that one and only one encoding is legal. OpenSSL instead parses with crypto/asn1, then checks that the encoding round-trips, and allows some variations for the parameter. Sufficient laxness in this area can allow signature forgeries, as described in https://www.imperialviolet.org/2014/09/26/pkcs1.html Although there aren't known attacks against OpenSSL's current scheme, this change makes OpenSSL implement the algorithm as specified. This avoids the uncertainty and, more importantly, helps grow a healthy ecosystem. Laxness beyond the spec, particularly in implementations which enjoy wide use, risks harm to the ecosystem for all. A signature producer which only tests against OpenSSL may not notice bugs and accidentally become widely deployed. Thus implementations have a responsibility to honor the specification as tightly as is practical. In some cases, the damage is permanent and the spec deviation and security risk becomes a tax all implementors must forever pay, but not here. Both BoringSSL and Go successfully implemented and deployed RSASSA-PKCS1-v1_5 as specified since their respective beginnings, so this change should be compatible enough to pin down in future OpenSSL releases. See also https://tools.ietf.org/html/draft-thomson-postel-was-wrong-00 As a bonus, by not having to deal with sign/verify differences, this version is also somewhat clearer. It also more consistently enforces digest lengths in the verify_recover codepath. The NID_md5_sha1 codepath wasn't quite doing this right. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1474
* Check for errors allocating the error strings.Kurt Roeckx2016-07-201-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #1330
* rsa/rsa_lib.c: const-ify RSA_get0_engine().Andy Polyakov2016-06-271-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* RT4586: Remove RSA_memory_lock; unused, not neededRich Salz2016-06-271-4/+0
| | | | Reviewed-by: Ben Laurie <ben@openssl.org>
* Constify the parameter getters for RSA, DSA and DHRichard Levitte2016-06-151-3/+5
| | | | | | | Including documentation changes Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Deprecate the flags that switch off constant timeMatt Caswell2016-06-061-10/+4
| | | | | | | | | The flags RSA_FLAG_NO_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME and DH_FLAG_NO_EXP_CONSTTIME which previously provided the ability to switch off the constant time implementation for RSA, DSA and DH have been made no-ops and deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove unused error/function codes.Rich Salz2016-05-231-14/+3
| | | | | | | | Add script to find unused err/reason codes Remove unused reason codes. Remove entries for unused functions Reviewed-by: Matt Caswell <matt@openssl.org>
* Add some error messages for malloc failsMatt Caswell2016-05-181-4/+7
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation 03/10Rich Salz2016-05-171-54/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make the RSA_METHOD structure opaqueRichard Levitte2016-04-061-45/+82
| | | | | | | | | Move rsa_meth_st away from public headers. Add RSA_METHOD creator/destructor functions. Add RSA_METHOD accessor/writer functions. Adapt all other source to use the creator, destructor, accessors and writers. Reviewed-by: Matt Caswell <matt@openssl.org>
* Make the RSA structure opaqueRichard Levitte2016-04-061-36/+13
| | | | | | | | Move rsa_st away from public headers. Add accessor/writer functions for the public RSA data. Adapt all other source to use the accessors and writers. Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove #error from include files.Rich Salz2016-03-201-14/+8
| | | | | | | | Don't have #error statements in header files, but instead wrap the contents of that file in #ifndef OPENSSL_NO_xxx This means it is now always safe to include the header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Convert CRYPTO_LOCK_{DH,DSA,RSA} to new multi-threading APIAlessandro Ghedini2016-03-081-0/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Backwards-compatibility subject to OPENSSL_API_COMPATViktor Dukhovni2016-01-071-7/+6
| | | | | | | | | Provide backwards-compatiblity for functions, macros and include files if OPENSSL_API_COMPAT is either not defined or defined less than the version number of the release in which the feature was deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove RSA_FLAG_SIGN_VER flag.Dr. Stephen Henson2015-12-021-9/+1
| | | | | | | | Remove RSA_FLAG_SIGN_VER: this was origininally used to retain binary compatibility after RSA_METHOD was extended to include rsa_sign and rsa_verify fields. It is no longer needed. Reviewed-by: Richard Levitte <levitte@openssl.org>
* ex_data part 2: doc fixes and CRYPTO_free_ex_index.Rich Salz2015-12-011-2/+2
| | | | | | | | | | Add CRYPTO_free_ex_index (for shared libraries) Unify and complete the documentation for all "ex_data" API's and objects. Replace xxx_get_ex_new_index functions with a macro. Added an exdata test. Renamed the ex_data internal datatypes. Reviewed-by: Matt Caswell <matt@openssl.org>
* Rename RSA_eay_xxx to rsa_ossl_xxxRich Salz2015-11-171-4/+4
| | | | | | Final part of flushing out SSLEay API's. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Replace "SSLeay" in API with OpenSSLRich Salz2015-10-301-2/+2
| | | | | | | All instances of SSLeay (any combination of case) were replaced with the case-equivalent OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Move EVP_PKEY_METHOD into private headers.Dr. Stephen Henson2015-09-201-2/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Enable -Wmissing-variable-declarations andBen Laurie2015-09-111-0/+2
| | | | | | | -Wincompatible-pointer-types-discards-qualifiers (the latter did not require any code changes). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove obsolete key formats.Rich Salz2015-07-161-16/+0
| | | | | | | | Remove support for RSA_NET and Netscape key format (-keyform n). Also removed documentation of SGC. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Properly check certificate in case of export ciphers.Kurt Roeckx2015-06-091-0/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> MR #588
* Stop symlinking, move files to intended directoryRichard Levitte2015-03-311-0/+668
Rather than making include/openssl/foo.h a symlink to crypto/foo/foo.h, this change moves the file to include/openssl/foo.h once and for all. Likewise, move crypto/foo/footest.c to test/footest.c, instead of symlinking it there. Originally-by: Geoff Thorpe <geoff@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>