diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-26 08:44:15 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-26 08:44:15 -0700 |
commit | e2e18dee2aa3021b4904b8d44b9764e6d264d9fe (patch) | |
tree | a43a0a99deedb8290f70b7cc756fbffd2db5a94e /crypto | |
parent | c5c0586a6771a33a5da7985495c1beab72d292b1 (diff) | |
parent | 8d03c9c3ae3088eb938ba26fbe9374353e5f97e9 (diff) | |
download | linux-crypto-e2e18dee2aa3021b4904b8d44b9764e6d264d9fe.tar.gz linux-crypto-e2e18dee2aa3021b4904b8d44b9764e6d264d9fe.zip |
Merge branch 'fixes-v4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem fixes from James Morris:
- Smack: fix a regression caused by 1bbc55131e5
- X.509: fix a (usually un-seen) bug in RSA signature parsing
* 'fixes-v4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
X.509: unpack RSA signatureValue field from BIT STRING
Smack: Mark inode instant in smack_task_to_inode
Diffstat (limited to '')
-rw-r--r-- | crypto/asymmetric_keys/x509_cert_parser.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 7d81e6bb..b6cabac4 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -249,6 +249,15 @@ int x509_note_signature(void *context, size_t hdrlen, return -EINVAL; } + if (strcmp(ctx->cert->sig->pkey_algo, "rsa") == 0) { + /* Discard the BIT STRING metadata */ + if (vlen < 1 || *(const u8 *)value != 0) + return -EBADMSG; + + value++; + vlen--; + } + ctx->cert->raw_sig = value; ctx->cert->raw_sig_size = vlen; return 0; |