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
2017-03-10 11:23:48 -08:00
2016-08-29 18:53:29 -07:00
2017-03-10 11:23:48 -08:00
2010-08-04 15:55:47 -07:00
2017-09-07 15:18:32 -05:00
2017-09-07 15:18:32 -05:00
2017-07-24 16:56:31 +02:00
2017-03-10 11:23:48 -08:00
2015-03-25 22:12:18 +03:00
2017-03-10 11:23:48 -08:00
2017-09-07 21:48:46 -03:00
2017-03-10 11:23:48 -08:00
2017-01-02 18:28:18 -05:00
2016-01-12 12:35:11 -08:00
2017-08-27 21:14:34 -03:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-08-13 01:03:30 -07:00
2014-12-11 10:18:00 +01:00
2015-10-29 13:08:32 -05:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-03-11 22:08:18 +00:00
2017-06-10 22:49:28 -04:00
2017-04-20 13:18:42 +02:00
2015-12-22 13:29:28 -05:00
2015-08-04 11:56:18 -07: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
2011-08-31 03:47:23 +09:00
2016-03-29 21:39:26 +02:00
2013-02-26 16:49:17 -08:00
2016-05-12 20:23:18 -07:00
2017-03-10 11:23:48 -08:00
2010-04-02 17:14:03 -07:00
2017-03-10 11:23:48 -08:00
2012-08-30 16:13:27 +02:00
2015-05-19 21:21:27 +02:00
2017-01-02 18:28:18 -05:00
2017-01-02 18:28:18 -05:00
2017-01-10 16:57:48 -05:00
2017-03-10 11:23:48 -08:00
2016-09-11 21:06:10 -07:00
2016-04-14 10:53:07 -07:00
2016-02-05 15:40:56 -08:00
2016-01-18 10:57:45 -06:00
2016-08-17 18:27:22 -07:00
2015-07-03 16:32:29 +02:00
2016-08-04 11:44:40 -04:00
2015-10-19 20:52:56 +02:00
2011-12-06 22:02:26 +01:00
2014-08-29 00:36:48 +04:00
2016-05-26 00:49:34 +02:00
2016-05-26 00:49:34 +02:00
2016-05-26 00:49:34 +02:00
2017-02-24 02:43:25 +01:00
2017-06-09 13:57:24 -04:00
2017-03-10 11:23:48 -08: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-03-10 11:23:48 -08:00
2015-12-16 10:08:43 -05:00
2017-05-19 15:22:44 -04:00
2017-05-19 15:22:44 -04:00
2016-07-27 13:56:55 +02:00
2016-07-27 13:56:55 +02:00
2010-03-10 21:44:59 -08:00
2011-09-03 00:49:37 +09:00
2011-09-03 00:49:37 +09:00
2010-07-20 10:26:24 -07:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2015-10-17 11:53:45 -04:00
2017-07-11 17:47:37 +01:00
2012-07-06 15:26:41 -07:00
2016-07-20 13:01:42 -04:00
2016-09-19 12:40:16 -07:00
2012-03-06 01:34:39 +01:00
2010-04-02 17:14:03 -07:00
2012-03-10 23:43:16 +09:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-06-30 19:21:23 +02:00
2017-06-30 19:21:23 +02:00
2015-08-04 11:56:18 -07:00
2016-02-25 15:06:41 -05:00
2016-02-25 15:06:41 -05:00
2016-04-29 00:45:49 +02:00
2017-01-02 18:28:18 -05:00
2011-11-27 02:05:24 +09:00
2011-10-31 17:36:43 +09:00
2015-11-13 10:22:42 -08:00
2017-01-02 18:28:18 -05:00
2017-03-10 11:23:48 -08:00
2016-03-21 23:20:43 -07:00
2016-03-21 23:20:43 -07:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2015-03-19 21:42:16 +11:00
2015-03-19 21:42:16 +11:00
2015-03-19 21:42:16 +11:00
2016-03-23 13:04:19 -04:00
2016-03-23 13:04:19 -04:00
2017-04-01 13:27:52 +02:00
2016-12-12 08:15:58 -08:00
2017-03-10 11:23:48 -08:00
2010-03-11 22:00:55 -08:00
2010-09-22 10:13:25 -07:00
2010-03-11 22:00:55 -08:00
2017-09-01 10:33:15 -04:00
2016-04-29 00:45:49 +02:00
2010-07-19 10:16:31 -07:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-03-20 20:48:14 +01: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
2015-08-17 21:38:12 -07:00
2010-02-25 11:41:11 -08:00
2010-02-25 11:41:11 -08:00
2015-11-13 10:22:42 -08:00
2011-11-22 16:01:07 +01:00
2015-11-13 10:22:42 -08:00
2015-11-13 10:22:42 -08:00
2015-11-13 10:22:42 -08:00
2010-02-25 11:41:11 -08:00
2011-11-17 23:01:39 +01:00
2015-11-13 10:22:42 -08:00
2011-06-14 12:50:00 +02:00
2011-11-17 23:01:39 +01:00
2011-06-14 12:50:00 +02:00
2017-07-25 21:50:44 +03:00
2017-05-20 10:21:34 -04:00
2017-01-02 18:28:18 -05:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2017-03-10 11:23:48 -08:00
2015-09-06 21:38:07 +10:00
2015-09-06 21:38:08 +10:00
2015-12-05 11:15:49 -05:00
2017-03-10 11:23:48 -08:00
2017-08-27 21:14:34 -03:00
2013-03-26 01:37:49 +01:00
2017-06-06 23:33:56 -07:00
2017-07-12 12:12:48 +08:00
2017-02-28 18:39:20 -08:00
2017-07-20 16:22:02 -04:00
2017-02-28 18:39:20 -08:00
2017-07-20 16:22:02 -04:00
2017-07-20 16:22:02 -04:00
2011-08-04 16:52:55 +02:00
2011-08-04 16:52:55 +02:00
2015-03-22 20:07:49 +01:00
2016-03-24 13:19:11 -07:00
2012-12-13 17:00:28 -08:00
2010-02-25 11:41:11 -08:00