Maciej S. Szmigiero
41b1d57a67
X.509: unpack RSA signatureValue field from BIT STRING
...
commit b65c32ec5a upstream.
The signatureValue field of a X.509 certificate is encoded as a BIT STRING.
For RSA signatures this BIT STRING is of so-called primitive subtype, which
contains a u8 prefix indicating a count of unused bits in the encoding.
We have to strip this prefix from signature data, just as we already do for
key data in x509_extract_key_data() function.
This wasn't noticed earlier because this prefix byte is zero for RSA key
sizes divisible by 8. Since BIT STRING is a big-endian encoding adding zero
prefixes has no bearing on its value.
The signature length, however was incorrect, which is a problem for RSA
implementations that need it to be exactly correct (like AMD CCP).
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name >
Fixes: c26fd69fa0 ("X.509: Add a crypto key parser for binary (DER) X.509 certificates")
Cc: stable@vger.kernel.org
Signed-off-by: James Morris <james.morris@microsoft.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-03 11:23:11 +02:00
..
2018-07-03 11:23:11 +02:00
2018-04-13 19:47:58 +02:00
2015-06-25 23:29:24 +08:00
2015-05-11 15:06:43 +08:00
2016-06-23 18:29:53 +08:00
2016-07-18 17:35:46 +08:00
2016-07-18 17:35:43 +08:00
2015-01-13 22:29:11 +11:00
2018-05-16 10:08:40 +02:00
2018-04-08 12:12:57 +02:00
2015-12-09 20:03:57 +08:00
2018-01-17 09:38:54 +01:00
2015-08-17 16:53:41 +08:00
2017-05-20 14:28:37 +02:00
2018-02-25 11:05:44 +01:00
2015-04-22 09:30:21 +08:00
2017-09-27 14:39:20 +02:00
2015-04-22 09:30:18 +08:00
2014-11-24 22:43:57 +08:00
2015-10-20 21:59:25 +08:00
2014-11-24 22:43:57 +08:00
2016-07-18 17:35:38 +08:00
2017-08-06 18:59:40 -07:00
2016-09-13 18:44:57 +08:00
2011-09-22 21:25:25 +10:00
2015-01-13 22:29:11 +11:00
2015-01-13 22:29:11 +11:00
2015-01-13 22:29:11 +11:00
2015-01-13 22:29:11 +11:00
2013-08-14 20:42:03 +10:00
2014-11-26 20:06:30 +08:00
2017-11-15 15:53:18 +01:00
2016-07-03 00:57:23 -04:00
2018-01-10 09:29:51 +01:00
2010-02-16 20:31:37 +08:00
2014-11-26 20:06:30 +08:00
2010-02-16 20:31:04 +08:00
2018-02-25 11:05:43 +01:00
2018-02-25 11:05:43 +01:00
2013-09-12 15:31:34 +10:00
2016-09-13 20:27:26 +08:00
2018-02-25 11:05:43 +01:00
2016-10-11 15:06:33 -07:00
2016-07-18 17:35:44 +08:00
2016-07-21 12:26:55 +08:00
2014-03-21 21:54:28 +08:00
2016-07-18 17:35:39 +08:00
2016-07-18 17:35:44 +08:00
2014-11-24 22:43:57 +08:00
2015-01-13 22:29:11 +11:00
2017-11-21 09:23:29 +01:00
2017-11-24 08:33:41 +01:00
2018-05-01 15:13:08 -07:00
2014-11-26 20:06:30 +08:00
2016-06-23 18:29:57 +08:00
2016-06-24 21:24:59 +08:00
2016-06-24 21:24:59 +08:00
2016-06-23 18:29:57 +08:00
2016-06-24 21:24:59 +08:00
2016-09-13 18:44:57 +08:00
2014-11-24 22:43:57 +08:00
2015-04-23 14:18:09 +08:00
2017-06-14 15:05:55 +02:00
2011-07-08 17:21:21 +08:00
2016-10-02 22:26:40 +08:00
2015-12-20 15:27:12 +02:00
2017-12-20 10:07:15 +01:00
2016-01-25 22:42:12 +08:00
2016-06-24 21:24:58 +08:00
2015-06-25 23:18:33 +08:00
2018-02-03 17:05:34 +01:00
2016-02-01 22:27:05 +08:00
2014-11-24 22:43:57 +08:00
2016-06-23 18:29:56 +08:00
2014-11-26 20:06:30 +08:00
2014-11-24 22:43:57 +08:00
2014-11-24 22:43:57 +08:00
2016-04-15 22:36:36 +08:00
2017-03-18 19:14:26 +08:00
2018-02-25 11:05:43 +01:00
2014-11-24 22:43:57 +08:00
2015-12-22 20:43:35 +08:00
2013-12-09 20:09:12 +08:00
2014-11-24 22:43:57 +08:00
2014-11-26 20:06:30 +08:00
2018-01-10 09:29:51 +01:00
2018-02-17 13:21:15 +01:00
2015-04-23 14:18:09 +08:00
2008-07-10 20:35:12 +08:00
2014-11-24 22:43:57 +08:00
2014-11-24 22:43:57 +08:00
2014-11-24 22:43:57 +08:00
2014-11-24 22:43:57 +08:00
2015-06-22 15:49:18 +08:00
2017-12-20 10:07:15 +01:00
2017-07-15 12:16:16 +02:00
2016-07-01 23:45:18 +08:00
2016-07-05 23:05:26 +08:00
2015-10-14 22:23:16 +08:00
2017-12-20 10:07:15 +01:00
2016-11-22 15:02:25 +08:00
2014-11-24 22:43:57 +08:00
2016-07-18 17:35:46 +08:00
2015-01-13 22:29:11 +11:00
2015-12-22 20:43:35 +08:00
2018-02-03 17:05:34 +01:00
2015-12-22 20:43:35 +08:00
2015-04-10 21:39:41 +08:00
2018-02-25 11:05:44 +01:00
2017-06-07 12:07:46 +02:00
2018-02-13 12:36:02 +01:00
2015-07-17 21:20:20 +08:00
2015-01-13 22:29:11 +11:00
2016-10-02 22:33:43 +08:00
2017-03-12 06:41:47 +01:00
2015-01-13 22:29:11 +11:00
2011-11-09 11:53:32 +08:00
2015-01-13 22:29:11 +11:00
2014-11-26 20:06:30 +08:00
2015-01-13 22:29:11 +11:00
2014-11-26 20:06:30 +08:00
2016-08-31 23:00:48 +08:00
2016-08-16 17:16:49 +08:00