Files
node/test/fixtures
David Benjamin 6ebdb69472 crypto: fix Node_SignFinal
PR #11705 switched Node away from using using OpenSSL's legacy EVP_Sign*
and EVP_Verify* APIs. Instead, it computes a hash normally via
EVP_Digest* and then uses EVP_PKEY_sign and EVP_PKEY_verify to verify
the hash directly. This change corrects two problems:

1. The documentation still recommends the signature algorithm EVP_MD
   names of OpenSSL's legacy APIs. OpenSSL has since moved away from
   thosee, which is why ECDSA was strangely inconsistent. (This is why
   "ecdsa-with-SHA256" was missing.)

2. Node_SignFinal copied some code from EVP_SignFinal's internals. This
   is problematic for OpenSSL 1.1.0 and is missing a critical check
   that prevents pkey->pkey.ptr from being cast to the wrong type.

To resolve this, remove the non-EVP_PKEY_sign codepath. This codepath is
no longer necessary. PR #11705's verify half was already assuming all
EVP_PKEYs supported EVP_PKEY_sign and EVP_PKEY_verify. Also, in the
documentation, point users towards using hash function names which are
more consisent. This avoids an ECDSA special-case and some strangeness
around RSA-PSS ("RSA-SHA256" is the OpenSSL name of the
sha256WithRSAEncryption OID which is not used for RSA-PSS).

PR-URL: https://github.com/nodejs/node/pull/15024
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-11 00:18:02 -03:00
..
2017-09-11 00:18:02 -03:00
2017-03-10 11:23:48 -08:00
2010-08-04 15:55:47 -07:00
2017-06-10 22:49:28 -04:00
2017-03-10 11:23:48 -08:00
2010-11-19 13:28:13 -08:00
2010-11-19 13:28:13 -08:00
2010-04-02 17:14:03 -07:00
2014-08-29 00:36:48 +04:00
2010-05-26 18:33:38 -07:00
2012-02-07 23:42:38 +01:00
2010-05-13 12:42:17 -07:00
2017-05-19 15:22:44 -04:00
2017-05-19 15:22:44 -04:00
2010-03-10 21:44:59 -08:00
2016-09-19 12:40:16 -07:00
2010-04-02 17:14:03 -07:00
2011-10-31 17:36:43 +09:00
2010-03-11 22:00:55 -08:00
2010-07-19 10:16:31 -07:00
2013-10-16 09:43:19 -07:00
2013-10-16 09:43:19 -07:00
2013-10-16 09:43:19 -07:00
2010-02-25 11:41:11 -08:00
2010-02-25 11:41:11 -08:00
2010-02-25 11:41:11 -08:00
2017-06-06 23:33:56 -07:00
2012-12-13 17:00:28 -08:00
2010-02-25 11:41:11 -08:00