diff options
Diffstat (limited to 'demos/smime')
-rw-r--r-- | demos/smime/smdec.c | 6 | ||||
-rw-r--r-- | demos/smime/smenc.c | 6 | ||||
-rw-r--r-- | demos/smime/smsign.c | 6 | ||||
-rw-r--r-- | demos/smime/smsign2.c | 6 | ||||
-rw-r--r-- | demos/smime/smver.c | 7 |
5 files changed, 15 insertions, 16 deletions
diff --git a/demos/smime/smdec.c b/demos/smime/smdec.c index debcedd5e8..bd8ac88d93 100644 --- a/demos/smime/smdec.c +++ b/demos/smime/smdec.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) X509 *rcert = NULL; EVP_PKEY *rkey = NULL; PKCS7 *p7 = NULL; - int ret = 1; + int ret = EXIT_FAILURE; OpenSSL_add_all_algorithms(); ERR_load_crypto_strings(); @@ -59,10 +59,10 @@ int main(int argc, char **argv) if (!PKCS7_decrypt(p7, rkey, rcert, out, 0)) goto err; - ret = 0; + ret = EXIT_SUCCESS; err: - if (ret) { + if (ret != EXIT_SUCCESS) { fprintf(stderr, "Error Signing Data\n"); ERR_print_errors_fp(stderr); } diff --git a/demos/smime/smenc.c b/demos/smime/smenc.c index 0714dddfd2..a0c365a977 100644 --- a/demos/smime/smenc.c +++ b/demos/smime/smenc.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) X509 *rcert = NULL; STACK_OF(X509) *recips = NULL; PKCS7 *p7 = NULL; - int ret = 1; + int ret = EXIT_FAILURE; /* * On OpenSSL 0.9.9 only: @@ -73,10 +73,10 @@ int main(int argc, char **argv) if (!SMIME_write_PKCS7(out, p7, in, flags)) goto err; - ret = 0; + ret = EXIT_SUCCESS; err: - if (ret) { + if (ret != EXIT_SUCCESS) { fprintf(stderr, "Error Encrypting Data\n"); ERR_print_errors_fp(stderr); } diff --git a/demos/smime/smsign.c b/demos/smime/smsign.c index ac2c27b525..6e627ec944 100644 --- a/demos/smime/smsign.c +++ b/demos/smime/smsign.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) X509 *scert = NULL; EVP_PKEY *skey = NULL; PKCS7 *p7 = NULL; - int ret = 1; + int ret = EXIT_FAILURE; /* * For simple S/MIME signing use PKCS7_DETACHED. On OpenSSL 0.9.9 only: @@ -69,10 +69,10 @@ int main(int argc, char **argv) if (!SMIME_write_PKCS7(out, p7, in, flags)) goto err; - ret = 0; + ret = EXIT_SUCCESS; err: - if (ret) { + if (ret != EXIT_SUCCESS) { fprintf(stderr, "Error Signing Data\n"); ERR_print_errors_fp(stderr); } diff --git a/demos/smime/smsign2.c b/demos/smime/smsign2.c index a9e7025748..88a61b7f22 100644 --- a/demos/smime/smsign2.c +++ b/demos/smime/smsign2.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) X509 *scert = NULL, *scert2 = NULL; EVP_PKEY *skey = NULL, *skey2 = NULL; PKCS7 *p7 = NULL; - int ret = 1; + int ret = EXIT_FAILURE; OpenSSL_add_all_algorithms(); ERR_load_crypto_strings(); @@ -77,10 +77,10 @@ int main(int argc, char **argv) if (!SMIME_write_PKCS7(out, p7, in, PKCS7_STREAM)) goto err; - ret = 0; + ret = EXIT_SUCCESS; err: - if (ret) { + if (ret != EXIT_SUCCESS) { fprintf(stderr, "Error Signing Data\n"); ERR_print_errors_fp(stderr); } diff --git a/demos/smime/smver.c b/demos/smime/smver.c index 5d552b1808..9f77b7f552 100644 --- a/demos/smime/smver.c +++ b/demos/smime/smver.c @@ -18,8 +18,7 @@ int main(int argc, char **argv) X509_STORE *st = NULL; X509 *cacert = NULL; PKCS7 *p7 = NULL; - - int ret = 1; + int ret = EXIT_FAILURE; OpenSSL_add_all_algorithms(); ERR_load_crypto_strings(); @@ -69,10 +68,10 @@ int main(int argc, char **argv) fprintf(stderr, "Verification Successful\n"); - ret = 0; + ret = EXIT_SUCCESS; err: - if (ret) { + if (ret != EXIT_SUCCESS) { fprintf(stderr, "Error Verifying Data\n"); ERR_print_errors_fp(stderr); } |