diff options
author | Yusong Gao <a869920004@gmail.com> | 2023-12-13 10:31:10 +0000 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-12-13 12:55:11 -0800 |
commit | 829649443e78d85db0cff0c37cadb28fbb1a5f6f (patch) | |
tree | 75edd02e0d70c777c8f7b12d569f789815520691 /fs/btrfs | |
parent | 5bd7ef53ffe5ca580e93e74eb8c81ed191ddc4bd (diff) |
sign-file: Fix incorrect return values check
There are some wrong return values check in sign-file when call OpenSSL
API. The ERR() check cond is wrong because of the program only check the
return value is < 0 which ignored the return val is 0. For example:
1. CMS_final() return 1 for success or 0 for failure.
2. i2d_CMS_bio_stream() returns 1 for success or 0 for failure.
3. i2d_TYPEbio() return 1 for success and 0 for failure.
4. BIO_free() return 1 for success and 0 for failure.
Link: https://www.openssl.org/docs/manmaster/man3/
Fixes: e5a2e3c84782 ("scripts/sign-file.c: Add support for signing with a raw signature")
Signed-off-by: Yusong Gao <a869920004@gmail.com>
Reviewed-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20231213024405.624692-1-a869920004@gmail.com/ # v5
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/btrfs')
0 files changed, 0 insertions, 0 deletions