summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_err.c
AgeCommit message (Collapse)Author
2016-12-10Check input length to pkey_rsa_verify()Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2065) (cherry picked from commit 71bbc79b7d3b1195a7a7dd5f547d52ddce32d6f0)
2016-11-07Implement RSASSA-PKCS1-v1_5 as specified.David Benjamin
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 (cherry picked from commit 608a026494c1e7a14f6d6cfcc5e4994fe2728836)
2016-07-20Check for errors allocating the error strings.Kurt Roeckx
Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #1330
2016-06-27RT4586: Remove RSA_memory_lock; unused, not neededRich Salz
Reviewed-by: Ben Laurie <ben@openssl.org>
2016-05-23Remove unused error/function codes.Rich Salz
Add script to find unused err/reason codes Remove unused reason codes. Remove entries for unused functions Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-18Add some error messages for malloc failsMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-17Manual fixes after copyright consolidationRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
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>
2015-11-17Rename RSA_eay_xxx to rsa_ossl_xxxRich Salz
Final part of flushing out SSLEay API's. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-05Rebuild error source files.Dr. Stephen Henson
Rebuild error source files: the new mkerr.pl functionality will now pick up and translate static function names properly. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-09-24RT3066: rewrite RSA padding checks to be slightly more constant time.Emilia Kasper
Also tweak s3_cbc.c to use new constant-time methods. Also fix memory leaks from internal errors in RSA_padding_check_PKCS1_OAEP_mgf1 This patch is based on the original RT submission by Adam Langley <agl@chromium.org>, as well as code from BoringSSL and OpenSSL. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2014-09-21crypto/rsa/rsa_chk.c: harmonize error codes.Andy Polyakov
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2013-06-21CMS RSA-OAEP and RSA-PSS support.Dr. Stephen Henson
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-12Exetended OAEP support.Dr. Stephen Henson
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.
2011-02-03Fix error codes.Bodo Möller
2011-01-26FIPS mode RSA changes:Dr. Stephen Henson
Check for selftest failures. Pairwise consistency test for RSA key generation. Use some EVP macros instead of EVP functions. Use minimal FIPS EVP where needed.
2010-03-11ctrl operations to retrieve RSA algorithm settingsDr. Stephen Henson
2010-03-08RSA PSS verification support including certificates and certificateDr. Stephen Henson
requests. Add new ASN1 signature initialisation function to handle this case.
2008-12-29If we're going to return errors (no matter how stupid), then we shouldBen Laurie
test for them!
2008-12-29Make sure a bad parameter to RSA_verify_PKCS1_PSS() doesn't lead to a crash.Ben Laurie
(Coverity ID 135).
2008-03-15Initial support for enveloped data decrypt. Extent runex.pl to cover theseDr. Stephen Henson
examples. All RFC4134 examples can not be processed.
2006-11-21Update from 0.9.8 stable. Eliminate duplicate error codes.Dr. Stephen Henson
2006-09-28Introduce limits to prevent malicious keys being able toBodo Möller
cause a denial of service. (CVE-2006-2940) [Steve Henson, Bodo Moeller]
2006-09-06Remove non-functional part of recent patch, after discussion withBodo Möller
Colin Percival (this would have caused more problems than solved, and isn't really necessary anyway)
2006-09-05Avoid PKCS #1 v1.5 signature attack discovered by Daniel BleichenbacherMark J. Cox
(CVE-2006-4339) Submitted by: Ben Laurie, Google Security Team Reviewed by: bmoeller, mjc, shenson
2006-07-17Fix various error codes to match functions.Dr. Stephen Henson
2006-05-11New functions to get key types without dereferncing EVP_PKEY.Dr. Stephen Henson
More error checking for RSA pmeth.
2006-04-12Initial DSA EVP_PKEY_METHOD. Fixup some error codes.Dr. Stephen Henson
2006-04-09Store digests as EVP_MD instead of a NID.Dr. Stephen Henson
Add digest size sanity checks.
2006-04-09Support for digest signing and X931 in rsa_pkey_meth.Dr. Stephen Henson
2006-03-20Initial support for pluggable public key ASN1 support. Process most publicDr. Stephen Henson
key ASN1 handling through a single EVP_PKEY_ASN1_METHOD structure and move the spaghetti algorithm specific code to a single ASN1 module for each algorithm.
2005-06-02PSS update [from 0.9.7].Andy Polyakov
2005-05-28Update from 0.9.7-stable. Also repatch and rebuild error codes.Dr. Stephen Henson
2005-05-11Fix more error codes.Bodo Möller
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
2005-04-26some updates for the blinding code; summary:Nils Larsch
- possibility of re-creation of the blinding parameters after a fixed number of uses (suggested by Bodo) - calculatition of the rsa::e in case it's absent and p and q are present (see bug report #785) - improve the performance when if one rsa structure is shared by more than a thread (see bug report #555) - fix the problem described in bug report #827 - hide the definition ot the BN_BLINDING structure in bn_blind.c
2005-04-12Rebuild error codes.Dr. Stephen Henson
2001-07-25always reject data >= nBodo Möller
2001-02-19Make all configuration macros available for application by makingRichard Levitte
sure they are available in opensslconf.h, by giving them names starting with "OPENSSL_" to avoid conflicts with other packages and by making sure e_os2.h will cover all platform-specific cases together with opensslconf.h. I've checked fairly well that nothing breaks with this (apart from external software that will adapt if they have used something like NO_KRB5), but I can't guarantee it completely, so a review of this change would be a good thing.
2000-03-05Preserve reason strings in automatically build tables.Bodo Möller
1999-09-18Add new sign and verify members to RSA_METHOD and change SSL code to use signDr. Stephen Henson
and verify rather than direct encrypt/decrypt.
1999-09-08Oops... forgot the other RSA_NULL patches...Dr. Stephen Henson
1999-07-12correct error handlingBodo Möller
insert spaces in products that occur in error codes
1999-07-11New function RSA_check_key,Bodo Möller
openssl rsa -check
1999-04-24Complete rewrite of the error code generation script. It now runs as a singleDr. Stephen Henson
script, translates function codes better and doesn't need the K&R function prototypes to work (NB. the K&R prototypes can't be wiped just yet: they are still needed by the DEF generator...). I also ran the script with the -rewrite option to update all the header and source files.
1999-04-23Change #include filenames from <foo.h> to <openssl.h>.Bodo Möller
Submitted by: Reviewed by: PR:
1999-04-19Change functions to ANSI C.Ulf Möller
1999-02-21Make RSA_NO_PADDING really use no padding.Dr. Stephen Henson
Submitted by: Ulf Moeller <ulf@fitug.de>
1999-02-18Fix case of new functions in error files.Ben Laurie
1999-02-17Add OAEP.Ben Laurie