Maciej S. Szmigiero
af20e4eccc
X.509: unpack RSA signatureValue field from BIT STRING
...
commit b65c32ec5a942ab3ada93a048089a938918aba7f 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: c26fd69fa009 ("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:24:57 +02:00
..
2018-07-03 11:24:57 +02:00
2017-11-02 11:10:55 +01:00
2015-06-25 23:29:24 +08:00
2016-10-25 11:08:33 +08:00
2016-06-23 18:29:53 +08:00
2017-01-13 00:24:39 +08:00
2017-04-21 20:30:50 +08:00
2017-01-13 00:24:39 +08:00
2017-02-11 17:50:43 +08:00
2017-06-19 14:11:53 +08:00
2018-05-16 10:10:23 +02:00
2018-04-08 14:26:31 +02:00
2017-01-13 00:24:39 +08:00
2018-01-17 09:45:23 +01:00
2017-03-02 08:42:32 +01:00
2018-03-03 10:24:29 +01:00
2018-02-16 20:23:00 +01:00
2015-04-22 09:30:21 +08:00
2018-03-03 10:24:29 +01:00
2015-04-22 09:30:18 +08:00
2014-11-24 22:43:57 +08:00
2017-03-02 08:42:32 +01:00
2014-11-24 22:43:57 +08:00
2016-11-01 08:37:17 +08:00
2017-07-18 17:01:11 +08:00
2017-01-13 00:24:39 +08: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
2017-03-09 18:34:39 +08:00
2017-11-03 21:35:35 +08:00
2017-08-22 14:45:47 +08:00
2018-01-10 09:31:18 +01:00
2016-10-21 11:03:42 +08:00
2017-02-11 17:52:28 +08:00
2016-10-21 11:03:42 +08:00
2018-02-16 20:23:00 +01:00
2018-02-16 20:23:00 +01:00
2016-09-13 20:27:26 +08:00
2018-02-16 20:23:00 +01:00
2017-06-19 14:19:54 +08:00
2016-07-18 17:35:44 +08:00
2017-05-02 16:40:27 -07:00
2017-08-04 09:27:15 +08:00
2017-02-11 17:52:28 +08:00
2017-04-24 18:11:08 +08:00
2015-01-13 22:29:11 +11:00
2017-11-21 09:49:21 +01:00
2017-11-21 09:49:20 +01:00
2018-05-01 12:58:23 -07:00
2014-11-26 20:06:30 +08:00
2017-11-02 11:10:55 +01:00
2018-03-19 08:42:49 +01:00
2017-06-10 12:04:35 +08:00
2017-06-10 12:04:25 +08:00
2017-08-03 13:47:22 +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-05-23 12:45:11 +08:00
2017-04-05 21:58:35 +08:00
2016-10-02 22:26:40 +08:00
2015-12-20 15:27:12 +02:00
2017-12-20 10:10:17 +01:00
2016-10-21 11:03:42 +08:00
2016-11-17 23:34:52 +08:00
2015-06-25 23:18:33 +08:00
2018-02-03 17:38:48 +01:00
2016-02-01 22:27:05 +08:00
2014-11-24 22:43:57 +08:00
2017-01-13 00:24:39 +08:00
2018-04-08 14:26:31 +02:00
2017-04-10 19:17:27 +08:00
2017-04-10 19:17:27 +08:00
2017-05-08 17:15:13 -07:00
2018-04-12 12:32:20 +02:00
2018-02-16 20:23:00 +01:00
2014-11-24 22:43:57 +08:00
2017-03-24 22:02:56 +08:00
2014-11-24 22:43:57 +08:00
2017-08-04 09:27:15 +08:00
2018-01-10 09:31:18 +01:00
2018-02-16 20:23:00 +01:00
2015-04-23 14:18:09 +08:00
2017-11-02 11:10:55 +01: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
2017-07-28 17:56:00 +08:00
2017-12-20 10:10:17 +01:00
2017-06-20 11:21:19 +08:00
2017-06-10 12:04:30 +08:00
2016-07-05 23:05:26 +08:00
2015-10-14 22:23:16 +08:00
2017-12-20 10:10:17 +01:00
2016-11-22 15:02:25 +08:00
2017-08-03 13:52:44 +08:00
2014-11-24 22:43:57 +08:00
2017-02-11 17:52:28 +08:00
2017-08-09 20:17:54 +08:00
2015-12-22 20:43:35 +08:00
2018-02-03 17:38:51 +01:00
2015-12-22 20:43:35 +08:00
2015-04-10 21:39:41 +08:00
2018-02-16 20:23:00 +01:00
2016-11-28 21:23:18 +08:00
2017-12-29 17:53:45 +01:00
2018-02-13 10:19:49 +01:00
2015-07-17 21:20:20 +08:00
2015-01-13 22:29:11 +11:00
2017-06-28 22:18:58 +08:00
2018-04-08 14:26:31 +02:00
2015-01-13 22:29:11 +11: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
2018-02-22 15:42:23 +01:00
2017-10-07 12:04:31 +08:00