diff options
author | Eric Biggers <ebiggers@google.com> | 2017-12-08 15:13:28 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-12-08 15:13:28 +0000 |
commit | a27417a9c9997c295887ef4bb966db5cd92e5224 (patch) | |
tree | 991266c02d9fc05a6608317de0477229d6e360ac /crypto/asymmetric_keys | |
parent | 49c043bf8e2ae3a0e62685663eb8f6af7fd72353 (diff) | |
download | linux-crypto-a27417a9c9997c295887ef4bb966db5cd92e5224.tar.gz linux-crypto-a27417a9c9997c295887ef4bb966db5cd92e5224.zip |
pkcs7: return correct error code if pkcs7_check_authattrs() fails
If pkcs7_check_authattrs() returns an error code, we should pass that
error code on, rather than using ENOMEM.
Fixes: beba760d1ec2 ("PKCS#7: Appropriately restrict authenticated attributes and content type")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to '')
-rw-r--r-- | crypto/asymmetric_keys/pkcs7_parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_keys/pkcs7_parser.c index c1ca1e86..a6dcaa65 100644 --- a/crypto/asymmetric_keys/pkcs7_parser.c +++ b/crypto/asymmetric_keys/pkcs7_parser.c @@ -148,8 +148,10 @@ struct pkcs7_message *pkcs7_parse_message(const void *data, size_t datalen) } ret = pkcs7_check_authattrs(ctx->msg); - if (ret < 0) + if (ret < 0) { + msg = ERR_PTR(ret); goto out; + } msg = ctx->msg; ctx->msg = NULL; |