]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
pki --pkcs7: Set default to res = 1
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 2 Jun 2023 07:06:13 +0000 (09:06 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Nov 2023 11:39:10 +0000 (12:39 +0100)
src/pki/commands/pkcs7.c

index 074beeab5157fd99bde7440cfc464c401606b4c6..d9aa07942667921c9b6fe9764b7ec38e188e1c69 100644 (file)
@@ -288,7 +288,7 @@ static int pkcs7()
        hash_algorithm_t digest = HASH_UNKNOWN;
        signature_params_t *scheme = NULL;
        mem_cred_t *creds;
-       int res = 0;
+       int res = 1;
        FILE *in;
        enum {
                OP_NONE,
@@ -450,7 +450,7 @@ static int pkcs7()
                case OP_DECRYPT:
                        if (!key)
                        {
-                               fprintf(stderr, "decryption requires a private key\n");
+                               error = "decryption requires a private key";
                                break;
                        }
                        res = decrypt(data);