summaryrefslogtreecommitdiff
path: root/crypto/asymmetric_keys/x509_cert_parser.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-09-26 15:54:31 +0200
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-09-26 15:54:31 +0200
commit50d4fb1dc129955ab571c1dd7bf14cd07cc5984d (patch)
treee7667ecbd53d3985d294ea7ee64e33f9523cedff /crypto/asymmetric_keys/x509_cert_parser.c
parent4ac44d603f290242cbba2e0d0383460412d55c04 (diff)
parenta41bb691f04fcf6d3fa1f6e743d1520e305bc71d (diff)
downloadlinux-crypto-50d4fb1dc129955ab571c1dd7bf14cd07cc5984d.tar.gz
linux-crypto-50d4fb1dc129955ab571c1dd7bf14cd07cc5984d.zip
Merge tag 'v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next
Sync with upstream (which now contains fbdev-v4.19 changes) to prepare a base for fbdev-v4.20 changes.
Diffstat (limited to 'crypto/asymmetric_keys/x509_cert_parser.c')
-rw-r--r--crypto/asymmetric_keys/x509_cert_parser.c9
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;